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

Unified Diff: test/cctest/interpreter/test-interpreter.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 | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 9e8ee1e2d8bb0118beada53d1d2635cb9736f194..2962cc9fa74289c5d17db159dab6814976b24940 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -3093,6 +3093,40 @@ TEST(InterpreterToName) {
}
}
+
+TEST(TemporaryRegisterAllocation) {
+ HandleAndZoneScope handles;
+ i::Isolate* isolate = handles.main_isolate();
+ i::Factory* factory = isolate->factory();
+
+ std::pair<const char*, Handle<Object>> reg_tests[] = {
+ {"function add(a, b, c) {"
+ " return a + b + c;"
+ "}"
+ "function f() {"
+ " var a = 10, b = 10;"
+ " return add(a, b++, b);"
+ "}",
+ factory->NewNumberFromInt(31)},
+ {"function add(a, b, c, d) {"
+ " return a + b + c + d;"
+ "}"
+ "function f() {"
+ " var x = 10, y = 20, z = 30;"
+ " return x + add(x, (y= x++), x, z);"
+ "}",
+ factory->NewNumberFromInt(71)},
+ };
+
+ for (size_t i = 0; i < arraysize(reg_tests); i++) {
+ InterpreterTester tester(handles.main_isolate(), reg_tests[i].first);
+ auto callable = tester.GetCallable<>();
+
+ Handle<i::Object> return_value = callable().ToHandleChecked();
+ CHECK(return_value->SameValue(*reg_tests[i].second));
+ }
+}
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698