Commit cfebd19a authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[liftoff] Disable opcode merging when debugging

For debugging code, disable opcode merging. Otherwise, the effect of the
first merged opcode would not be observable when stepping.

R=thibaudm@chromium.org

Bug: v8:10350
Change-Id: Id656c9dee8f9676bf3d7881f3782e5ead76b5e71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2306802
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68960}
parent 7d5538e2
......@@ -1103,7 +1103,7 @@ class LiftoffCompiler {
kNoTrap)
case kExprI32Eqz:
DCHECK(decoder->lookahead(0, kExprI32Eqz));
if (decoder->lookahead(1, kExprBrIf)) {
if (decoder->lookahead(1, kExprBrIf) && !for_debugging_) {
DCHECK(!has_outstanding_op());
outstanding_op_ = kExprI32Eqz;
break;
......@@ -1213,7 +1213,7 @@ class LiftoffCompiler {
template <WasmOpcode opcode>
void EmitI32CmpOp(FullDecoder* decoder) {
DCHECK(decoder->lookahead(0, opcode));
if (decoder->lookahead(1, kExprBrIf)) {
if (decoder->lookahead(1, kExprBrIf) && !for_debugging_) {
DCHECK(!has_outstanding_op());
outstanding_op_ = opcode;
return;
......
Tests that Liftoff does not merge opcodes while stepping
Warning: This test tests the current (incorrect) behaviour. It will be fixed in a follow-up CL.
Setting breakpoint at offset 33.
Paused at offset 33: [0]
Paused at offset 35: [0, 0]
Paused at offset 36: [0, 0]
Paused at offset 36: [0, 1]
Paused at offset 33: [-1]
Paused at offset 35: [-1, -1]
Paused at offset 36: [-1, -1]
Paused at offset 36: [-1, 0]
Paused at offset 38: [-1]
Paused at offset 33: [13]
Paused at offset 35: [13, 13]
Paused at offset 36: [13, 13]
Paused at offset 36: [13, 0]
Paused at offset 38: [13]
Finished.
......@@ -26,11 +26,6 @@ Protocol.Debugger.onPaused(printPauseLocationAndStep);
WasmInspectorTest.instantiate(module_bytes);
[, {params: {scriptId: wasm_script_id}}] = await Protocol.Debugger.onceScriptParsed(2);
// TODO(clemensb): Fix this.
InspectorTest.log(
'Warning: This test tests the current (incorrect) behaviour. ' +
'It will be fixed in a follow-up CL.');
// Set a breakpoint at the beginning of 'fun'.
const offset = fun.body_offset;
InspectorTest.log(`Setting breakpoint at offset ${offset}.`);
......
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