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

Unified Diff: test/mjsunit/compiler/inline-literals.js

Issue 9419005: Allow inlining of functions containing function literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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/ast.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/inline-literals.js
diff --git a/test/mjsunit/compiler/inline-literals.js b/test/mjsunit/compiler/inline-literals.js
index f78abe82d16aa795be48375adc08fc86db02f3ad..33d15f5b0444e8f64c2f12c89d84c845fafe44ae 100644
--- a/test/mjsunit/compiler/inline-literals.js
+++ b/test/mjsunit/compiler/inline-literals.js
@@ -45,6 +45,26 @@ function TestObjectLiteral(a, b, c) {
TestObjectLiteral(1, 2, 3);
TestObjectLiteral(1, 2, 3);
-%OptimizeFunctionOnNextCall(TestObjectLiteral);
+%OptimizeFunctionOnNextCall(o1);
TestObjectLiteral(1, 2, 3);
TestObjectLiteral('a', 'b', 'c');
+
+function f2() {
+ return function(b, c) { return b + c; };
+}
+
+function f1(a, b, c) {
+ return a + f2()(b, c);
+}
+
+function TestFunctionLiteral(a, b, c) {
+ var expected = a + b + c;
+ var result = f1(a, b, c);
+ assertEquals(expected, result, "TestFunctionLiteral");
+}
+
+TestFunctionLiteral(1, 2, 3);
+TestFunctionLiteral(1, 2, 3);
+%OptimizeFunctionOnNextCall(f1);
+TestFunctionLiteral(1, 2, 3);
+TestFunctionLiteral('a', 'b', 'c');
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698