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

Unified Diff: src/ia32/builtins-ia32.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/full-codegen/x64/full-codegen-x64.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
index 9623f115db4862ab0fa26fe735d9b85cf62dfd66..16a2b3215e01ef0d15337592e75ec6b2a62e62bf 100644
--- a/src/ia32/builtins-ia32.cc
+++ b/src/ia32/builtins-ia32.cc
@@ -406,6 +406,9 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ RecordWriteField(ebx, JSGeneratorObject::kInputOffset, eax, ecx,
kDontSaveFPRegs);
+ // Store resume mode into generator object.
+ __ mov(FieldOperand(ebx, JSGeneratorObject::kResumeModeOffset), edx);
+
// Load suspended function and context.
__ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset));
__ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
@@ -484,16 +487,10 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ bind(&done_loop);
}
- // Push resume mode (consumed in continuation).
- __ Push(edx);
-
// Reset operand stack so we don't leak.
__ mov(FieldOperand(ebx, JSGeneratorObject::kOperandStackOffset),
Immediate(masm->isolate()->factory()->empty_fixed_array()));
- // Restore value.
- __ mov(eax, FieldOperand(ebx, JSGeneratorObject::kInputOffset));
-
// Resume the generator function at the continuation.
__ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
__ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset));
@@ -502,6 +499,7 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ lea(edx, FieldOperand(edx, ecx, times_1, Code::kHeaderSize));
__ mov(FieldOperand(ebx, JSGeneratorObject::kContinuationOffset),
Immediate(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)));
+ __ mov(eax, ebx); // Continuation expects generator object in eax.
__ jmp(edx);
}
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698