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

Unified Diff: test/cctest/compiler/test-run-inlining.cc

Issue 1340313003: [turbofan] Make arguments object materialization inlinable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-arguments-2
Patch Set: Rebased Created 5 years, 3 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/runtime/runtime-scopes.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 () {"
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698