Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index 71e9eefd17fa76831a0669c5e98c5ff29bffa650..ba5b97d254e84a06e2757fa5d2840467737c7818 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -644,8 +644,7 @@ void BytecodeGenerator::VisitGeneratorPrologue() { |
RegisterAllocationScope register_scope(this); |
Register state = register_allocator()->NewRegister(); |
builder() |
- ->CallRuntime(Runtime::kResumeIgnitionGenerator, Register::new_target(), |
- 1) |
+ ->ResumeGenerator(Register::new_target()) |
.StoreAccumulatorInRegister(state); |
// TODO(neis): Optimize this by using a proper jump table. |
@@ -2218,16 +2217,12 @@ void BytecodeGenerator::VisitYield(Yield* expr) { |
builder()->SetExpressionPosition(expr); |
Register value = VisitForRegisterValue(expr->expression()); |
- register_allocator()->PrepareForConsecutiveAllocations(2); |
- Register generator = register_allocator()->NextConsecutiveRegister(); |
- Register state = register_allocator()->NextConsecutiveRegister(); |
+ Register generator = VisitForRegisterValue(expr->generator_object()); |
// Save context, registers, and state. Then return. |
- VisitForRegisterValue(expr->generator_object(), generator); |
builder() |
->LoadLiteral(Smi::FromInt(id)) |
- .StoreAccumulatorInRegister(state) |
- .CallRuntime(Runtime::kSuspendIgnitionGenerator, generator, 2) |
+ .SuspendGenerator(generator) |
.LoadAccumulatorWithRegister(value) |
.Return(); // Hard return (ignore any finally blocks). |