OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 V(LoadExternalArrayPointer) \ | 126 V(LoadExternalArrayPointer) \ |
127 V(LoadFunctionPrototype) \ | 127 V(LoadFunctionPrototype) \ |
128 V(LoadGlobalCell) \ | 128 V(LoadGlobalCell) \ |
129 V(LoadGlobalGeneric) \ | 129 V(LoadGlobalGeneric) \ |
130 V(LoadKeyed) \ | 130 V(LoadKeyed) \ |
131 V(LoadKeyedGeneric) \ | 131 V(LoadKeyedGeneric) \ |
132 V(LoadNamedField) \ | 132 V(LoadNamedField) \ |
133 V(LoadNamedFieldPolymorphic) \ | 133 V(LoadNamedFieldPolymorphic) \ |
134 V(LoadNamedGeneric) \ | 134 V(LoadNamedGeneric) \ |
135 V(MapEnumLength) \ | 135 V(MapEnumLength) \ |
| 136 V(MathAbs) \ |
| 137 V(MathCos) \ |
136 V(MathExp) \ | 138 V(MathExp) \ |
| 139 V(MathFloor) \ |
137 V(MathFloorOfDiv) \ | 140 V(MathFloorOfDiv) \ |
| 141 V(MathLog) \ |
138 V(MathMinMax) \ | 142 V(MathMinMax) \ |
| 143 V(MathPowHalf) \ |
| 144 V(MathRound) \ |
| 145 V(MathSin) \ |
| 146 V(MathSqrt) \ |
| 147 V(MathTan) \ |
139 V(ModI) \ | 148 V(ModI) \ |
140 V(MulI) \ | 149 V(MulI) \ |
141 V(MultiplyAddD) \ | 150 V(MultiplyAddD) \ |
142 V(MultiplySubD) \ | 151 V(MultiplySubD) \ |
143 V(NumberTagD) \ | 152 V(NumberTagD) \ |
144 V(NumberTagI) \ | 153 V(NumberTagI) \ |
145 V(NumberTagU) \ | 154 V(NumberTagU) \ |
146 V(NumberUntagD) \ | 155 V(NumberUntagD) \ |
147 V(ObjectLiteral) \ | 156 V(ObjectLiteral) \ |
148 V(OsrEntry) \ | 157 V(OsrEntry) \ |
(...skipping 24 matching lines...) Expand all Loading... |
173 V(SubI) \ | 182 V(SubI) \ |
174 V(RSubI) \ | 183 V(RSubI) \ |
175 V(TaggedToI) \ | 184 V(TaggedToI) \ |
176 V(ThisFunction) \ | 185 V(ThisFunction) \ |
177 V(Throw) \ | 186 V(Throw) \ |
178 V(ToFastProperties) \ | 187 V(ToFastProperties) \ |
179 V(TransitionElementsKind) \ | 188 V(TransitionElementsKind) \ |
180 V(TrapAllocationMemento) \ | 189 V(TrapAllocationMemento) \ |
181 V(Typeof) \ | 190 V(Typeof) \ |
182 V(TypeofIsAndBranch) \ | 191 V(TypeofIsAndBranch) \ |
183 V(UnaryMathOperation) \ | |
184 V(UnknownOSRValue) \ | 192 V(UnknownOSRValue) \ |
185 V(ValueOf) \ | 193 V(ValueOf) \ |
186 V(ForInPrepareMap) \ | 194 V(ForInPrepareMap) \ |
187 V(ForInCacheArray) \ | 195 V(ForInCacheArray) \ |
188 V(CheckMapValue) \ | 196 V(CheckMapValue) \ |
189 V(LoadFieldByIndex) \ | 197 V(LoadFieldByIndex) \ |
190 V(DateField) \ | 198 V(DateField) \ |
191 V(WrapReceiver) \ | 199 V(WrapReceiver) \ |
192 V(Drop) \ | 200 V(Drop) \ |
193 V(InnerAllocatedObject) | 201 V(InnerAllocatedObject) |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 | 703 |
696 Token::Value op() const { return hydrogen()->token(); } | 704 Token::Value op() const { return hydrogen()->token(); } |
697 bool is_double() const { | 705 bool is_double() const { |
698 return hydrogen()->representation().IsDouble(); | 706 return hydrogen()->representation().IsDouble(); |
699 } | 707 } |
700 | 708 |
701 virtual void PrintDataTo(StringStream* stream); | 709 virtual void PrintDataTo(StringStream* stream); |
702 }; | 710 }; |
703 | 711 |
704 | 712 |
705 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> { | 713 class LMathFloor: public LTemplateInstruction<1, 1, 0> { |
706 public: | 714 public: |
707 LUnaryMathOperation(LOperand* value, LOperand* temp) { | 715 explicit LMathFloor(LOperand* value) { |
| 716 inputs_[0] = value; |
| 717 } |
| 718 |
| 719 LOperand* value() { return inputs_[0]; } |
| 720 |
| 721 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
| 722 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 723 }; |
| 724 |
| 725 |
| 726 class LMathRound: public LTemplateInstruction<1, 1, 1> { |
| 727 public: |
| 728 LMathRound(LOperand* value, LOperand* temp) { |
708 inputs_[0] = value; | 729 inputs_[0] = value; |
709 temps_[0] = temp; | 730 temps_[0] = temp; |
710 } | 731 } |
711 | 732 |
712 LOperand* value() { return inputs_[0]; } | 733 LOperand* value() { return inputs_[0]; } |
713 LOperand* temp() { return temps_[0]; } | 734 LOperand* temp() { return temps_[0]; } |
714 | 735 |
715 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 736 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") |
716 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 737 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
717 | |
718 virtual void PrintDataTo(StringStream* stream); | |
719 BuiltinFunctionId op() const { return hydrogen()->op(); } | |
720 }; | 738 }; |
721 | 739 |
722 | 740 |
| 741 class LMathAbs: public LTemplateInstruction<1, 1, 0> { |
| 742 public: |
| 743 explicit LMathAbs(LOperand* value) { |
| 744 inputs_[0] = value; |
| 745 } |
| 746 |
| 747 LOperand* value() { return inputs_[0]; } |
| 748 |
| 749 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") |
| 750 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 751 }; |
| 752 |
| 753 |
| 754 class LMathLog: public LTemplateInstruction<1, 1, 0> { |
| 755 public: |
| 756 explicit LMathLog(LOperand* value) { |
| 757 inputs_[0] = value; |
| 758 } |
| 759 |
| 760 LOperand* value() { return inputs_[0]; } |
| 761 |
| 762 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
| 763 }; |
| 764 |
| 765 |
| 766 class LMathSin: public LTemplateInstruction<1, 1, 0> { |
| 767 public: |
| 768 explicit LMathSin(LOperand* value) { |
| 769 inputs_[0] = value; |
| 770 } |
| 771 |
| 772 LOperand* value() { return inputs_[0]; } |
| 773 |
| 774 DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin") |
| 775 }; |
| 776 |
| 777 |
| 778 class LMathCos: public LTemplateInstruction<1, 1, 0> { |
| 779 public: |
| 780 explicit LMathCos(LOperand* value) { |
| 781 inputs_[0] = value; |
| 782 } |
| 783 |
| 784 LOperand* value() { return inputs_[0]; } |
| 785 |
| 786 DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos") |
| 787 }; |
| 788 |
| 789 |
| 790 class LMathTan: public LTemplateInstruction<1, 1, 0> { |
| 791 public: |
| 792 explicit LMathTan(LOperand* value) { |
| 793 inputs_[0] = value; |
| 794 } |
| 795 |
| 796 LOperand* value() { return inputs_[0]; } |
| 797 |
| 798 DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan") |
| 799 }; |
| 800 |
| 801 |
723 class LMathExp: public LTemplateInstruction<1, 1, 3> { | 802 class LMathExp: public LTemplateInstruction<1, 1, 3> { |
724 public: | 803 public: |
725 LMathExp(LOperand* value, | 804 LMathExp(LOperand* value, |
726 LOperand* double_temp, | 805 LOperand* double_temp, |
727 LOperand* temp1, | 806 LOperand* temp1, |
728 LOperand* temp2) { | 807 LOperand* temp2) { |
729 inputs_[0] = value; | 808 inputs_[0] = value; |
730 temps_[0] = temp1; | 809 temps_[0] = temp1; |
731 temps_[1] = temp2; | 810 temps_[1] = temp2; |
732 temps_[2] = double_temp; | 811 temps_[2] = double_temp; |
733 ExternalReference::InitializeMathExpData(); | 812 ExternalReference::InitializeMathExpData(); |
734 } | 813 } |
735 | 814 |
736 LOperand* value() { return inputs_[0]; } | 815 LOperand* value() { return inputs_[0]; } |
737 LOperand* temp1() { return temps_[0]; } | 816 LOperand* temp1() { return temps_[0]; } |
738 LOperand* temp2() { return temps_[1]; } | 817 LOperand* temp2() { return temps_[1]; } |
739 LOperand* double_temp() { return temps_[2]; } | 818 LOperand* double_temp() { return temps_[2]; } |
740 | 819 |
741 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") | 820 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
742 | |
743 virtual void PrintDataTo(StringStream* stream); | |
744 }; | 821 }; |
745 | 822 |
746 | 823 |
| 824 class LMathSqrt: public LTemplateInstruction<1, 1, 0> { |
| 825 public: |
| 826 explicit LMathSqrt(LOperand* value) { |
| 827 inputs_[0] = value; |
| 828 } |
| 829 |
| 830 LOperand* value() { return inputs_[0]; } |
| 831 |
| 832 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
| 833 }; |
| 834 |
| 835 |
| 836 class LMathPowHalf: public LTemplateInstruction<1, 1, 1> { |
| 837 public: |
| 838 LMathPowHalf(LOperand* value, LOperand* temp) { |
| 839 inputs_[0] = value; |
| 840 temps_[0] = temp; |
| 841 } |
| 842 |
| 843 LOperand* value() { return inputs_[0]; } |
| 844 LOperand* temp() { return temps_[0]; } |
| 845 |
| 846 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
| 847 }; |
| 848 |
| 849 |
747 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { | 850 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { |
748 public: | 851 public: |
749 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 852 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
750 inputs_[0] = left; | 853 inputs_[0] = left; |
751 inputs_[1] = right; | 854 inputs_[1] = right; |
752 } | 855 } |
753 | 856 |
754 LOperand* left() { return inputs_[0]; } | 857 LOperand* left() { return inputs_[0]; } |
755 LOperand* right() { return inputs_[1]; } | 858 LOperand* right() { return inputs_[1]; } |
756 | 859 |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { | 1405 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { |
1303 public: | 1406 public: |
1304 LMathMinMax(LOperand* left, LOperand* right) { | 1407 LMathMinMax(LOperand* left, LOperand* right) { |
1305 inputs_[0] = left; | 1408 inputs_[0] = left; |
1306 inputs_[1] = right; | 1409 inputs_[1] = right; |
1307 } | 1410 } |
1308 | 1411 |
1309 LOperand* left() { return inputs_[0]; } | 1412 LOperand* left() { return inputs_[0]; } |
1310 LOperand* right() { return inputs_[1]; } | 1413 LOperand* right() { return inputs_[1]; } |
1311 | 1414 |
1312 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") | 1415 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") |
1313 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) | 1416 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) |
1314 }; | 1417 }; |
1315 | 1418 |
1316 | 1419 |
1317 class LPower: public LTemplateInstruction<1, 2, 0> { | 1420 class LPower: public LTemplateInstruction<1, 2, 0> { |
1318 public: | 1421 public: |
1319 LPower(LOperand* left, LOperand* right) { | 1422 LPower(LOperand* left, LOperand* right) { |
1320 inputs_[0] = left; | 1423 inputs_[0] = left; |
1321 inputs_[1] = right; | 1424 inputs_[1] = right; |
1322 } | 1425 } |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2596 #undef DECLARE_DO | 2699 #undef DECLARE_DO |
2597 | 2700 |
2598 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2701 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
2599 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); | 2702 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); |
2600 LInstruction* DoRSub(HSub* instr); | 2703 LInstruction* DoRSub(HSub* instr); |
2601 | 2704 |
2602 static bool HasMagicNumberForDivisor(int32_t divisor); | 2705 static bool HasMagicNumberForDivisor(int32_t divisor); |
2603 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); | 2706 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); |
2604 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); | 2707 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); |
2605 | 2708 |
| 2709 LInstruction* DoMathFloor(HUnaryMathOperation* instr); |
| 2710 LInstruction* DoMathRound(HUnaryMathOperation* instr); |
| 2711 LInstruction* DoMathAbs(HUnaryMathOperation* instr); |
| 2712 LInstruction* DoMathLog(HUnaryMathOperation* instr); |
| 2713 LInstruction* DoMathSin(HUnaryMathOperation* instr); |
| 2714 LInstruction* DoMathCos(HUnaryMathOperation* instr); |
| 2715 LInstruction* DoMathTan(HUnaryMathOperation* instr); |
| 2716 LInstruction* DoMathExp(HUnaryMathOperation* instr); |
| 2717 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); |
| 2718 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); |
| 2719 |
2606 private: | 2720 private: |
2607 enum Status { | 2721 enum Status { |
2608 UNUSED, | 2722 UNUSED, |
2609 BUILDING, | 2723 BUILDING, |
2610 DONE, | 2724 DONE, |
2611 ABORTED | 2725 ABORTED |
2612 }; | 2726 }; |
2613 | 2727 |
2614 LPlatformChunk* chunk() const { return chunk_; } | 2728 LPlatformChunk* chunk() const { return chunk_; } |
2615 CompilationInfo* info() const { return info_; } | 2729 CompilationInfo* info() const { return info_; } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2727 | 2841 |
2728 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2842 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2729 }; | 2843 }; |
2730 | 2844 |
2731 #undef DECLARE_HYDROGEN_ACCESSOR | 2845 #undef DECLARE_HYDROGEN_ACCESSOR |
2732 #undef DECLARE_CONCRETE_INSTRUCTION | 2846 #undef DECLARE_CONCRETE_INSTRUCTION |
2733 | 2847 |
2734 } } // namespace v8::internal | 2848 } } // namespace v8::internal |
2735 | 2849 |
2736 #endif // V8_ARM_LITHIUM_ARM_H_ | 2850 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |