Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 84cd94393e1396888b561e011158672c9c45d0f0..4d2b1418860027693aa40ffe050f3ca8756a09a0 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -799,10 +799,13 @@ void BytecodeGenerator::VisitGeneratorPrologue() { |
->LoadAccumulatorWithRegister(generator_object) |
.JumpIfUndefined(®ular_call); |
- // This is a resume call. Restore registers and perform state dispatch. |
- // (The current context has already been restored by the trampoline.) |
+ // This is a resume call. Restore the current context and the registers, then |
+ // perform state dispatch. |
+ Register dummy = register_allocator()->NewRegister(); |
builder() |
- ->ResumeGenerator(generator_object) |
+ ->CallRuntime(Runtime::kInlineGeneratorGetContext, generator_object) |
+ .PushContext(dummy) |
+ .ResumeGenerator(generator_object) |
.StoreAccumulatorInRegister(generator_state_); |
BuildIndexedJump(generator_state_, 0, generator_resume_points_.size(), |
generator_resume_points_); |