Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index d139cd8e6603755aa58997fbf882a4b5c6bfccf1..4ed33a0072a6ae8628fce88646a1fe49bcae12c0 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -726,6 +726,9 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ RecordWriteField(x1, JSGeneratorObject::kInputOffset, x0, x3, |
kLRHasNotBeenSaved, kDontSaveFPRegs); |
+ // Store resume mode into generator object. |
+ __ Str(x2, FieldMemOperand(x1, JSGeneratorObject::kResumeModeOffset)); |
+ |
// Load suspended function and context. |
__ Ldr(cp, FieldMemOperand(x1, JSGeneratorObject::kContextOffset)); |
__ Ldr(x4, FieldMemOperand(x1, JSGeneratorObject::kFunctionOffset)); |
@@ -797,16 +800,10 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ Bind(&done_loop); |
} |
- // Push resume mode (consumed in continuation). |
- __ Push(x2); |
- |
// Reset operand stack so we don't leak. |
__ LoadRoot(x10, Heap::kEmptyFixedArrayRootIndex); |
__ Str(x10, FieldMemOperand(x1, JSGeneratorObject::kOperandStackOffset)); |
- // Restore value. |
- __ Ldr(x0, FieldMemOperand(x1, JSGeneratorObject::kInputOffset)); |
- |
// Resume the generator function at the continuation. |
__ Ldr(x10, FieldMemOperand(x4, JSFunction::kSharedFunctionInfoOffset)); |
__ Ldr(x10, FieldMemOperand(x10, SharedFunctionInfo::kCodeOffset)); |
@@ -816,6 +813,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ Add(x10, x10, x11); |
__ Mov(x12, Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)); |
__ Str(x12, FieldMemOperand(x1, JSGeneratorObject::kContinuationOffset)); |
+ __ Move(x0, x1); // Continuation expects generator object in x0. |
__ Br(x10); |
} |