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

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

Issue 1531273002: [Interpreter] Allocates new temporary register outside the reservation for consecutive registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing mjsunit.status again. one test is failing on bots. Created 5 years 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 | « src/interpreter/bytecode-array-builder.cc ('k') | 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 22972537abcbccb0e72a702ba07e9e4eb12a011a..2f0dc2c6e419a83a3188f7930d7bf0ebdf11a32f 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -205,7 +205,22 @@ class BytecodeGenerator::ExpressionResultScope {
BytecodeArrayBuilder* builder() const { return generator()->builder(); }
ExpressionResultScope* outer() const { return outer_; }
- Register NewRegister() { return allocator_.NewRegister(); }
+ Register NewRegister() {
+ ExpressionResultScope* current_scope = generator()->execution_result();
+ if ((current_scope == this) ||
+ (current_scope->outer() == this &&
+ !current_scope->allocator_.hasConsecutiveAllocations())) {
+ // Regular case - Allocating registers in current or outer context.
+ // VisitForRegisterValue allocates register in outer context.
+ return allocator_.NewRegister();
+ } else {
+ // We need this when allocating registers due to an Assignment hazard.
+ // It might be expensive to walk the full context chain and compute the
+ // list of consecutive reservations in the innerscopes. So allocates a
+ // new unallocated temporary register.
+ return allocator_.AllocateNewRegister();
+ }
+ }
void PrepareForConsecutiveAllocations(size_t count) {
allocator_.PrepareForConsecutiveAllocations(count);
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698