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

Unified Diff: test/cctest/compiler/test-run-bytecode-graph-builder.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 | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-bytecode-graph-builder.cc
diff --git a/test/cctest/compiler/test-run-bytecode-graph-builder.cc b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
index 72e2efb29a62167897602412e4cb1a1dcce65240..88555b7d57b024caca5f2e0b614cf00d954ab4f8 100644
--- a/test/cctest/compiler/test-run-bytecode-graph-builder.cc
+++ b/test/cctest/compiler/test-run-bytecode-graph-builder.cc
@@ -1103,6 +1103,36 @@ TEST(BytecodeGraphBuilderLookupSlotWide) {
}
+TEST(BytecodeGraphBuilderCallLookupSlot) {
+ HandleAndZoneScope scope;
+ Isolate* isolate = scope.main_isolate();
+ Zone* zone = scope.main_zone();
+
+ ExpectedSnippet<0> snippets[] = {
+ {"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)}},
+ };
+
+ size_t num_snippets = sizeof(snippets) / sizeof(snippets[0]);
+ for (size_t i = 0; i < num_snippets; i++) {
+ ScopedVector<char> script(1024);
+ SNPrintF(script, "function %s() { %s }\n%s();", kFunctionName,
+ snippets[i].code_snippet, kFunctionName);
+ BytecodeGraphTester tester(isolate, zone, script.start());
+ auto callable = tester.GetCallable<>();
+ Handle<Object> return_value = callable().ToHandleChecked();
+ CHECK(return_value->SameValue(*snippets[i].return_value()));
+ }
+}
+
+
TEST(BytecodeGraphBuilderEval) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698