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/compiler/verifier.h" | 5 #include "src/compiler/verifier.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 CheckNotTyped(node); | 657 CheckNotTyped(node); |
658 break; | 658 break; |
659 | 659 |
660 // Simplified operators | 660 // Simplified operators |
661 // ------------------------------- | 661 // ------------------------------- |
662 case IrOpcode::kBooleanNot: | 662 case IrOpcode::kBooleanNot: |
663 // Boolean -> Boolean | 663 // Boolean -> Boolean |
664 CheckValueInputIs(node, 0, Type::Boolean()); | 664 CheckValueInputIs(node, 0, Type::Boolean()); |
665 CheckUpperIs(node, Type::Boolean()); | 665 CheckUpperIs(node, Type::Boolean()); |
666 break; | 666 break; |
667 case IrOpcode::kBooleanToNumber: | |
668 // Boolean -> Number | |
669 CheckValueInputIs(node, 0, Type::Boolean()); | |
670 CheckUpperIs(node, Type::Number()); | |
671 break; | |
672 case IrOpcode::kNumberEqual: | 667 case IrOpcode::kNumberEqual: |
673 // (Number, Number) -> Boolean | 668 // (Number, Number) -> Boolean |
674 CheckValueInputIs(node, 0, Type::Number()); | 669 CheckValueInputIs(node, 0, Type::Number()); |
675 CheckValueInputIs(node, 1, Type::Number()); | 670 CheckValueInputIs(node, 1, Type::Number()); |
676 CheckUpperIs(node, Type::Boolean()); | 671 CheckUpperIs(node, Type::Boolean()); |
677 break; | 672 break; |
678 case IrOpcode::kNumberLessThan: | 673 case IrOpcode::kNumberLessThan: |
679 case IrOpcode::kNumberLessThanOrEqual: | 674 case IrOpcode::kNumberLessThanOrEqual: |
680 // (Number, Number) -> Boolean | 675 // (Number, Number) -> Boolean |
681 CheckValueInputIs(node, 0, Type::Number()); | 676 CheckValueInputIs(node, 0, Type::Number()); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 // Number -> Signed32 | 778 // Number -> Signed32 |
784 CheckValueInputIs(node, 0, Type::Number()); | 779 CheckValueInputIs(node, 0, Type::Number()); |
785 CheckUpperIs(node, Type::Signed32()); | 780 CheckUpperIs(node, Type::Signed32()); |
786 break; | 781 break; |
787 case IrOpcode::kNumberToUint32: | 782 case IrOpcode::kNumberToUint32: |
788 // Number -> Unsigned32 | 783 // Number -> Unsigned32 |
789 CheckValueInputIs(node, 0, Type::Number()); | 784 CheckValueInputIs(node, 0, Type::Number()); |
790 CheckUpperIs(node, Type::Unsigned32()); | 785 CheckUpperIs(node, Type::Unsigned32()); |
791 break; | 786 break; |
792 case IrOpcode::kPlainPrimitiveToNumber: | 787 case IrOpcode::kPlainPrimitiveToNumber: |
793 // Type is Number. | 788 // PlainPrimitive -> Number |
| 789 CheckValueInputIs(node, 0, Type::PlainPrimitive()); |
794 CheckUpperIs(node, Type::Number()); | 790 CheckUpperIs(node, Type::Number()); |
795 break; | 791 break; |
796 case IrOpcode::kPlainPrimitiveToWord32: | 792 case IrOpcode::kPlainPrimitiveToWord32: |
797 CheckUpperIs(node, Type::Number()); | 793 // PlainPrimitive -> Integral32 |
| 794 CheckValueInputIs(node, 0, Type::PlainPrimitive()); |
| 795 CheckUpperIs(node, Type::Integral32()); |
798 break; | 796 break; |
799 case IrOpcode::kPlainPrimitiveToFloat64: | 797 case IrOpcode::kPlainPrimitiveToFloat64: |
| 798 // PlainPrimitive -> Number |
| 799 CheckValueInputIs(node, 0, Type::PlainPrimitive()); |
800 CheckUpperIs(node, Type::Number()); | 800 CheckUpperIs(node, Type::Number()); |
801 break; | 801 break; |
802 case IrOpcode::kStringEqual: | 802 case IrOpcode::kStringEqual: |
803 case IrOpcode::kStringLessThan: | 803 case IrOpcode::kStringLessThan: |
804 case IrOpcode::kStringLessThanOrEqual: | 804 case IrOpcode::kStringLessThanOrEqual: |
805 // (String, String) -> Boolean | 805 // (String, String) -> Boolean |
806 CheckValueInputIs(node, 0, Type::String()); | 806 CheckValueInputIs(node, 0, Type::String()); |
807 CheckValueInputIs(node, 1, Type::String()); | 807 CheckValueInputIs(node, 1, Type::String()); |
808 CheckUpperIs(node, Type::Boolean()); | 808 CheckUpperIs(node, Type::Boolean()); |
809 break; | 809 break; |
810 case IrOpcode::kStringFromCharCode: | 810 case IrOpcode::kStringFromCharCode: |
811 // Number -> String | 811 // Number -> String |
812 CheckValueInputIs(node, 0, Type::Number()); | 812 CheckValueInputIs(node, 0, Type::Number()); |
813 CheckUpperIs(node, Type::String()); | 813 CheckUpperIs(node, Type::String()); |
814 break; | 814 break; |
815 case IrOpcode::kStringToNumber: | |
816 // String -> Number | |
817 CheckValueInputIs(node, 0, Type::String()); | |
818 CheckUpperIs(node, Type::Number()); | |
819 break; | |
820 case IrOpcode::kReferenceEqual: { | 815 case IrOpcode::kReferenceEqual: { |
821 // (Unique, Any) -> Boolean and | 816 // (Unique, Any) -> Boolean and |
822 // (Any, Unique) -> Boolean | 817 // (Any, Unique) -> Boolean |
823 CheckUpperIs(node, Type::Boolean()); | 818 CheckUpperIs(node, Type::Boolean()); |
824 break; | 819 break; |
825 } | 820 } |
826 case IrOpcode::kObjectIsCallable: | 821 case IrOpcode::kObjectIsCallable: |
827 case IrOpcode::kObjectIsNumber: | 822 case IrOpcode::kObjectIsNumber: |
828 case IrOpcode::kObjectIsReceiver: | 823 case IrOpcode::kObjectIsReceiver: |
829 case IrOpcode::kObjectIsSmi: | 824 case IrOpcode::kObjectIsSmi: |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 replacement->op()->EffectOutputCount() > 0); | 1506 replacement->op()->EffectOutputCount() > 0); |
1512 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1507 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
1513 replacement->opcode() == IrOpcode::kFrameState); | 1508 replacement->opcode() == IrOpcode::kFrameState); |
1514 } | 1509 } |
1515 | 1510 |
1516 #endif // DEBUG | 1511 #endif // DEBUG |
1517 | 1512 |
1518 } // namespace compiler | 1513 } // namespace compiler |
1519 } // namespace internal | 1514 } // namespace internal |
1520 } // namespace v8 | 1515 } // namespace v8 |
OLD | NEW |