Index: test/cctest/compiler/test-run-inlining.cc |
diff --git a/test/cctest/compiler/test-run-inlining.cc b/test/cctest/compiler/test-run-inlining.cc |
index 5119bb73ee832cd1f0730869b8bfacba5343d2a9..8aa9d030eeb10b989f3bb37a569f77f09715e042 100644 |
--- a/test/cctest/compiler/test-run-inlining.cc |
+++ b/test/cctest/compiler/test-run-inlining.cc |
@@ -161,7 +161,8 @@ TEST(InlineOmitArguments) { |
"(function () {" |
" var x = 42;" |
" function bar(s, t, u, v) { AssertInlineCount(2); return x + s; };" |
- " return (function (s,t) { return bar(s); });" |
+ " function foo(s, t) { return bar(s); };" |
+ " return foo;" |
"})();", |
kInlineFlags); |
@@ -170,6 +171,22 @@ TEST(InlineOmitArguments) { |
} |
+TEST(InlineOmitArgumentsObject) { |
+ FunctionTester T( |
+ "(function () {" |
+ " function bar(s, t, u, v) { AssertInlineCount(2); return arguments; };" |
+ " function foo(s, t) { var args = bar(s);" |
+ " return args.length == 1 &&" |
+ " args[0] == 11; };" |
+ " return foo;" |
+ "})();", |
+ kInlineFlags); |
+ |
+ InstallAssertInlineCountHelper(CcTest::isolate()); |
+ T.CheckCall(T.true_value(), T.Val(11), T.undefined()); |
+} |
+ |
+ |
TEST(InlineOmitArgumentsDeopt) { |
FunctionTester T( |
"(function () {" |
@@ -192,7 +209,7 @@ TEST(InlineSurplusArguments) { |
"(function () {" |
" var x = 42;" |
" function foo(s) { AssertInlineCount(2); return x + s; };" |
- " function bar(s,t) { return foo(s,t,13); };" |
+ " function bar(s, t) { return foo(s, t, 13); };" |
" return bar;" |
"})();", |
kInlineFlags); |
@@ -202,6 +219,24 @@ TEST(InlineSurplusArguments) { |
} |
+TEST(InlineSurplusArgumentsObject) { |
+ FunctionTester T( |
+ "(function () {" |
+ " function foo(s) { AssertInlineCount(2); return arguments; };" |
+ " function bar(s, t) { var args = foo(s, t, 13);" |
+ " return args.length == 3 &&" |
+ " args[0] == 11 &&" |
+ " args[1] == 12 &&" |
+ " args[2] == 13; };" |
+ " return bar;" |
+ "})();", |
+ kInlineFlags); |
+ |
+ InstallAssertInlineCountHelper(CcTest::isolate()); |
+ T.CheckCall(T.true_value(), T.Val(11), T.Val(12)); |
+} |
+ |
+ |
TEST(InlineSurplusArgumentsDeopt) { |
FunctionTester T( |
"(function () {" |