| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 V(LoadExternalArrayPointer) \ | 121 V(LoadExternalArrayPointer) \ |
| 122 V(LoadFunctionPrototype) \ | 122 V(LoadFunctionPrototype) \ |
| 123 V(LoadGlobalCell) \ | 123 V(LoadGlobalCell) \ |
| 124 V(LoadGlobalGeneric) \ | 124 V(LoadGlobalGeneric) \ |
| 125 V(LoadKeyed) \ | 125 V(LoadKeyed) \ |
| 126 V(LoadKeyedGeneric) \ | 126 V(LoadKeyedGeneric) \ |
| 127 V(LoadNamedField) \ | 127 V(LoadNamedField) \ |
| 128 V(LoadNamedFieldPolymorphic) \ | 128 V(LoadNamedFieldPolymorphic) \ |
| 129 V(LoadNamedGeneric) \ | 129 V(LoadNamedGeneric) \ |
| 130 V(MapEnumLength) \ | 130 V(MapEnumLength) \ |
| 131 V(MathAbs) \ |
| 132 V(MathCos) \ |
| 131 V(MathExp) \ | 133 V(MathExp) \ |
| 134 V(MathFloor) \ |
| 132 V(MathFloorOfDiv) \ | 135 V(MathFloorOfDiv) \ |
| 136 V(MathLog) \ |
| 133 V(MathMinMax) \ | 137 V(MathMinMax) \ |
| 134 V(MathPowHalf) \ | 138 V(MathPowHalf) \ |
| 135 V(MathRound) \ | 139 V(MathRound) \ |
| 140 V(MathSin) \ |
| 141 V(MathSqrt) \ |
| 142 V(MathTan) \ |
| 136 V(ModI) \ | 143 V(ModI) \ |
| 137 V(MulI) \ | 144 V(MulI) \ |
| 138 V(NumberTagD) \ | 145 V(NumberTagD) \ |
| 139 V(NumberTagI) \ | 146 V(NumberTagI) \ |
| 140 V(NumberTagU) \ | 147 V(NumberTagU) \ |
| 141 V(NumberUntagD) \ | 148 V(NumberUntagD) \ |
| 142 V(ObjectLiteral) \ | 149 V(ObjectLiteral) \ |
| 143 V(OsrEntry) \ | 150 V(OsrEntry) \ |
| 144 V(OuterContext) \ | 151 V(OuterContext) \ |
| 145 V(Parameter) \ | 152 V(Parameter) \ |
| (...skipping 22 matching lines...) Expand all Loading... |
| 168 V(SubI) \ | 175 V(SubI) \ |
| 169 V(TaggedToI) \ | 176 V(TaggedToI) \ |
| 170 V(TaggedToINoSSE2) \ | 177 V(TaggedToINoSSE2) \ |
| 171 V(ThisFunction) \ | 178 V(ThisFunction) \ |
| 172 V(Throw) \ | 179 V(Throw) \ |
| 173 V(ToFastProperties) \ | 180 V(ToFastProperties) \ |
| 174 V(TransitionElementsKind) \ | 181 V(TransitionElementsKind) \ |
| 175 V(TrapAllocationMemento) \ | 182 V(TrapAllocationMemento) \ |
| 176 V(Typeof) \ | 183 V(Typeof) \ |
| 177 V(TypeofIsAndBranch) \ | 184 V(TypeofIsAndBranch) \ |
| 178 V(UnaryMathOperation) \ | |
| 179 V(UnknownOSRValue) \ | 185 V(UnknownOSRValue) \ |
| 180 V(ValueOf) \ | 186 V(ValueOf) \ |
| 181 V(ForInPrepareMap) \ | 187 V(ForInPrepareMap) \ |
| 182 V(ForInCacheArray) \ | 188 V(ForInCacheArray) \ |
| 183 V(CheckMapValue) \ | 189 V(CheckMapValue) \ |
| 184 V(LoadFieldByIndex) \ | 190 V(LoadFieldByIndex) \ |
| 185 V(DateField) \ | 191 V(DateField) \ |
| 186 V(WrapReceiver) \ | 192 V(WrapReceiver) \ |
| 187 V(Drop) \ | 193 V(Drop) \ |
| 188 V(InnerAllocatedObject) | 194 V(InnerAllocatedObject) |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 648 |
| 643 Token::Value op() const { return hydrogen()->token(); } | 649 Token::Value op() const { return hydrogen()->token(); } |
| 644 bool is_double() const { | 650 bool is_double() const { |
| 645 return hydrogen()->representation().IsDouble(); | 651 return hydrogen()->representation().IsDouble(); |
| 646 } | 652 } |
| 647 | 653 |
| 648 virtual void PrintDataTo(StringStream* stream); | 654 virtual void PrintDataTo(StringStream* stream); |
| 649 }; | 655 }; |
| 650 | 656 |
| 651 | 657 |
| 652 class LUnaryMathOperation: public LTemplateInstruction<1, 2, 0> { | 658 class LMathFloor: public LTemplateInstruction<1, 1, 0> { |
| 653 public: | 659 public: |
| 654 LUnaryMathOperation(LOperand* context, LOperand* value) { | 660 explicit LMathFloor(LOperand* value) { |
| 661 inputs_[0] = value; |
| 662 } |
| 663 |
| 664 LOperand* value() { return inputs_[0]; } |
| 665 |
| 666 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
| 667 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 668 }; |
| 669 |
| 670 |
| 671 class LMathRound: public LTemplateInstruction<1, 2, 1> { |
| 672 public: |
| 673 LMathRound(LOperand* context, LOperand* value, LOperand* temp) { |
| 674 inputs_[1] = context; |
| 675 inputs_[0] = value; |
| 676 temps_[0] = temp; |
| 677 } |
| 678 |
| 679 LOperand* context() { return inputs_[1]; } |
| 680 LOperand* value() { return inputs_[0]; } |
| 681 LOperand* temp() { return temps_[0]; } |
| 682 |
| 683 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") |
| 684 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 685 }; |
| 686 |
| 687 |
| 688 class LMathAbs: public LTemplateInstruction<1, 2, 0> { |
| 689 public: |
| 690 LMathAbs(LOperand* context, LOperand* value) { |
| 655 inputs_[1] = context; | 691 inputs_[1] = context; |
| 656 inputs_[0] = value; | 692 inputs_[0] = value; |
| 657 } | 693 } |
| 658 | 694 |
| 659 LOperand* context() { return inputs_[1]; } | 695 LOperand* context() { return inputs_[1]; } |
| 660 LOperand* value() { return inputs_[0]; } | 696 LOperand* value() { return inputs_[0]; } |
| 661 | 697 |
| 662 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 698 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") |
| 663 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 699 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 664 | |
| 665 virtual void PrintDataTo(StringStream* stream); | |
| 666 BuiltinFunctionId op() const { return hydrogen()->op(); } | |
| 667 }; | 700 }; |
| 668 | 701 |
| 669 | 702 |
| 703 class LMathLog: public LTemplateInstruction<1, 1, 0> { |
| 704 public: |
| 705 explicit LMathLog(LOperand* value) { |
| 706 inputs_[0] = value; |
| 707 } |
| 708 |
| 709 LOperand* value() { return inputs_[0]; } |
| 710 |
| 711 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
| 712 }; |
| 713 |
| 714 |
| 715 class LMathSin: public LTemplateInstruction<1, 1, 0> { |
| 716 public: |
| 717 explicit LMathSin(LOperand* value) { |
| 718 inputs_[0] = value; |
| 719 } |
| 720 |
| 721 LOperand* value() { return inputs_[0]; } |
| 722 |
| 723 DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin") |
| 724 }; |
| 725 |
| 726 |
| 727 class LMathCos: public LTemplateInstruction<1, 1, 0> { |
| 728 public: |
| 729 explicit LMathCos(LOperand* value) { |
| 730 inputs_[0] = value; |
| 731 } |
| 732 |
| 733 LOperand* value() { return inputs_[0]; } |
| 734 |
| 735 DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos") |
| 736 }; |
| 737 |
| 738 |
| 739 class LMathTan: public LTemplateInstruction<1, 1, 0> { |
| 740 public: |
| 741 explicit LMathTan(LOperand* value) { |
| 742 inputs_[0] = value; |
| 743 } |
| 744 |
| 745 LOperand* value() { return inputs_[0]; } |
| 746 |
| 747 DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan") |
| 748 }; |
| 749 |
| 750 |
| 670 class LMathExp: public LTemplateInstruction<1, 1, 2> { | 751 class LMathExp: public LTemplateInstruction<1, 1, 2> { |
| 671 public: | 752 public: |
| 672 LMathExp(LOperand* value, | 753 LMathExp(LOperand* value, |
| 673 LOperand* temp1, | 754 LOperand* temp1, |
| 674 LOperand* temp2) { | 755 LOperand* temp2) { |
| 675 inputs_[0] = value; | 756 inputs_[0] = value; |
| 676 temps_[0] = temp1; | 757 temps_[0] = temp1; |
| 677 temps_[1] = temp2; | 758 temps_[1] = temp2; |
| 678 ExternalReference::InitializeMathExpData(); | 759 ExternalReference::InitializeMathExpData(); |
| 679 } | 760 } |
| 680 | 761 |
| 681 LOperand* value() { return inputs_[0]; } | 762 LOperand* value() { return inputs_[0]; } |
| 682 LOperand* temp1() { return temps_[0]; } | 763 LOperand* temp1() { return temps_[0]; } |
| 683 LOperand* temp2() { return temps_[1]; } | 764 LOperand* temp2() { return temps_[1]; } |
| 684 | 765 |
| 685 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") | 766 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
| 767 }; |
| 686 | 768 |
| 687 virtual void PrintDataTo(StringStream* stream); | 769 |
| 770 class LMathSqrt: public LTemplateInstruction<1, 1, 0> { |
| 771 public: |
| 772 explicit LMathSqrt(LOperand* value) { |
| 773 inputs_[0] = value; |
| 774 } |
| 775 |
| 776 LOperand* value() { return inputs_[0]; } |
| 777 |
| 778 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
| 688 }; | 779 }; |
| 689 | 780 |
| 690 | 781 |
| 691 class LMathPowHalf: public LTemplateInstruction<1, 2, 1> { | 782 class LMathPowHalf: public LTemplateInstruction<1, 2, 1> { |
| 692 public: | 783 public: |
| 693 LMathPowHalf(LOperand* context, LOperand* value, LOperand* temp) { | 784 LMathPowHalf(LOperand* context, LOperand* value, LOperand* temp) { |
| 694 inputs_[1] = context; | 785 inputs_[1] = context; |
| 695 inputs_[0] = value; | 786 inputs_[0] = value; |
| 696 temps_[0] = temp; | 787 temps_[0] = temp; |
| 697 } | |
| 698 | |
| 699 LOperand* context() { return inputs_[1]; } | |
| 700 LOperand* value() { return inputs_[0]; } | |
| 701 LOperand* temp() { return temps_[0]; } | |
| 702 | |
| 703 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") | |
| 704 | |
| 705 virtual void PrintDataTo(StringStream* stream); | |
| 706 }; | |
| 707 | |
| 708 | |
| 709 class LMathRound: public LTemplateInstruction<1, 2, 1> { | |
| 710 public: | |
| 711 LMathRound(LOperand* context, LOperand* value, LOperand* temp) { | |
| 712 inputs_[1] = context; | |
| 713 inputs_[0] = value; | |
| 714 temps_[0] = temp; | |
| 715 } | 788 } |
| 716 | 789 |
| 717 LOperand* context() { return inputs_[1]; } | 790 LOperand* context() { return inputs_[1]; } |
| 718 LOperand* value() { return inputs_[0]; } | 791 LOperand* value() { return inputs_[0]; } |
| 719 LOperand* temp() { return temps_[0]; } | 792 LOperand* temp() { return temps_[0]; } |
| 720 | 793 |
| 721 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") | 794 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
| 722 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | |
| 723 | |
| 724 virtual void PrintDataTo(StringStream* stream); | |
| 725 }; | 795 }; |
| 726 | 796 |
| 727 | 797 |
| 728 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { | 798 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { |
| 729 public: | 799 public: |
| 730 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 800 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
| 731 inputs_[0] = left; | 801 inputs_[0] = left; |
| 732 inputs_[1] = right; | 802 inputs_[1] = right; |
| 733 } | 803 } |
| 734 | 804 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { | 1367 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { |
| 1298 public: | 1368 public: |
| 1299 LMathMinMax(LOperand* left, LOperand* right) { | 1369 LMathMinMax(LOperand* left, LOperand* right) { |
| 1300 inputs_[0] = left; | 1370 inputs_[0] = left; |
| 1301 inputs_[1] = right; | 1371 inputs_[1] = right; |
| 1302 } | 1372 } |
| 1303 | 1373 |
| 1304 LOperand* left() { return inputs_[0]; } | 1374 LOperand* left() { return inputs_[0]; } |
| 1305 LOperand* right() { return inputs_[1]; } | 1375 LOperand* right() { return inputs_[1]; } |
| 1306 | 1376 |
| 1307 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") | 1377 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") |
| 1308 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) | 1378 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) |
| 1309 }; | 1379 }; |
| 1310 | 1380 |
| 1311 | 1381 |
| 1312 class LPower: public LTemplateInstruction<1, 2, 0> { | 1382 class LPower: public LTemplateInstruction<1, 2, 0> { |
| 1313 public: | 1383 public: |
| 1314 LPower(LOperand* left, LOperand* right) { | 1384 LPower(LOperand* left, LOperand* right) { |
| 1315 inputs_[0] = left; | 1385 inputs_[0] = left; |
| 1316 inputs_[1] = right; | 1386 inputs_[1] = right; |
| 1317 } | 1387 } |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2753 LPlatformChunk* Build(); | 2823 LPlatformChunk* Build(); |
| 2754 | 2824 |
| 2755 // Declare methods that deal with the individual node types. | 2825 // Declare methods that deal with the individual node types. |
| 2756 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2826 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| 2757 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2827 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2758 #undef DECLARE_DO | 2828 #undef DECLARE_DO |
| 2759 | 2829 |
| 2760 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); | 2830 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); |
| 2761 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); | 2831 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); |
| 2762 | 2832 |
| 2833 LInstruction* DoMathFloor(HUnaryMathOperation* instr); |
| 2834 LInstruction* DoMathRound(HUnaryMathOperation* instr); |
| 2835 LInstruction* DoMathAbs(HUnaryMathOperation* instr); |
| 2836 LInstruction* DoMathLog(HUnaryMathOperation* instr); |
| 2837 LInstruction* DoMathSin(HUnaryMathOperation* instr); |
| 2838 LInstruction* DoMathCos(HUnaryMathOperation* instr); |
| 2839 LInstruction* DoMathTan(HUnaryMathOperation* instr); |
| 2840 LInstruction* DoMathExp(HUnaryMathOperation* instr); |
| 2841 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); |
| 2842 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); |
| 2843 |
| 2763 private: | 2844 private: |
| 2764 enum Status { | 2845 enum Status { |
| 2765 UNUSED, | 2846 UNUSED, |
| 2766 BUILDING, | 2847 BUILDING, |
| 2767 DONE, | 2848 DONE, |
| 2768 ABORTED | 2849 ABORTED |
| 2769 }; | 2850 }; |
| 2770 | 2851 |
| 2771 LPlatformChunk* chunk() const { return chunk_; } | 2852 LPlatformChunk* chunk() const { return chunk_; } |
| 2772 CompilationInfo* info() const { return info_; } | 2853 CompilationInfo* info() const { return info_; } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2894 | 2975 |
| 2895 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2976 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2896 }; | 2977 }; |
| 2897 | 2978 |
| 2898 #undef DECLARE_HYDROGEN_ACCESSOR | 2979 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2899 #undef DECLARE_CONCRETE_INSTRUCTION | 2980 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2900 | 2981 |
| 2901 } } // namespace v8::internal | 2982 } } // namespace v8::internal |
| 2902 | 2983 |
| 2903 #endif // V8_IA32_LITHIUM_IA32_H_ | 2984 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |