[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 <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Régis Crelier
2019-08-28 22:20:53 +00:00
committed by commit-bot@chromium.org
parent 63133a2a8c
commit a290271dea
4 changed files with 4 additions and 4 deletions
+4
View File
@@ -3174,6 +3174,10 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
@override
visitThrow(Throw node) {
_generateNode(node.expression);
if (options.emitDebuggerStops) {
asm.emitDebugCheck();
}
asm.emitThrow(0);
}
@@ -1569,8 +1569,6 @@ void BytecodeFlowGraphBuilder::BuildThrow() {
UNIMPLEMENTED(); // TODO(alexmarkov): interpreter
}
BuildDebugStepCheck();
if (DecodeOperandA().value() == 0) {
// throw
LoadStackSlots(1);
-1
View File
@@ -994,7 +994,6 @@ class KernelBytecode {
case KernelBytecode::kDynamicCall:
case KernelBytecode::kDynamicCall_Wide:
case KernelBytecode::kReturnTOS:
case KernelBytecode::kThrow:
case KernelBytecode::kEqualsNull:
case KernelBytecode::kNegateInt:
case KernelBytecode::kNegateDouble:
-1
View File
@@ -1780,7 +1780,6 @@ SwitchDispatch:
{
BYTECODE(Throw, A);
DEBUG_CHECK;
{
SP[1] = 0; // Space for result.
Exit(thread, FP, SP + 2, pc);