Commit 1f5842ad authored by jiepan's avatar jiepan Committed by Commit Bot

Fix printing order of opcode prefix and space

Leading whitespaces are used to indiate control depth,
opcode prefix should be printed after the whitespaces.

Change-Id: I0a22864d1d5a2e643b15a4c10909c0387922f8e3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2224959Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Jie Pan <jie.pan@intel.com>
Cr-Commit-Position: refs/heads/master@{#68092}
parent cc1b741e
......@@ -176,8 +176,10 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
unsigned offset = 1;
WasmOpcode opcode = i.current();
if (WasmOpcodes::IsPrefixOpcode(opcode)) {
os << PrefixName(opcode) << ", ";
WasmOpcode prefix = kExprUnreachable;
bool has_prefix = WasmOpcodes::IsPrefixOpcode(opcode);
if (has_prefix) {
prefix = i.current();
opcode = i.prefixed_opcode();
offset = 2;
}
......@@ -193,6 +195,10 @@ bool PrintRawWasmCode(AccountingAllocator* allocator, const FunctionBody& body,
" ";
os.write(padding, num_whitespaces);
if (has_prefix) {
os << PrefixName(prefix) << ", ";
}
os << RawOpcodeName(opcode) << ",";
if (opcode == kExprLoop || opcode == kExprIf || opcode == kExprBlock ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment