| 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 "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 #include "test/cctest/compiler/function-tester.h" | 8 #include "test/cctest/compiler/function-tester.h" |
| 9 | 9 |
| 10 using namespace v8::internal; | 10 using namespace v8::internal; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 " function bar(s,t) { return %_IsSmi(x); };" | 408 " function bar(s,t) { return %_IsSmi(x); };" |
| 409 " return bar;" | 409 " return bar;" |
| 410 "})();", | 410 "})();", |
| 411 kInlineFlags); | 411 kInlineFlags); |
| 412 | 412 |
| 413 InstallAssertInlineCountHelper(CcTest::isolate()); | 413 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 414 T.CheckCall(T.true_value(), T.Val(12), T.Val(4)); | 414 T.CheckCall(T.true_value(), T.Val(12), T.Val(4)); |
| 415 } | 415 } |
| 416 | 416 |
| 417 | 417 |
| 418 TEST(InlineIntrinsicIsNonNegativeSmi) { | |
| 419 FunctionTester T( | |
| 420 "(function () {" | |
| 421 " var x = 42;" | |
| 422 " function bar(s,t) { return %_IsNonNegativeSmi(x); };" | |
| 423 " return bar;" | |
| 424 "})();", | |
| 425 kInlineFlags); | |
| 426 | |
| 427 InstallAssertInlineCountHelper(CcTest::isolate()); | |
| 428 T.CheckCall(T.true_value(), T.Val(12), T.Val(4)); | |
| 429 } | |
| 430 | |
| 431 | |
| 432 TEST(InlineIntrinsicIsArray) { | 418 TEST(InlineIntrinsicIsArray) { |
| 433 FunctionTester T( | 419 FunctionTester T( |
| 434 "(function () {" | 420 "(function () {" |
| 435 " var x = [1,2,3];" | 421 " var x = [1,2,3];" |
| 436 " function bar(s,t) { return %_IsArray(x); };" | 422 " function bar(s,t) { return %_IsArray(x); };" |
| 437 " return bar;" | 423 " return bar;" |
| 438 "})();", | 424 "})();", |
| 439 kInlineFlags); | 425 kInlineFlags); |
| 440 | 426 |
| 441 InstallAssertInlineCountHelper(CcTest::isolate()); | 427 InstallAssertInlineCountHelper(CcTest::isolate()); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 " if (x == 1) return bar(42);" | 552 " if (x == 1) return bar(42);" |
| 567 " return x;" | 553 " return x;" |
| 568 " }" | 554 " }" |
| 569 " return foo;" | 555 " return foo;" |
| 570 "})();", | 556 "})();", |
| 571 kInlineFlags); | 557 kInlineFlags); |
| 572 | 558 |
| 573 InstallAssertInlineCountHelper(CcTest::isolate()); | 559 InstallAssertInlineCountHelper(CcTest::isolate()); |
| 574 T.CheckCall(T.Val(42), T.Val(1)); | 560 T.CheckCall(T.Val(42), T.Val(1)); |
| 575 } | 561 } |
| OLD | NEW |