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

Unified Diff: src/interpreter/bytecode-register-allocator.h

Issue 2557173004: [Interpreter] Allocate registers used as call arguments on-demand. (Closed)
Patch Set: Fix release build unused variable Created 4 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-register.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-register-allocator.h
diff --git a/src/interpreter/bytecode-register-allocator.h b/src/interpreter/bytecode-register-allocator.h
index e9de4661d30fad4299e845f372907efa6a260473..72e0133f43869edcac6dc19f7b314e31f95d537c 100644
--- a/src/interpreter/bytecode-register-allocator.h
+++ b/src/interpreter/bytecode-register-allocator.h
@@ -52,6 +52,27 @@ class BytecodeRegisterAllocator final {
return reg_list;
}
+ // Returns a growable register list.
+ RegisterList NewGrowableRegisterList() {
+ RegisterList reg_list(next_register_index_, 0);
+ return reg_list;
+ }
+
+ // Appends a new register to |reg_list| increasing it's count by one and
+ // returning the register added.
+ //
+ // Note: no other new registers must be currently allocated since the register
+ // list was originally allocated.
+ Register GrowRegisterList(RegisterList* reg_list) {
+ Register reg(NewRegister());
+ reg_list->IncrementRegisterCount();
+ // If the following CHECK fails then a register was allocated (and not
+ // freed) between the creation of the RegisterList and this call to add a
+ // Register.
+ CHECK_EQ(reg.index(), reg_list->last_register().index());
+ return reg;
+ }
+
// Release all registers above |register_index|.
void ReleaseRegisters(int register_index) {
if (observer_) {
« no previous file with comments | « src/interpreter/bytecode-register.h ('k') | test/cctest/interpreter/bytecode_expectations/ForOf.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698