Skip to content

Commit a290271

Browse files
creliercommit-bot@chromium.org
authored andcommitted
[vm/bytecode] Throw should be 'debug checked', but not ReThrow.
Since both throw and rethrow statements share the same 'Throw' bytecode opcode (differentiated by an operand), we make the opcode not implicitly 'debug checked' anymore. Instead, we emit a 'DebugCheck' opcode for the throw statement only. This fixes the following test: service/async_single_step_exception_test Change-Id: I4e540ea0a640fda5365d51933ce4e5125548e2f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114754 Commit-Queue: Régis Crelier <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
1 parent 63133a2 commit a290271

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pkg/vm/lib/bytecode/gen_bytecode.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,6 +3174,10 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
31743174
@override
31753175
visitThrow(Throw node) {
31763176
_generateNode(node.expression);
3177+
3178+
if (options.emitDebuggerStops) {
3179+
asm.emitDebugCheck();
3180+
}
31773181
asm.emitThrow(0);
31783182
}
31793183

runtime/vm/compiler/frontend/bytecode_flow_graph_builder.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,6 @@ void BytecodeFlowGraphBuilder::BuildThrow() {
15691569
UNIMPLEMENTED(); // TODO(alexmarkov): interpreter
15701570
}
15711571

1572-
BuildDebugStepCheck();
1573-
15741572
if (DecodeOperandA().value() == 0) {
15751573
// throw
15761574
LoadStackSlots(1);

runtime/vm/constants_kbc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,6 @@ class KernelBytecode {
994994
case KernelBytecode::kDynamicCall:
995995
case KernelBytecode::kDynamicCall_Wide:
996996
case KernelBytecode::kReturnTOS:
997-
case KernelBytecode::kThrow:
998997
case KernelBytecode::kEqualsNull:
999998
case KernelBytecode::kNegateInt:
1000999
case KernelBytecode::kNegateDouble:

runtime/vm/interpreter.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,6 @@ RawObject* Interpreter::Call(RawFunction* function,
17801780

17811781
{
17821782
BYTECODE(Throw, A);
1783-
DEBUG_CHECK;
17841783
{
17851784
SP[1] = 0; // Space for result.
17861785
Exit(thread, FP, SP + 2, pc);

0 commit comments

Comments
 (0)