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

Unified Diff: src/interpreter/bytecode-register-optimizer.cc

Issue 2071443002: [interpreter] Teach register optimizer about SuspendGenerator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | test/mjsunit/es6/generators-objects.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | test/mjsunit/es6/generators-objects.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698