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

Side by Side Diff: test/cctest/compiler/test-run-inlining.cc

Issue 1211243007: [turbofan] Disable recursive inlining for now. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "test/cctest/compiler/function-tester.h" 7 #include "test/cctest/compiler/function-tester.h"
8 8
9 #if V8_TURBOFAN_TARGET 9 #if V8_TURBOFAN_TARGET
10 10
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 "(function () {" 534 "(function () {"
535 " 'use strong';" 535 " 'use strong';"
536 " function foo(x, y) { return x; }" 536 " function foo(x, y) { return x; }"
537 " function bar(x, y) { return foo(x); }" 537 " function bar(x, y) { return foo(x); }"
538 " return bar;" 538 " return bar;"
539 "})();", 539 "})();",
540 kInlineFlags); 540 kInlineFlags);
541 T.CheckThrows(T.undefined(), T.undefined()); 541 T.CheckThrows(T.undefined(), T.undefined());
542 } 542 }
543 543
544
545 TEST(InlineSelfRecursive) {
546 FunctionTester T(
547 "(function () {"
548 " function foo(x) { "
549 " AssertInlineCount(1);"
550 " if (x == 1) return foo(12);"
551 " return x;"
552 " }"
553 " return foo;"
554 "})();",
555 kInlineFlags);
556
557 InstallAssertInlineCountHelper(CcTest::isolate());
558 T.CheckCall(T.Val(12), T.Val(1));
559 }
560
561
562 TEST(InlineMutuallyRecursive) {
563 FunctionTester T(
564 "(function () {"
565 " function bar(x) { AssertInlineCount(2); return foo(x); }"
566 " function foo(x) { "
567 " if (x == 1) return bar(42);"
568 " return x;"
569 " }"
570 " return foo;"
571 "})();",
572 kInlineFlags);
573
574 InstallAssertInlineCountHelper(CcTest::isolate());
575 T.CheckCall(T.Val(42), T.Val(1));
576 }
577
544 #endif // V8_TURBOFAN_TARGET 578 #endif // V8_TURBOFAN_TARGET
OLDNEW
« no previous file with comments | « src/compiler/js-inlining.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698