| OLD | NEW |
| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 " %SetInlineBuiltinFlag(foo);" | 519 " %SetInlineBuiltinFlag(foo);" |
| 520 " %SetInlineBuiltinFlag(baz);" | 520 " %SetInlineBuiltinFlag(baz);" |
| 521 " return bar;" | 521 " return bar;" |
| 522 "})();", | 522 "})();", |
| 523 kBuiltinInlineFlags); | 523 kBuiltinInlineFlags); |
| 524 | 524 |
| 525 InstallAssertInlineCountHelper(CcTest::isolate()); | 525 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 526 T.CheckCall(T.true_value()); | 526 T.CheckCall(T.true_value()); |
| 527 } | 527 } |
| 528 | 528 |
| 529 |
| 530 TEST(StrongModeArity) { |
| 531 FLAG_turbo_deoptimization = true; |
| 532 FLAG_strong_mode = true; |
| 533 FunctionTester T( |
| 534 "(function () {" |
| 535 " function foo(x, y) { 'use strong'; return x; }" |
| 536 " function bar(x, y) { return foo(x); }" |
| 537 " return bar;" |
| 538 "})();", |
| 539 kInlineFlags); |
| 540 T.CheckThrows(T.undefined(), T.undefined()); |
| 541 } |
| 542 |
| 543 |
| 544 TEST(StrongModeArityOuter) { |
| 545 FLAG_turbo_deoptimization = true; |
| 546 FLAG_strong_mode = true; |
| 547 FunctionTester T( |
| 548 "(function () {" |
| 549 " 'use strong';" |
| 550 " function foo(x, y) { return x; }" |
| 551 " function bar(x, y) { return foo(x); }" |
| 552 " return bar;" |
| 553 "})();", |
| 554 kInlineFlags); |
| 555 T.CheckThrows(T.undefined(), T.undefined()); |
| 556 } |
| 529 #endif // V8_TURBOFAN_TARGET | 557 #endif // V8_TURBOFAN_TARGET |
| OLD | NEW |