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 #ifndef V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ | 5 #ifndef V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ |
6 #define V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ | 6 #define V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ |
7 | 7 |
8 #include "src/crankshaft/hydrogen.h" | 8 #include "src/crankshaft/hydrogen.h" |
9 #include "src/crankshaft/lithium.h" | 9 #include "src/crankshaft/lithium.h" |
10 #include "src/crankshaft/lithium-allocator.h" | 10 #include "src/crankshaft/lithium-allocator.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 V(LoadFieldByIndex) \ | 92 V(LoadFieldByIndex) \ |
93 V(LoadFunctionPrototype) \ | 93 V(LoadFunctionPrototype) \ |
94 V(LoadGlobalGeneric) \ | 94 V(LoadGlobalGeneric) \ |
95 V(LoadKeyed) \ | 95 V(LoadKeyed) \ |
96 V(LoadKeyedGeneric) \ | 96 V(LoadKeyedGeneric) \ |
97 V(LoadNamedField) \ | 97 V(LoadNamedField) \ |
98 V(LoadNamedGeneric) \ | 98 V(LoadNamedGeneric) \ |
99 V(MathAbs) \ | 99 V(MathAbs) \ |
100 V(MathClz32) \ | 100 V(MathClz32) \ |
101 V(MathExp) \ | 101 V(MathExp) \ |
102 V(MathFloor) \ | 102 V(MathFloorD) \ |
| 103 V(MathFloorI) \ |
103 V(MathFround) \ | 104 V(MathFround) \ |
104 V(MathLog) \ | 105 V(MathLog) \ |
105 V(MathMinMax) \ | 106 V(MathMinMax) \ |
106 V(MathPowHalf) \ | 107 V(MathPowHalf) \ |
107 V(MathRound) \ | 108 V(MathRoundD) \ |
| 109 V(MathRoundI) \ |
108 V(MathSqrt) \ | 110 V(MathSqrt) \ |
109 V(MaybeGrowElements) \ | 111 V(MaybeGrowElements) \ |
110 V(ModByConstI) \ | 112 V(ModByConstI) \ |
111 V(ModByPowerOf2I) \ | 113 V(ModByPowerOf2I) \ |
112 V(ModI) \ | 114 V(ModI) \ |
113 V(MulI) \ | 115 V(MulI) \ |
114 V(MultiplyAddD) \ | 116 V(MultiplyAddD) \ |
115 V(MultiplySubD) \ | 117 V(MultiplySubD) \ |
116 V(NumberTagD) \ | 118 V(NumberTagD) \ |
117 V(NumberTagI) \ | 119 V(NumberTagI) \ |
(...skipping 26 matching lines...) Expand all Loading... |
144 V(TaggedToI) \ | 146 V(TaggedToI) \ |
145 V(ThisFunction) \ | 147 V(ThisFunction) \ |
146 V(TransitionElementsKind) \ | 148 V(TransitionElementsKind) \ |
147 V(TrapAllocationMemento) \ | 149 V(TrapAllocationMemento) \ |
148 V(Typeof) \ | 150 V(Typeof) \ |
149 V(TypeofIsAndBranch) \ | 151 V(TypeofIsAndBranch) \ |
150 V(Uint32ToDouble) \ | 152 V(Uint32ToDouble) \ |
151 V(UnknownOSRValue) \ | 153 V(UnknownOSRValue) \ |
152 V(WrapReceiver) | 154 V(WrapReceiver) |
153 | 155 |
154 | |
155 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 156 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
156 Opcode opcode() const final { return LInstruction::k##type; } \ | 157 Opcode opcode() const final { return LInstruction::k##type; } \ |
157 void CompileToNative(LCodeGen* generator) final; \ | 158 void CompileToNative(LCodeGen* generator) final; \ |
158 const char* Mnemonic() const final { return mnemonic; } \ | 159 const char* Mnemonic() const final { return mnemonic; } \ |
159 static L##type* cast(LInstruction* instr) { \ | 160 static L##type* cast(LInstruction* instr) { \ |
160 DCHECK(instr->Is##type()); \ | 161 DCHECK(instr->Is##type()); \ |
161 return reinterpret_cast<L##type*>(instr); \ | 162 return reinterpret_cast<L##type*>(instr); \ |
162 } | 163 } |
163 | 164 |
164 | 165 |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, | 801 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, |
801 "compare-numeric-and-branch") | 802 "compare-numeric-and-branch") |
802 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) | 803 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) |
803 | 804 |
804 Token::Value op() const { return hydrogen()->token(); } | 805 Token::Value op() const { return hydrogen()->token(); } |
805 bool is_double() const { return hydrogen()->representation().IsDouble(); } | 806 bool is_double() const { return hydrogen()->representation().IsDouble(); } |
806 | 807 |
807 void PrintDataTo(StringStream* stream) override; | 808 void PrintDataTo(StringStream* stream) override; |
808 }; | 809 }; |
809 | 810 |
810 | 811 // Math.floor with a double result. |
811 class LMathFloor final : public LTemplateInstruction<1, 1, 0> { | 812 class LMathFloorD final : public LTemplateInstruction<1, 1, 0> { |
812 public: | 813 public: |
813 explicit LMathFloor(LOperand* value) { inputs_[0] = value; } | 814 explicit LMathFloorD(LOperand* value) { inputs_[0] = value; } |
814 | 815 |
815 LOperand* value() { return inputs_[0]; } | 816 LOperand* value() { return inputs_[0]; } |
816 | 817 |
817 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 818 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") |
818 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 819 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
819 }; | 820 }; |
820 | 821 |
| 822 // Math.floor with an integer result. |
| 823 class LMathFloorI final : public LTemplateInstruction<1, 1, 0> { |
| 824 public: |
| 825 explicit LMathFloorI(LOperand* value) { inputs_[0] = value; } |
821 | 826 |
822 class LMathRound final : public LTemplateInstruction<1, 1, 1> { | 827 LOperand* value() { return inputs_[0]; } |
| 828 |
| 829 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") |
| 830 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 831 }; |
| 832 |
| 833 // Math.round with a double result. |
| 834 class LMathRoundD final : public LTemplateInstruction<1, 1, 0> { |
823 public: | 835 public: |
824 LMathRound(LOperand* value, LOperand* temp) { | 836 explicit LMathRoundD(LOperand* value) { inputs_[0] = value; } |
| 837 |
| 838 LOperand* value() { return inputs_[0]; } |
| 839 |
| 840 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") |
| 841 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 842 }; |
| 843 |
| 844 // Math.round with an integer result. |
| 845 class LMathRoundI final : public LTemplateInstruction<1, 1, 1> { |
| 846 public: |
| 847 LMathRoundI(LOperand* value, LOperand* temp) { |
825 inputs_[0] = value; | 848 inputs_[0] = value; |
826 temps_[0] = temp; | 849 temps_[0] = temp; |
827 } | 850 } |
828 | 851 |
829 LOperand* value() { return inputs_[0]; } | 852 LOperand* value() { return inputs_[0]; } |
830 LOperand* temp() { return temps_[0]; } | 853 LOperand* temp() { return temps_[0]; } |
831 | 854 |
832 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") | 855 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") |
833 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 856 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
834 }; | 857 }; |
835 | 858 |
836 | 859 |
837 class LMathFround final : public LTemplateInstruction<1, 1, 0> { | 860 class LMathFround final : public LTemplateInstruction<1, 1, 0> { |
838 public: | 861 public: |
839 explicit LMathFround(LOperand* value) { inputs_[0] = value; } | 862 explicit LMathFround(LOperand* value) { inputs_[0] = value; } |
840 | 863 |
841 LOperand* value() { return inputs_[0]; } | 864 LOperand* value() { return inputs_[0]; } |
842 | 865 |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 | 2566 |
2544 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2567 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2545 }; | 2568 }; |
2546 | 2569 |
2547 #undef DECLARE_HYDROGEN_ACCESSOR | 2570 #undef DECLARE_HYDROGEN_ACCESSOR |
2548 #undef DECLARE_CONCRETE_INSTRUCTION | 2571 #undef DECLARE_CONCRETE_INSTRUCTION |
2549 } // namespace internal | 2572 } // namespace internal |
2550 } // namespace v8 | 2573 } // namespace v8 |
2551 | 2574 |
2552 #endif // V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ | 2575 #endif // V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ |
OLD | NEW |