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

Unified Diff: test/unittests/interpreter/bytecode-register-allocator-unittest.cc

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 | « test/mjsunit/ignition/regress-672027.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-register-allocator-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-register-allocator-unittest.cc b/test/unittests/interpreter/bytecode-register-allocator-unittest.cc
index f06e454cc943b233fffdfd95e31c61a9ea7f1320..81c6da5f8fe9da9e12ce029599f512b3b8c08631 100644
--- a/test/unittests/interpreter/bytecode-register-allocator-unittest.cc
+++ b/test/unittests/interpreter/bytecode-register-allocator-unittest.cc
@@ -91,6 +91,23 @@ TEST_F(BytecodeRegisterAllocatorTest, RegisterListAllocations) {
CHECK_EQ(allocator()->next_register_index(), 3);
}
+TEST_F(BytecodeRegisterAllocatorTest, GrowableRegisterListAllocations) {
+ CHECK_EQ(allocator()->maximum_register_count(), 0);
+ Register reg = allocator()->NewRegister();
+ CHECK_EQ(reg.index(), 0);
+ RegisterList reg_list = allocator()->NewGrowableRegisterList();
+ CHECK_EQ(reg_list.register_count(), 0);
+ allocator()->GrowRegisterList(&reg_list);
+ allocator()->GrowRegisterList(&reg_list);
+ allocator()->GrowRegisterList(&reg_list);
+ CHECK_EQ(reg_list.register_count(), 3);
+ CHECK_EQ(reg_list[0].index(), 1);
+ CHECK_EQ(reg_list[1].index(), 2);
+ CHECK_EQ(reg_list[2].index(), 3);
+ CHECK_EQ(allocator()->maximum_register_count(), 4);
+ CHECK_EQ(allocator()->next_register_index(), 4);
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/mjsunit/ignition/regress-672027.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698