Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: src/builtins/x64/builtins-x64.cc

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-promise.cc ('k') | src/code-factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/builtins/builtins-promise.cc ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698