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

Unified Diff: test/cctest/interpreter/test-interpreter.cc

Issue 1568323002: [Interpreter] Add support for LOOKUP_SLOT_CALL to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_eval_graph
Patch Set: Created 4 years, 11 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/interpreter/test-bytecode-generator.cc ('k') | no next file » | 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 3db8025ccb68d7135c447b8dc67be931cf1378aa..96dbbcb7a0c0c4801617f9091b88cdabdd33754b 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -3267,6 +3267,33 @@ TEST(InterpreterLookupSlot) {
}
+TEST(InterpreterCallLookupSlot) {
+ HandleAndZoneScope handles;
+ i::Isolate* isolate = handles.main_isolate();
+
+ std::pair<const char*, Handle<Object>> call_lookup[] = {
+ {"g = function(){ return 2 }; eval(''); return g();",
+ handle(Smi::FromInt(2), isolate)},
+ {"g = function(){ return 2 }; eval('g = function() {return 3}');\n"
+ "return g();",
+ handle(Smi::FromInt(3), isolate)},
+ {"g = { x: function(){ return this.y }, y: 20 };\n"
+ "eval('g = { x: g.x, y: 30 }');\n"
+ "return g.x();",
+ handle(Smi::FromInt(30), isolate)},
+ };
+
+ for (size_t i = 0; i < arraysize(call_lookup); i++) {
+ std::string source(InterpreterTester::SourceForBody(call_lookup[i].first));
+ InterpreterTester tester(handles.main_isolate(), source.c_str());
+ auto callable = tester.GetCallable<>();
+
+ Handle<i::Object> return_value = callable().ToHandleChecked();
+ CHECK(return_value->SameValue(*call_lookup[i].second));
+ }
+}
+
+
TEST(InterpreterLookupSlotWide) {
HandleAndZoneScope handles;
i::Isolate* isolate = handles.main_isolate();
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698