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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1588903002: [Interpreter] Fixes VisitObjectLiteral to reserve consecutive registers in innerscope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 268b9fd79a1282e64e661dfc28222b309fcc646d..9a8c0540de3c633d72fcdb6f9d75dee9b00eb717 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -942,7 +942,13 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (property->IsCompileTimeValue()) continue;
if (literal_in_accumulator) {
- literal = temporary_register_scope.NewRegister();
+ // We reserve for 5 though we use only one in this scope. This register
+ // is used as a parameter along with other registers allocated in the
+ // inner scope. Since they have to be contiguous, reserving 5 registers
+ // lets inner scope allocate consecutive registers starting with this
+ // register.
+ temporary_register_scope.PrepareForConsecutiveAllocations(5);
mythria 2016/01/14 10:08:55 This increases the number of registers used. So al
+ literal = temporary_register_scope.NextConsecutiveRegister();
builder()->StoreAccumulatorInRegister(literal);
literal_in_accumulator = false;
}
« no previous file with comments | « no previous file | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698