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

Unified Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 1303403004: [Interpreter] Add support for parameter variables. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_add_bytecodes
Patch Set: Address review comments Created 5 years, 4 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 | « test/cctest/test-heap.cc ('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-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-array-builder-unittest.cc b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
index 72af0c4f5389c935856f2e37b9dd60ea939247b5..9b4d3abbf28d4d2c149c935455cdc77c8a19962b 100644
--- a/test/unittests/interpreter/bytecode-array-builder-unittest.cc
+++ b/test/unittests/interpreter/bytecode-array-builder-unittest.cc
@@ -22,6 +22,7 @@ TEST_F(BytecodeArrayBuilderTest, AllBytecodesGenerated) {
BytecodeArrayBuilder builder(isolate());
builder.set_locals_count(1);
+ builder.set_parameter_count(0);
CHECK_EQ(builder.locals_count(), 1);
// Emit constant loads.
@@ -79,6 +80,7 @@ TEST_F(BytecodeArrayBuilderTest, FrameSizesLookGood) {
for (int locals = 0; locals < 5; locals++) {
for (int temps = 0; temps < 3; temps++) {
BytecodeArrayBuilder builder(isolate());
+ builder.set_parameter_count(0);
builder.set_locals_count(locals);
builder.Return();
@@ -97,6 +99,7 @@ TEST_F(BytecodeArrayBuilderTest, FrameSizesLookGood) {
TEST_F(BytecodeArrayBuilderTest, TemporariesRecycled) {
BytecodeArrayBuilder builder(isolate());
+ builder.set_parameter_count(0);
builder.set_locals_count(0);
builder.Return();
@@ -133,6 +136,17 @@ TEST_F(BytecodeArrayBuilderTest, RegisterValues) {
CHECK_EQ(actual_index, index);
}
+
+TEST_F(BytecodeArrayBuilderTest, Parameters) {
+ BytecodeArrayBuilder builder(isolate());
+ builder.set_parameter_count(10);
+ builder.set_locals_count(0);
+
+ Register param0(builder.Parameter(0));
+ Register param9(builder.Parameter(9));
+ CHECK_EQ(param9.index() - param0.index(), 9);
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698