Index: src/interpreter/bytecode-register-optimizer.cc |
diff --git a/src/interpreter/bytecode-register-optimizer.cc b/src/interpreter/bytecode-register-optimizer.cc |
index ff5f5d0441d86e2911c57888315d902d38f1150e..a30cb26f434ff361b98ea5512810a2facb62f920 100644 |
--- a/src/interpreter/bytecode-register-optimizer.cc |
+++ b/src/interpreter/bytecode-register-optimizer.cc |
@@ -246,11 +246,12 @@ void BytecodeRegisterOptimizer::Write(BytecodeNode* node) { |
} |
if (Bytecodes::IsJump(node->bytecode()) || |
- node->bytecode() == Bytecode::kDebugger) { |
- // The debugger can manipulate locals and parameters, flush |
- // everything before handing over to it. Similarly, all state must |
- // be flushed before emitting a jump due to how bytecode offsets |
- // for jumps are evaluated. |
+ node->bytecode() == Bytecode::kDebugger || |
+ node->bytecode() == Bytecode::kSuspendGenerator) { |
+ // All state must be flushed before emitting |
+ // - a jump (due to how bytecode offsets for jumps are evaluated), |
+ // - a call to the debugger (as it can manipulate locals and parameters), |
+ // - a generator suspend (as this involves saving all registers). |
FlushState(); |
} |