Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: src/wasm/ast-decoder.cc

Issue 2307733002: [wasm] Fix wasm decoder tracing for prefix opcodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index a778ad13beb9e92efce1fdf42fa66fa7e995f1be..6e6807003f310c0f9ac161feccead086d8b7501f 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -509,7 +509,7 @@ class WasmFullDecoder : public WasmDecoder {
}
if (ssa_env_->go()) {
- TRACE(" @%-6d #xx:%-20s|", startrel(pc_), "ImplicitReturn");
+ TRACE(" @%-8d #xx:%-20s|", startrel(pc_), "ImplicitReturn");
DoReturn();
if (failed()) return TraceFailed();
TRACE("\n");
@@ -707,8 +707,10 @@ class WasmFullDecoder : public WasmDecoder {
while (true) { // decoding loop.
unsigned len = 1;
WasmOpcode opcode = static_cast<WasmOpcode>(*pc_);
- TRACE(" @%-6d #%02x:%-20s|", startrel(pc_), opcode,
- WasmOpcodes::ShortOpcodeName(opcode));
+ if (!WasmOpcodes::IsPrefixOpcode(opcode)) {
+ TRACE(" @%-8d #%02x:%-20s|", startrel(pc_), opcode,
+ WasmOpcodes::ShortOpcodeName(opcode));
+ }
FunctionSig* sig = WasmOpcodes::Signature(opcode);
if (sig) {
@@ -1271,6 +1273,8 @@ class WasmFullDecoder : public WasmDecoder {
len++;
byte simd_index = *(pc_ + 1);
opcode = static_cast<WasmOpcode>(opcode << 8 | simd_index);
+ TRACE(" @%-4d #%02x #%02x:%-20s|", startrel(pc_), kSimdPrefix,
+ simd_index, WasmOpcodes::ShortOpcodeName(opcode));
DecodeSimdOpcode(opcode);
break;
}
@@ -1285,6 +1289,9 @@ class WasmFullDecoder : public WasmDecoder {
for (size_t i = 0; i < stack_.size(); ++i) {
Value& val = stack_[i];
WasmOpcode opcode = static_cast<WasmOpcode>(*val.pc);
+ if (WasmOpcodes::IsPrefixOpcode(opcode)) {
+ opcode = static_cast<WasmOpcode>(opcode << 8 | *(val.pc + 1));
+ }
PrintF(" %c@%d:%s", WasmOpcodes::ShortNameOf(val.type),
static_cast<int>(val.pc - start_),
WasmOpcodes::ShortOpcodeName(opcode));
« no previous file with comments | « no previous file | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698