From a69340ebf8e8bd5820b004002c4ea4761164fcbf Mon Sep 17 00:00:00 2001 From: chenxun Date: Thu, 21 Sep 2023 17:28:45 +0800 Subject: [PATCH] =?UTF-8?q?typedop=E4=BB=A3=E6=9B=BFop=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenxun --- tools/circuit_viewer/src/ir/IrToPicture.js | 8 +++++++- tools/circuit_viewer/src/ir/IrViewer.js | 15 +++++++++------ tools/circuit_viewer/src/ir/LogParser.js | 4 ++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tools/circuit_viewer/src/ir/IrToPicture.js b/tools/circuit_viewer/src/ir/IrToPicture.js index 175450e099..1a8e742330 100644 --- a/tools/circuit_viewer/src/ir/IrToPicture.js +++ b/tools/circuit_viewer/src/ir/IrToPicture.js @@ -98,10 +98,16 @@ class IrToPicture { if (type == 0) {//仅控制流 if (this.nodeType(ir) != "control") continue; } - let name = ir.id + "," + ir.op; + let name; if (XTools.CONFIG.OpTypeJsBytecode.indexOf(ir.op) >= 0) { name = ir.id + "," + ir.bytecode; } + else if (ir.typedop) { + name = ir.id + "," + ir.typedop; + } + else { + name = ir.id + "," + ir.op; + } nodes[ir.id] = { type: this.nodeType(ir), mask: this.nodeTypeMask(ir), diff --git a/tools/circuit_viewer/src/ir/IrViewer.js b/tools/circuit_viewer/src/ir/IrViewer.js index f1628715dd..0c46872f9f 100644 --- a/tools/circuit_viewer/src/ir/IrViewer.js +++ b/tools/circuit_viewer/src/ir/IrViewer.js @@ -866,15 +866,18 @@ class IrViewer { this.selectPoint_ = []; for (let i in nodes) { let n = nodes[i]; + let searchName; if (XTools.CONFIG.OpTypeJsBytecode.indexOf(n.ir.op) >= 0) { - if (n.ir.id == v || n.ir.bytecode.indexOf(v) >= 0 || (isRegExp(v) && n.ir.bytecode.match(v))) { - this.searchInput.result.push(i); - } + searchName = n.ir.bytecode; + } + else if (n.ir.typedop) { + searchName = n.ir.typedop; } else { - if (n.ir.id == v || n.ir.op.indexOf(v) >= 0 || (isRegExp(v) && n.ir.op.match(v))) { - this.searchInput.result.push(i); - } + searchName = n.ir.op; + } + if (n.ir.id == v || searchName.indexOf(v) >= 0 || (isRegExp(v) && searchName.match(v))) { + this.searchInput.result.push(i); } } if (this.searchInput.result.length > 0) { diff --git a/tools/circuit_viewer/src/ir/LogParser.js b/tools/circuit_viewer/src/ir/LogParser.js index 4fe8828893..04cd658a02 100644 --- a/tools/circuit_viewer/src/ir/LogParser.js +++ b/tools/circuit_viewer/src/ir/LogParser.js @@ -78,9 +78,9 @@ class LogParser { } isStart(l) { //========= After bytecode2circuit lowering [func_main_0@484@arkcompiler/ets_runtime/sd_test/ttabs.abc] ======== - const regexStart = /=+ *After ([a-zA-Z0-9_ ]+) \[([#a-zA-Z0-9_@/.]+)\] *=+/g + const regexStart = /=+ *After ([a-zA-Z0-9_ ]+) \[([#a-zA-Z0-9_@/.-]+)\] *=+/g //========= After inlining [OthreMath@test@arkcompiler/ets_runtime/sd_test/test.abc] Caller method [func_main_0@641@arkcompiler/ets_runtime/sd_test/test.abc]==================== - const regexStart2 = /=+ *After ([a-zA-Z0-9_ ]+) \[([a-zA-Z0-9_@/.]+)\] *Caller method \[([#a-zA-Z0-9_@/.]+)\] *=+/g + const regexStart2 = /=+ *After ([a-zA-Z0-9_ ]+) \[([a-zA-Z0-9_@/.-]+)\] *Caller method \[([#a-zA-Z0-9_@/.]+)\] *=+/g if (l[11] != '=') { return;