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

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

Issue 1867263002: [generators] Store the resume mode in the generator object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Other platforms Created 4 years, 8 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/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index d743d1c097225b1099e802f3bff1ec1f228b710f..dbd13289b7a525658aa545c16687714edab18dfe 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -479,6 +479,9 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ RecordWriteField(rbx, JSGeneratorObject::kInputOffset, rax, rcx,
kDontSaveFPRegs);
+ // Store resume mode into generator object.
+ __ movp(FieldOperand(rbx, JSGeneratorObject::kResumeModeOffset), rdx);
+
// Load suspended function and context.
__ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset));
__ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset));
@@ -559,16 +562,12 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ bind(&done_loop);
}
- // Push resume mode (consumed in continuation).
- __ Push(rdx);
-
// Reset operand stack so we don't leak.
__ LoadRoot(FieldOperand(rbx, JSGeneratorObject::kOperandStackOffset),
Heap::kEmptyFixedArrayRootIndex);
- // Restore context and value.
+ // Restore context.
__ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset));
- __ movp(rax, FieldOperand(rbx, JSGeneratorObject::kInputOffset));
// Resume the generator function at the continuation.
__ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
@@ -578,6 +577,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ leap(rdx, FieldOperand(rdx, rcx, times_1, Code::kHeaderSize));
__ Move(FieldOperand(rbx, JSGeneratorObject::kContinuationOffset),
Smi::FromInt(JSGeneratorObject::kGeneratorExecuting));
+ __ movp(rax, rbx); // Continuation expects generator object in rax.
__ jmp(rdx);
}
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698