OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_IA32_LITHIUM_IA32_H_ | 5 #ifndef V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ |
6 #define V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ | 6 #define V8_CRANKSHAFT_IA32_LITHIUM_IA32_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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 V(LoadFunctionPrototype) \ | 96 V(LoadFunctionPrototype) \ |
97 V(LoadGlobalGeneric) \ | 97 V(LoadGlobalGeneric) \ |
98 V(LoadKeyed) \ | 98 V(LoadKeyed) \ |
99 V(LoadKeyedGeneric) \ | 99 V(LoadKeyedGeneric) \ |
100 V(LoadNamedField) \ | 100 V(LoadNamedField) \ |
101 V(LoadNamedGeneric) \ | 101 V(LoadNamedGeneric) \ |
102 V(LoadRoot) \ | 102 V(LoadRoot) \ |
103 V(MathAbs) \ | 103 V(MathAbs) \ |
104 V(MathClz32) \ | 104 V(MathClz32) \ |
105 V(MathExp) \ | 105 V(MathExp) \ |
106 V(MathFloor) \ | 106 V(MathFloorD) \ |
| 107 V(MathFloorI) \ |
107 V(MathFround) \ | 108 V(MathFround) \ |
108 V(MathLog) \ | 109 V(MathLog) \ |
109 V(MathMinMax) \ | 110 V(MathMinMax) \ |
110 V(MathPowHalf) \ | 111 V(MathPowHalf) \ |
111 V(MathRound) \ | 112 V(MathRoundD) \ |
| 113 V(MathRoundI) \ |
112 V(MathSqrt) \ | 114 V(MathSqrt) \ |
113 V(MaybeGrowElements) \ | 115 V(MaybeGrowElements) \ |
114 V(ModByConstI) \ | 116 V(ModByConstI) \ |
115 V(ModByPowerOf2I) \ | 117 V(ModByPowerOf2I) \ |
116 V(ModI) \ | 118 V(ModI) \ |
117 V(MulI) \ | 119 V(MulI) \ |
118 V(NumberTagD) \ | 120 V(NumberTagD) \ |
119 V(NumberTagI) \ | 121 V(NumberTagI) \ |
120 V(NumberTagU) \ | 122 V(NumberTagU) \ |
121 V(NumberUntagD) \ | 123 V(NumberUntagD) \ |
(...skipping 24 matching lines...) Expand all Loading... |
146 V(TaggedToI) \ | 148 V(TaggedToI) \ |
147 V(ThisFunction) \ | 149 V(ThisFunction) \ |
148 V(TransitionElementsKind) \ | 150 V(TransitionElementsKind) \ |
149 V(TrapAllocationMemento) \ | 151 V(TrapAllocationMemento) \ |
150 V(Typeof) \ | 152 V(Typeof) \ |
151 V(TypeofIsAndBranch) \ | 153 V(TypeofIsAndBranch) \ |
152 V(Uint32ToDouble) \ | 154 V(Uint32ToDouble) \ |
153 V(UnknownOSRValue) \ | 155 V(UnknownOSRValue) \ |
154 V(WrapReceiver) | 156 V(WrapReceiver) |
155 | 157 |
156 | |
157 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 158 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
158 Opcode opcode() const final { return LInstruction::k##type; } \ | 159 Opcode opcode() const final { return LInstruction::k##type; } \ |
159 void CompileToNative(LCodeGen* generator) final; \ | 160 void CompileToNative(LCodeGen* generator) final; \ |
160 const char* Mnemonic() const final { return mnemonic; } \ | 161 const char* Mnemonic() const final { return mnemonic; } \ |
161 static L##type* cast(LInstruction* instr) { \ | 162 static L##type* cast(LInstruction* instr) { \ |
162 DCHECK(instr->Is##type()); \ | 163 DCHECK(instr->Is##type()); \ |
163 return reinterpret_cast<L##type*>(instr); \ | 164 return reinterpret_cast<L##type*>(instr); \ |
164 } | 165 } |
165 | 166 |
166 | 167 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) | 809 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) |
809 | 810 |
810 Token::Value op() const { return hydrogen()->token(); } | 811 Token::Value op() const { return hydrogen()->token(); } |
811 bool is_double() const { | 812 bool is_double() const { |
812 return hydrogen()->representation().IsDouble(); | 813 return hydrogen()->representation().IsDouble(); |
813 } | 814 } |
814 | 815 |
815 void PrintDataTo(StringStream* stream) override; | 816 void PrintDataTo(StringStream* stream) override; |
816 }; | 817 }; |
817 | 818 |
818 | 819 // Math.floor with a double result. |
819 class LMathFloor final : public LTemplateInstruction<1, 1, 0> { | 820 class LMathFloorD final : public LTemplateInstruction<1, 1, 0> { |
820 public: | 821 public: |
821 explicit LMathFloor(LOperand* value) { | 822 explicit LMathFloorD(LOperand* value) { inputs_[0] = value; } |
822 inputs_[0] = value; | |
823 } | |
824 | 823 |
825 LOperand* value() { return inputs_[0]; } | 824 LOperand* value() { return inputs_[0]; } |
826 | 825 |
827 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 826 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") |
828 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 827 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
829 }; | 828 }; |
830 | 829 |
| 830 // Math.floor with an integer result. |
| 831 class LMathFloorI final : public LTemplateInstruction<1, 1, 0> { |
| 832 public: |
| 833 explicit LMathFloorI(LOperand* value) { inputs_[0] = value; } |
831 | 834 |
832 class LMathRound final : public LTemplateInstruction<1, 1, 1> { | 835 LOperand* value() { return inputs_[0]; } |
| 836 |
| 837 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") |
| 838 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 839 }; |
| 840 |
| 841 // Math.round with a double result. |
| 842 class LMathRoundD final : public LTemplateInstruction<1, 1, 0> { |
833 public: | 843 public: |
834 LMathRound(LOperand* value, LOperand* temp) { | 844 explicit LMathRoundD(LOperand* value) { inputs_[0] = value; } |
| 845 |
| 846 LOperand* value() { return inputs_[0]; } |
| 847 |
| 848 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") |
| 849 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 850 }; |
| 851 |
| 852 // Math.round with an integer result. |
| 853 class LMathRoundI final : public LTemplateInstruction<1, 1, 1> { |
| 854 public: |
| 855 LMathRoundI(LOperand* value, LOperand* temp) { |
835 inputs_[0] = value; | 856 inputs_[0] = value; |
836 temps_[0] = temp; | 857 temps_[0] = temp; |
837 } | 858 } |
838 | 859 |
839 LOperand* temp() { return temps_[0]; } | 860 LOperand* temp() { return temps_[0]; } |
840 LOperand* value() { return inputs_[0]; } | 861 LOperand* value() { return inputs_[0]; } |
841 | 862 |
842 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") | 863 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") |
843 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 864 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
844 }; | 865 }; |
845 | 866 |
846 | 867 |
847 class LMathFround final : public LTemplateInstruction<1, 1, 0> { | 868 class LMathFround final : public LTemplateInstruction<1, 1, 0> { |
848 public: | 869 public: |
849 explicit LMathFround(LOperand* value) { inputs_[0] = value; } | 870 explicit LMathFround(LOperand* value) { inputs_[0] = value; } |
850 | 871 |
851 LOperand* value() { return inputs_[0]; } | 872 LOperand* value() { return inputs_[0]; } |
852 | 873 |
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2686 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2666 }; | 2687 }; |
2667 | 2688 |
2668 #undef DECLARE_HYDROGEN_ACCESSOR | 2689 #undef DECLARE_HYDROGEN_ACCESSOR |
2669 #undef DECLARE_CONCRETE_INSTRUCTION | 2690 #undef DECLARE_CONCRETE_INSTRUCTION |
2670 | 2691 |
2671 } // namespace internal | 2692 } // namespace internal |
2672 } // namespace v8 | 2693 } // namespace v8 |
2673 | 2694 |
2674 #endif // V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ | 2695 #endif // V8_CRANKSHAFT_IA32_LITHIUM_IA32_H_ |
OLD | NEW |