Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index 530e8116166a17954bb5b47078a4d722036f467a..54377088e74cc6d4e427e381db6ff5370bc86d71 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -841,20 +841,21 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
// Flood function if we are stepping. |
- Label skip_flooding; |
+ Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator; |
+ Label stepping_prepared; |
ExternalReference step_in_enabled = |
ExternalReference::debug_step_in_enabled_address(masm->isolate()); |
__ li(t1, Operand(step_in_enabled)); |
__ lb(t1, MemOperand(t1)); |
- __ Branch(&skip_flooding, eq, t1, Operand(zero_reg)); |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- __ Push(a1, a2, t0); |
- __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
- __ Pop(a1, a2); |
- __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
- } |
- __ bind(&skip_flooding); |
+ __ Branch(&prepare_step_in_if_stepping, ne, t1, Operand(zero_reg)); |
+ |
+ // Flood function if we need to continue stepping in the suspended generator. |
+ ExternalReference debug_suspended_generator = |
+ ExternalReference::debug_suspended_generator_address(masm->isolate()); |
+ __ li(t1, Operand(debug_suspended_generator)); |
+ __ lw(t1, MemOperand(t1)); |
+ __ Branch(&prepare_step_in_suspended_generator, eq, t1, Operand(zero_reg)); |
+ __ bind(&stepping_prepared); |
// Push receiver. |
__ lw(t1, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); |
@@ -950,6 +951,26 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ Move(v0, a1); // Continuation expects generator object in v0. |
__ Jump(a3); |
} |
+ |
+ __ bind(&prepare_step_in_if_stepping); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(a1, a2, t0); |
+ __ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); |
+ __ Pop(a1, a2); |
+ } |
+ __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
+ __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
+ |
+ __ bind(&prepare_step_in_suspended_generator); |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(a1, a2); |
+ __ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator); |
+ __ Pop(a1, a2); |
+ } |
+ __ Branch(USE_DELAY_SLOT, &stepping_prepared); |
+ __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |
} |
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) { |