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

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

Issue 2926063002: [interpreter] Make sure allocated registers are always materialized in the register optimizer. (Closed)
Patch Set: Address review comments Created 3 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
Index: src/interpreter/bytecode-register-optimizer.cc
diff --git a/src/interpreter/bytecode-register-optimizer.cc b/src/interpreter/bytecode-register-optimizer.cc
index 9d3e21b392a3429c6566216ac6c83f527d598485..7879207d10ccc74176145a61d1c1139138b4b433 100644
--- a/src/interpreter/bytecode-register-optimizer.cc
+++ b/src/interpreter/bytecode-register-optimizer.cc
@@ -416,8 +416,15 @@ void BytecodeRegisterOptimizer::GrowRegisterMap(Register reg) {
}
}
+void BytecodeRegisterOptimizer::AllocateRegister(RegisterInfo* info) {
+ info->set_allocated(true);
+ if (!info->materialized()) {
+ info->MoveToNewEquivalenceSet(NextEquivalenceId(), true);
+ }
+}
+
void BytecodeRegisterOptimizer::RegisterAllocateEvent(Register reg) {
- GetOrCreateRegisterInfo(reg)->set_allocated(true);
+ AllocateRegister(GetOrCreateRegisterInfo(reg));
}
void BytecodeRegisterOptimizer::RegisterListAllocateEvent(
@@ -426,7 +433,7 @@ void BytecodeRegisterOptimizer::RegisterListAllocateEvent(
int first_index = reg_list.first_register().index();
GrowRegisterMap(Register(first_index + reg_list.register_count() - 1));
for (int i = 0; i < reg_list.register_count(); i++) {
- GetRegisterInfo(Register(first_index + i))->set_allocated(true);
+ AllocateRegister(GetRegisterInfo(Register(first_index + i)));
}
}
}
« no previous file with comments | « src/interpreter/bytecode-register-optimizer.h ('k') | test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698