Index: src/builtins/x64/builtins-x64.cc |
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc |
index 87dfc7d3a6b6305a4d7ec63c05c36e47b5418a7c..d0cd7b43ad47eb6e3f18b09553b24e6c6e2d87fe 100644 |
--- a/src/builtins/x64/builtins-x64.cc |
+++ b/src/builtins/x64/builtins-x64.cc |
@@ -440,19 +440,21 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { |
} |
// static |
-void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
+void Builtins::Generate_ResumeGenerator(MacroAssembler* masm, |
+ ResumeGeneratorType type) { |
// ----------- S t a t e ------------- |
// -- rax : the value to pass to the generator |
// -- rbx : the JSGeneratorObject to resume |
// -- rdx : the resume mode (tagged) |
// -- rsp[0] : return address |
// ----------------------------------- |
- __ AssertGeneratorObject(rbx); |
// Store input value into generator object. |
- __ movp(FieldOperand(rbx, JSGeneratorObject::kInputOrDebugPosOffset), rax); |
- __ RecordWriteField(rbx, JSGeneratorObject::kInputOrDebugPosOffset, rax, rcx, |
- kDontSaveFPRegs); |
+ int offset = type == ResumeGeneratorType::kYield |
+ ? JSGeneratorObject::kInputOrDebugPosOffset |
+ : JSAsyncGeneratorObject::kAwaitInputOffset; |
+ __ movp(FieldOperand(rbx, offset), rax); |
+ __ RecordWriteField(rbx, offset, rax, rcx, kDontSaveFPRegs); |
// Store resume mode into generator object. |
__ movp(FieldOperand(rbx, JSGeneratorObject::kResumeModeOffset), rdx); |
@@ -559,6 +561,30 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ jmp(&stepping_prepared); |
} |
+// static |
+void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : the value to pass to the generator |
+ // -- rbx : the JSGeneratorObject to resume |
+ // -- rdx : the resume mode (tagged) |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ __ AssertGeneratorObject(rbx); |
+ Generate_ResumeGenerator(masm, ResumeGeneratorType::kYield); |
+} |
+ |
+// static |
+void Builtins::Generate_ResumeAwaitedGeneratorTrampoline(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : the value to pass to the generator |
+ // -- rbx : the JSGeneratorObject to resume |
+ // -- rdx : the resume mode (tagged) |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ __ AssertAsyncGeneratorObject(rbx); |
+ Generate_ResumeGenerator(masm, ResumeGeneratorType::kAwait); |
+} |
+ |
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1, |
Register scratch2) { |
Register args_count = scratch1; |