Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index feb12319f84619b281d7d8f0a0d4e85519e2d63f..74fd005d0cd793c4ff11025e30cc37957cf55ca4 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -719,6 +719,9 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ RecordWriteField(r1, JSGeneratorObject::kInputOffset, r0, r3, |
kLRHasNotBeenSaved, kDontSaveFPRegs); |
+ // Store resume mode into generator object. |
+ __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kResumeModeOffset)); |
+ |
// Load suspended function and context. |
__ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); |
__ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
@@ -794,16 +797,10 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ bind(&done_loop); |
} |
- // Push resume mode (consumed in continuation). |
- __ Push(r2); |
- |
// Reset operand stack so we don't leak. |
__ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
__ str(ip, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
- // Restore value. |
- __ ldr(r0, FieldMemOperand(r1, JSGeneratorObject::kInputOffset)); |
- |
// Resume the generator function at the continuation. |
__ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
__ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); |
@@ -812,6 +809,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ add(r3, r3, Operand(r2, ASR, 1)); |
__ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
__ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
+ __ Move(r0, r1); // Continuation expects generator object in r0. |
__ Jump(r3); |
} |