Commit 85382b81 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm][liftoff] Correctly print prefixed opcodes in code comments

Prefixed opcodes do not get written correctly in code comments in
Liftoff. The reason is that only one byte is interpreted as the opcode,
but prefixed opcodes take two bytes. This CL loads the second byte if
necessary.

The change could be done in function-body-decoder-impl.h, but that could
lead to performance regressions: it is a hot code path, and the change
here is just for debugging.

R=clemensb@chromium.org

Bug: v8:10155
Change-Id: I2282c068c81b5b1e2e2ed9757f4e77687d1d4ede
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2091467Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66613}
parent 3ff5eba9
......@@ -661,8 +661,14 @@ class LiftoffCompiler {
EmitBreakpoint(decoder);
}
TraceCacheState(decoder);
#ifdef DEBUG
SLOW_DCHECK(__ ValidateCacheState());
if (WasmOpcodes::IsPrefixOpcode(opcode)) {
byte op_index = *(decoder->pc() + 1);
opcode = static_cast<WasmOpcode>(opcode << 8 | op_index);
}
DEBUG_CODE_COMMENT(WasmOpcodes::OpcodeName(opcode));
#endif
}
void EmitBreakpoint(FullDecoder* decoder) {
......
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