OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <functional> | 5 #include <functional> |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 TEST_MONOTONICITY(ShiftRight) | 475 TEST_MONOTONICITY(ShiftRight) |
476 TEST_MONOTONICITY(ShiftRightLogical) | 476 TEST_MONOTONICITY(ShiftRightLogical) |
477 TEST_MONOTONICITY(Subtract) | 477 TEST_MONOTONICITY(Subtract) |
478 TEST_MONOTONICITY(Multiply) | 478 TEST_MONOTONICITY(Multiply) |
479 TEST_MONOTONICITY(Divide) | 479 TEST_MONOTONICITY(Divide) |
480 TEST_MONOTONICITY(Modulus) | 480 TEST_MONOTONICITY(Modulus) |
481 TEST_MONOTONICITY(InstanceOf) | 481 TEST_MONOTONICITY(InstanceOf) |
482 TEST_MONOTONICITY(OrdinaryHasInstance) | 482 TEST_MONOTONICITY(OrdinaryHasInstance) |
483 #undef TEST_MONOTONICITY | 483 #undef TEST_MONOTONICITY |
484 | 484 |
| 485 // SIMPLIFIED UNOPs without hint |
| 486 #define TEST_MONOTONICITY(name) \ |
| 487 TEST_F(TyperTest, Monotonicity_##name) { \ |
| 488 TestUnaryMonotonicity(simplified_.name()); \ |
| 489 } |
| 490 TEST_MONOTONICITY(ObjectIsDetectableCallable) |
| 491 TEST_MONOTONICITY(ObjectIsNaN) |
| 492 TEST_MONOTONICITY(ObjectIsNonCallable) |
| 493 TEST_MONOTONICITY(ObjectIsNumber) |
| 494 TEST_MONOTONICITY(ObjectIsReceiver) |
| 495 TEST_MONOTONICITY(ObjectIsSmi) |
| 496 TEST_MONOTONICITY(ObjectIsString) |
| 497 TEST_MONOTONICITY(ObjectIsSymbol) |
| 498 TEST_MONOTONICITY(ObjectIsUndetectable) |
| 499 #undef TEST_MONOTONICITY |
| 500 |
485 // SIMPLIFIED BINOPs without hint, with Number input restriction | 501 // SIMPLIFIED BINOPs without hint, with Number input restriction |
486 #define TEST_MONOTONICITY(name) \ | 502 #define TEST_MONOTONICITY(name) \ |
487 TEST_F(TyperTest, Monotonicity_##name) { \ | 503 TEST_F(TyperTest, Monotonicity_##name) { \ |
488 TestBinaryMonotonicity(simplified_.name(), Type::Number(), \ | 504 TestBinaryMonotonicity(simplified_.name(), Type::Number(), \ |
489 Type::Number()); \ | 505 Type::Number()); \ |
490 } | 506 } |
491 SIMPLIFIED_NUMBER_BINOP_LIST(TEST_MONOTONICITY); | 507 SIMPLIFIED_NUMBER_BINOP_LIST(TEST_MONOTONICITY); |
492 #undef TEST_MONOTONICITY | 508 #undef TEST_MONOTONICITY |
493 | 509 |
494 // SIMPLIFIED BINOPs without hint, without input restriction | 510 // SIMPLIFIED BINOPs without hint, without input restriction |
495 #define TEST_MONOTONICITY(name) \ | 511 #define TEST_MONOTONICITY(name) \ |
496 TEST_F(TyperTest, Monotonicity_##name) { \ | 512 TEST_F(TyperTest, Monotonicity_##name) { \ |
497 TestBinaryMonotonicity(simplified_.name()); \ | 513 TestBinaryMonotonicity(simplified_.name()); \ |
498 } | 514 } |
499 TEST_MONOTONICITY(NumberLessThan) | 515 TEST_MONOTONICITY(NumberLessThan) |
500 TEST_MONOTONICITY(NumberLessThanOrEqual) | 516 TEST_MONOTONICITY(NumberLessThanOrEqual) |
501 TEST_MONOTONICITY(NumberEqual) | 517 TEST_MONOTONICITY(NumberEqual) |
| 518 TEST_MONOTONICITY(ReferenceEqual) |
| 519 TEST_MONOTONICITY(StringEqual) |
| 520 TEST_MONOTONICITY(StringLessThan) |
| 521 TEST_MONOTONICITY(StringLessThanOrEqual) |
502 #undef TEST_MONOTONICITY | 522 #undef TEST_MONOTONICITY |
503 | 523 |
504 // SIMPLIFIED BINOPs with NumberOperationHint, without input restriction | 524 // SIMPLIFIED BINOPs with NumberOperationHint, without input restriction |
505 #define TEST_MONOTONICITY(name) \ | 525 #define TEST_MONOTONICITY(name) \ |
506 TEST_F(TyperTest, Monotonicity_##name) { \ | 526 TEST_F(TyperTest, Monotonicity_##name) { \ |
507 TestBinaryMonotonicity(simplified_.name(NumberOperationHint::kNumber)); \ | 527 TestBinaryMonotonicity(simplified_.name(NumberOperationHint::kNumber)); \ |
508 } | 528 } |
509 TEST_MONOTONICITY(SpeculativeNumberEqual) | 529 TEST_MONOTONICITY(SpeculativeNumberEqual) |
510 TEST_MONOTONICITY(SpeculativeNumberLessThan) | 530 TEST_MONOTONICITY(SpeculativeNumberLessThan) |
511 TEST_MONOTONICITY(SpeculativeNumberLessThanOrEqual) | 531 TEST_MONOTONICITY(SpeculativeNumberLessThanOrEqual) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 for (int i = 0; i < kRepetitions; ++i) { \ | 577 for (int i = 0; i < kRepetitions; ++i) { \ |
558 TestBinaryMonotonicity(typer); \ | 578 TestBinaryMonotonicity(typer); \ |
559 } \ | 579 } \ |
560 } | 580 } |
561 SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(TEST_MONOTONICITY) | 581 SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(TEST_MONOTONICITY) |
562 #undef TEST_MONOTONICITY | 582 #undef TEST_MONOTONICITY |
563 | 583 |
564 } // namespace compiler | 584 } // namespace compiler |
565 } // namespace internal | 585 } // namespace internal |
566 } // namespace v8 | 586 } // namespace v8 |
OLD | NEW |