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 "src/compiler/representation-change.h" | 5 #include "src/compiler/representation-change.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 case IrOpcode::kSpeculativeNumberDivide: | 810 case IrOpcode::kSpeculativeNumberDivide: |
811 return simplified()->CheckedInt32Div(); | 811 return simplified()->CheckedInt32Div(); |
812 case IrOpcode::kSpeculativeNumberModulus: | 812 case IrOpcode::kSpeculativeNumberModulus: |
813 return simplified()->CheckedInt32Mod(); | 813 return simplified()->CheckedInt32Mod(); |
814 default: | 814 default: |
815 UNREACHABLE(); | 815 UNREACHABLE(); |
816 return nullptr; | 816 return nullptr; |
817 } | 817 } |
818 } | 818 } |
819 | 819 |
| 820 const Operator* RepresentationChanger::TaggedSignedOperatorFor( |
| 821 IrOpcode::Value opcode) { |
| 822 switch (opcode) { |
| 823 case IrOpcode::kSpeculativeNumberLessThan: |
| 824 return machine()->Is32() ? machine()->Int32LessThan() |
| 825 : machine()->Int64LessThan(); |
| 826 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
| 827 return machine()->Is32() ? machine()->Int32LessThanOrEqual() |
| 828 : machine()->Int64LessThanOrEqual(); |
| 829 case IrOpcode::kSpeculativeNumberEqual: |
| 830 return machine()->Is32() ? machine()->Word32Equal() |
| 831 : machine()->Word64Equal(); |
| 832 default: |
| 833 UNREACHABLE(); |
| 834 return nullptr; |
| 835 } |
| 836 } |
| 837 |
820 const Operator* RepresentationChanger::Uint32OperatorFor( | 838 const Operator* RepresentationChanger::Uint32OperatorFor( |
821 IrOpcode::Value opcode) { | 839 IrOpcode::Value opcode) { |
822 switch (opcode) { | 840 switch (opcode) { |
823 case IrOpcode::kNumberAdd: | 841 case IrOpcode::kNumberAdd: |
824 return machine()->Int32Add(); | 842 return machine()->Int32Add(); |
825 case IrOpcode::kNumberSubtract: | 843 case IrOpcode::kNumberSubtract: |
826 return machine()->Int32Sub(); | 844 return machine()->Int32Sub(); |
827 case IrOpcode::kSpeculativeNumberMultiply: | 845 case IrOpcode::kSpeculativeNumberMultiply: |
828 case IrOpcode::kNumberMultiply: | 846 case IrOpcode::kNumberMultiply: |
829 return machine()->Int32Mul(); | 847 return machine()->Int32Mul(); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 node); | 1030 node); |
1013 } | 1031 } |
1014 | 1032 |
1015 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { | 1033 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { |
1016 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); | 1034 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); |
1017 } | 1035 } |
1018 | 1036 |
1019 } // namespace compiler | 1037 } // namespace compiler |
1020 } // namespace internal | 1038 } // namespace internal |
1021 } // namespace v8 | 1039 } // namespace v8 |
OLD | NEW |