OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 V(::, sin, MathSin, 730107143) \ | 87 V(::, sin, MathSin, 730107143) \ |
88 V(::, cos, MathCos, 1282146521) \ | 88 V(::, cos, MathCos, 1282146521) \ |
89 V(::, min, MathMin, 1022567780) \ | 89 V(::, min, MathMin, 1022567780) \ |
90 V(::, max, MathMax, 612058870) \ | 90 V(::, max, MathMax, 612058870) \ |
91 V(::, _doublePow, MathDoublePow, 1591032382) \ | 91 V(::, _doublePow, MathDoublePow, 1591032382) \ |
92 V(Float32x4, Float32x4., Float32x4Constructor, 1314950569) \ | 92 V(Float32x4, Float32x4., Float32x4Constructor, 1314950569) \ |
93 V(Float32x4, Float32x4.zero, Float32x4Zero, 1432281809) \ | 93 V(Float32x4, Float32x4.zero, Float32x4Zero, 1432281809) \ |
94 V(Float32x4, Float32x4.splat, Float32x4Splat, 1148280442) \ | 94 V(Float32x4, Float32x4.splat, Float32x4Splat, 1148280442) \ |
95 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, \ | 95 V(Float32x4, Float32x4.fromInt32x4Bits, Float32x4FromInt32x4Bits, \ |
96 872145194) \ | 96 872145194) \ |
| 97 V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1511660322) \ |
97 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ | 98 V(_Float32x4, shuffle, Float32x4Shuffle, 1178727105) \ |
98 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 927956119) \ | 99 V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 927956119) \ |
99 V(_Float32x4, get:x, Float32x4ShuffleX, 1351747629) \ | 100 V(_Float32x4, get:x, Float32x4ShuffleX, 1351747629) \ |
100 V(_Float32x4, get:y, Float32x4ShuffleY, 217416201) \ | 101 V(_Float32x4, get:y, Float32x4ShuffleY, 217416201) \ |
101 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144953512) \ | 102 V(_Float32x4, get:z, Float32x4ShuffleZ, 2144953512) \ |
102 V(_Float32x4, get:w, Float32x4ShuffleW, 1447728910) \ | 103 V(_Float32x4, get:w, Float32x4ShuffleW, 1447728910) \ |
103 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198879138) \ | 104 V(_Float32x4, get:signMask, Float32x4GetSignMask, 1198879138) \ |
104 V(_Float32x4, _cmpequal, Float32x4Equal, 1944929844) \ | 105 V(_Float32x4, _cmpequal, Float32x4Equal, 1944929844) \ |
105 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 499965951) \ | 106 V(_Float32x4, _cmpgt, Float32x4GreaterThan, 499965951) \ |
106 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1003006845) \ | 107 V(_Float32x4, _cmpgte, Float32x4GreaterThanOrEqual, 1003006845) \ |
107 V(_Float32x4, _cmplt, Float32x4LessThan, 747070271) \ | 108 V(_Float32x4, _cmplt, Float32x4LessThan, 747070271) \ |
108 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2008368570) \ | 109 V(_Float32x4, _cmplte, Float32x4LessThanOrEqual, 2008368570) \ |
109 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1038562565) \ | 110 V(_Float32x4, _cmpnequal, Float32x4NotEqual, 1038562565) \ |
110 V(_Float32x4, _min, Float32x4Min, 1166664658) \ | 111 V(_Float32x4, _min, Float32x4Min, 1166664658) \ |
111 V(_Float32x4, _max, Float32x4Max, 343968921) \ | 112 V(_Float32x4, _max, Float32x4Max, 343968921) \ |
112 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ | 113 V(_Float32x4, _scale, Float32x4Scale, 803505531) \ |
113 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ | 114 V(_Float32x4, _sqrt, Float32x4Sqrt, 2092250151) \ |
114 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ | 115 V(_Float32x4, _reciprocalSqrt, Float32x4ReciprocalSqrt, 965252704) \ |
115 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ | 116 V(_Float32x4, _reciprocal, Float32x4Reciprocal, 1262202915) \ |
116 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ | 117 V(_Float32x4, _negate, Float32x4Negate, 1203192635) \ |
117 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ | 118 V(_Float32x4, _abs, Float32x4Absolute, 386324188) \ |
118 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ | 119 V(_Float32x4, _clamp, Float32x4Clamp, 1454612345) \ |
119 V(_Float32x4, withX, Float32x4WithX, 795284225) \ | 120 V(_Float32x4, withX, Float32x4WithX, 795284225) \ |
120 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ | 121 V(_Float32x4, withY, Float32x4WithY, 1806065938) \ |
121 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ | 122 V(_Float32x4, withZ, Float32x4WithZ, 320659034) \ |
122 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ | 123 V(_Float32x4, withW, Float32x4WithW, 1108437255) \ |
| 124 V(Float64x2, Float64x2., Float64x2Constructor, 1283521526) \ |
| 125 V(Float64x2, Float64x2.zero, Float64x2Zero, 1971574037) \ |
| 126 V(Float64x2, Float64x2.splat, Float64x2Splat, 823230813) \ |
| 127 V(Float64x2, Float64x2.fromFloat32x4, Float64x2FromFloat32x4, 1383666060) \ |
| 128 V(_Float64x2, get:x, Float64x2GetX, 176817227) \ |
| 129 V(_Float64x2, get:y, Float64x2GetY, 1858031019) \ |
123 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ | 130 V(Int32x4, Int32x4.bool, Int32x4BoolConstructor, 295910141) \ |
124 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ | 131 V(Int32x4, Int32x4.fromFloat32x4Bits, Int32x4FromFloat32x4Bits, \ |
125 893850947) \ | 132 893850947) \ |
126 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ | 133 V(_Int32x4, get:flagX, Int32x4GetFlagX, 729265594) \ |
127 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ | 134 V(_Int32x4, get:flagY, Int32x4GetFlagY, 430870640) \ |
128 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ | 135 V(_Int32x4, get:flagZ, Int32x4GetFlagZ, 1981106287) \ |
129 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ | 136 V(_Int32x4, get:flagW, Int32x4GetFlagW, 629385890) \ |
130 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ | 137 V(_Int32x4, get:signMask, Int32x4GetSignMask, 1598817537) \ |
131 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ | 138 V(_Int32x4, shuffle, Int32x4Shuffle, 599391160) \ |
132 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ | 139 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 1491641197) \ |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 M(MaterializeObject) \ | 733 M(MaterializeObject) \ |
727 M(Int32x4BoolConstructor) \ | 734 M(Int32x4BoolConstructor) \ |
728 M(Int32x4GetFlag) \ | 735 M(Int32x4GetFlag) \ |
729 M(Int32x4Select) \ | 736 M(Int32x4Select) \ |
730 M(Int32x4SetFlag) \ | 737 M(Int32x4SetFlag) \ |
731 M(Int32x4ToFloat32x4) \ | 738 M(Int32x4ToFloat32x4) \ |
732 M(BinaryInt32x4Op) \ | 739 M(BinaryInt32x4Op) \ |
733 M(TestSmi) \ | 740 M(TestSmi) \ |
734 M(BoxFloat64x2) \ | 741 M(BoxFloat64x2) \ |
735 M(UnboxFloat64x2) \ | 742 M(UnboxFloat64x2) \ |
| 743 M(BinaryFloat64x2Op) \ |
| 744 M(Float64x2Zero) \ |
| 745 M(Float64x2Constructor) \ |
| 746 M(Float64x2Splat) \ |
| 747 M(Float32x4ToFloat64x2) \ |
| 748 M(Float64x2ToFloat32x4) \ |
| 749 M(Simd64x2Shuffle) \ |
736 | 750 |
737 | 751 |
738 #define FORWARD_DECLARATION(type) class type##Instr; | 752 #define FORWARD_DECLARATION(type) class type##Instr; |
739 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) | 753 FOR_EACH_INSTRUCTION(FORWARD_DECLARATION) |
740 #undef FORWARD_DECLARATION | 754 #undef FORWARD_DECLARATION |
741 | 755 |
742 | 756 |
743 // Functions required in all concrete instruction classes. | 757 // Functions required in all concrete instruction classes. |
744 #define DECLARE_INSTRUCTION(type) \ | 758 #define DECLARE_INSTRUCTION(type) \ |
745 virtual Tag tag() const { return k##type; } \ | 759 virtual Tag tag() const { return k##type; } \ |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 friend class Simd32x4GetSignMaskInstr; | 1024 friend class Simd32x4GetSignMaskInstr; |
1011 friend class Float32x4ConstructorInstr; | 1025 friend class Float32x4ConstructorInstr; |
1012 friend class Float32x4ComparisonInstr; | 1026 friend class Float32x4ComparisonInstr; |
1013 friend class Float32x4MinMaxInstr; | 1027 friend class Float32x4MinMaxInstr; |
1014 friend class Float32x4ScaleInstr; | 1028 friend class Float32x4ScaleInstr; |
1015 friend class Float32x4SqrtInstr; | 1029 friend class Float32x4SqrtInstr; |
1016 friend class Float32x4ZeroArgInstr; | 1030 friend class Float32x4ZeroArgInstr; |
1017 friend class Float32x4ClampInstr; | 1031 friend class Float32x4ClampInstr; |
1018 friend class Float32x4WithInstr; | 1032 friend class Float32x4WithInstr; |
1019 friend class Float32x4ToInt32x4Instr; | 1033 friend class Float32x4ToInt32x4Instr; |
| 1034 friend class Simd64x2ShuffleInstr; |
| 1035 friend class Float32x4ToFloat64x2Instr; |
| 1036 friend class Float64x2ToFloat32x4Instr; |
| 1037 friend class Float64x2ZeroInstr; |
| 1038 friend class Float64x2SplatInstr; |
| 1039 friend class Float64x2ConstructorInstr; |
1020 friend class Int32x4BoolConstructorInstr; | 1040 friend class Int32x4BoolConstructorInstr; |
1021 friend class Int32x4GetFlagInstr; | 1041 friend class Int32x4GetFlagInstr; |
1022 friend class Int32x4SetFlagInstr; | 1042 friend class Int32x4SetFlagInstr; |
1023 friend class Int32x4SelectInstr; | 1043 friend class Int32x4SelectInstr; |
1024 friend class Int32x4ToFloat32x4Instr; | 1044 friend class Int32x4ToFloat32x4Instr; |
1025 friend class BinaryInt32x4OpInstr; | 1045 friend class BinaryInt32x4OpInstr; |
| 1046 friend class BinaryFloat64x2OpInstr; |
1026 friend class BinaryMintOpInstr; | 1047 friend class BinaryMintOpInstr; |
1027 friend class BinarySmiOpInstr; | 1048 friend class BinarySmiOpInstr; |
1028 friend class UnarySmiOpInstr; | 1049 friend class UnarySmiOpInstr; |
1029 friend class UnaryDoubleOpInstr; | 1050 friend class UnaryDoubleOpInstr; |
1030 friend class ShiftMintOpInstr; | 1051 friend class ShiftMintOpInstr; |
1031 friend class UnaryMintOpInstr; | 1052 friend class UnaryMintOpInstr; |
1032 friend class MathUnaryInstr; | 1053 friend class MathUnaryInstr; |
1033 friend class MathMinMaxInstr; | 1054 friend class MathMinMaxInstr; |
1034 friend class CheckClassInstr; | 1055 friend class CheckClassInstr; |
1035 friend class GuardFieldInstr; | 1056 friend class GuardFieldInstr; |
(...skipping 4660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5696 | 5717 |
5697 virtual bool MayThrow() const { return false; } | 5718 virtual bool MayThrow() const { return false; } |
5698 | 5719 |
5699 private: | 5720 private: |
5700 const MethodRecognizer::Kind op_kind_; | 5721 const MethodRecognizer::Kind op_kind_; |
5701 | 5722 |
5702 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); | 5723 DISALLOW_COPY_AND_ASSIGN(Float32x4WithInstr); |
5703 }; | 5724 }; |
5704 | 5725 |
5705 | 5726 |
| 5727 class Simd64x2ShuffleInstr : public TemplateDefinition<1> { |
| 5728 public: |
| 5729 Simd64x2ShuffleInstr(MethodRecognizer::Kind op_kind, Value* value, |
| 5730 intptr_t mask, |
| 5731 intptr_t deopt_id) |
| 5732 : op_kind_(op_kind), mask_(mask) { |
| 5733 SetInputAt(0, value); |
| 5734 deopt_id_ = deopt_id; |
| 5735 } |
| 5736 |
| 5737 Value* value() const { return inputs_[0]; } |
| 5738 |
| 5739 MethodRecognizer::Kind op_kind() const { return op_kind_; } |
| 5740 |
| 5741 intptr_t mask() const { return mask_; } |
| 5742 |
| 5743 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5744 |
| 5745 virtual bool CanDeoptimize() const { return false; } |
| 5746 |
| 5747 virtual Representation representation() const { |
| 5748 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) || |
| 5749 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) { |
| 5750 return kUnboxedDouble; |
| 5751 } |
| 5752 UNIMPLEMENTED(); |
| 5753 return kUnboxedDouble; |
| 5754 } |
| 5755 |
| 5756 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5757 ASSERT(idx == 0); |
| 5758 if ((op_kind_ == MethodRecognizer::kFloat64x2GetX) || |
| 5759 (op_kind_ == MethodRecognizer::kFloat64x2GetY)) { |
| 5760 return kUnboxedFloat64x2; |
| 5761 } |
| 5762 UNIMPLEMENTED(); |
| 5763 return kUnboxedFloat64x2; |
| 5764 } |
| 5765 |
| 5766 virtual intptr_t DeoptimizationTarget() const { |
| 5767 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5768 // was inherited from another instruction that could deoptimize. |
| 5769 return deopt_id_; |
| 5770 } |
| 5771 |
| 5772 DECLARE_INSTRUCTION(Simd64x2Shuffle) |
| 5773 virtual CompileType ComputeType() const; |
| 5774 |
| 5775 virtual bool AllowsCSE() const { return true; } |
| 5776 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5777 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5778 virtual bool AttributesEqual(Instruction* other) const { |
| 5779 return (op_kind() == other->AsSimd64x2Shuffle()->op_kind()) && |
| 5780 (mask() == other->AsSimd64x2Shuffle()->mask()); |
| 5781 } |
| 5782 |
| 5783 virtual bool MayThrow() const { return false; } |
| 5784 |
| 5785 private: |
| 5786 const MethodRecognizer::Kind op_kind_; |
| 5787 const intptr_t mask_; |
| 5788 |
| 5789 DISALLOW_COPY_AND_ASSIGN(Simd64x2ShuffleInstr); |
| 5790 }; |
| 5791 |
| 5792 |
5706 class Float32x4ToInt32x4Instr : public TemplateDefinition<1> { | 5793 class Float32x4ToInt32x4Instr : public TemplateDefinition<1> { |
5707 public: | 5794 public: |
5708 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) { | 5795 Float32x4ToInt32x4Instr(Value* left, intptr_t deopt_id) { |
5709 SetInputAt(0, left); | 5796 SetInputAt(0, left); |
5710 deopt_id_ = deopt_id; | 5797 deopt_id_ = deopt_id; |
5711 } | 5798 } |
5712 | 5799 |
5713 Value* left() const { return inputs_[0]; } | 5800 Value* left() const { return inputs_[0]; } |
5714 | 5801 |
5715 virtual void PrintOperandsTo(BufferFormatter* f) const; | 5802 virtual void PrintOperandsTo(BufferFormatter* f) const; |
(...skipping 23 matching lines...) Expand all Loading... |
5739 virtual EffectSet Dependencies() const { return EffectSet::None(); } | 5826 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
5740 virtual bool AttributesEqual(Instruction* other) const { return true; } | 5827 virtual bool AttributesEqual(Instruction* other) const { return true; } |
5741 | 5828 |
5742 virtual bool MayThrow() const { return false; } | 5829 virtual bool MayThrow() const { return false; } |
5743 | 5830 |
5744 private: | 5831 private: |
5745 DISALLOW_COPY_AND_ASSIGN(Float32x4ToInt32x4Instr); | 5832 DISALLOW_COPY_AND_ASSIGN(Float32x4ToInt32x4Instr); |
5746 }; | 5833 }; |
5747 | 5834 |
5748 | 5835 |
| 5836 class Float32x4ToFloat64x2Instr : public TemplateDefinition<1> { |
| 5837 public: |
| 5838 Float32x4ToFloat64x2Instr(Value* left, intptr_t deopt_id) { |
| 5839 SetInputAt(0, left); |
| 5840 deopt_id_ = deopt_id; |
| 5841 } |
| 5842 |
| 5843 Value* left() const { return inputs_[0]; } |
| 5844 |
| 5845 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5846 |
| 5847 virtual bool CanDeoptimize() const { return false; } |
| 5848 |
| 5849 virtual Representation representation() const { |
| 5850 return kUnboxedFloat64x2; |
| 5851 } |
| 5852 |
| 5853 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5854 ASSERT(idx == 0); |
| 5855 return kUnboxedFloat32x4; |
| 5856 } |
| 5857 |
| 5858 virtual intptr_t DeoptimizationTarget() const { |
| 5859 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5860 // was inherited from another instruction that could deoptimize. |
| 5861 return deopt_id_; |
| 5862 } |
| 5863 |
| 5864 DECLARE_INSTRUCTION(Float32x4ToFloat64x2) |
| 5865 virtual CompileType ComputeType() const; |
| 5866 |
| 5867 virtual bool AllowsCSE() const { return true; } |
| 5868 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5869 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5870 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 5871 |
| 5872 virtual bool MayThrow() const { return false; } |
| 5873 |
| 5874 private: |
| 5875 DISALLOW_COPY_AND_ASSIGN(Float32x4ToFloat64x2Instr); |
| 5876 }; |
| 5877 |
| 5878 |
| 5879 class Float64x2ToFloat32x4Instr : public TemplateDefinition<1> { |
| 5880 public: |
| 5881 Float64x2ToFloat32x4Instr(Value* left, intptr_t deopt_id) { |
| 5882 SetInputAt(0, left); |
| 5883 deopt_id_ = deopt_id; |
| 5884 } |
| 5885 |
| 5886 Value* left() const { return inputs_[0]; } |
| 5887 |
| 5888 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5889 |
| 5890 virtual bool CanDeoptimize() const { return false; } |
| 5891 |
| 5892 virtual Representation representation() const { |
| 5893 return kUnboxedFloat32x4; |
| 5894 } |
| 5895 |
| 5896 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5897 ASSERT(idx == 0); |
| 5898 return kUnboxedFloat64x2; |
| 5899 } |
| 5900 |
| 5901 virtual intptr_t DeoptimizationTarget() const { |
| 5902 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5903 // was inherited from another instruction that could deoptimize. |
| 5904 return deopt_id_; |
| 5905 } |
| 5906 |
| 5907 DECLARE_INSTRUCTION(Float64x2ToFloat32x4) |
| 5908 virtual CompileType ComputeType() const; |
| 5909 |
| 5910 virtual bool AllowsCSE() const { return true; } |
| 5911 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5912 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5913 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 5914 |
| 5915 virtual bool MayThrow() const { return false; } |
| 5916 |
| 5917 private: |
| 5918 DISALLOW_COPY_AND_ASSIGN(Float64x2ToFloat32x4Instr); |
| 5919 }; |
| 5920 |
| 5921 |
| 5922 class Float64x2ConstructorInstr : public TemplateDefinition<2> { |
| 5923 public: |
| 5924 Float64x2ConstructorInstr(Value* value0, Value* value1, intptr_t deopt_id) { |
| 5925 SetInputAt(0, value0); |
| 5926 SetInputAt(1, value1); |
| 5927 deopt_id_ = deopt_id; |
| 5928 } |
| 5929 |
| 5930 Value* value0() const { return inputs_[0]; } |
| 5931 Value* value1() const { return inputs_[1]; } |
| 5932 |
| 5933 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5934 |
| 5935 virtual bool CanDeoptimize() const { return false; } |
| 5936 |
| 5937 virtual Representation representation() const { |
| 5938 return kUnboxedFloat64x2; |
| 5939 } |
| 5940 |
| 5941 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5942 ASSERT(idx >= 0 && idx < 2); |
| 5943 return kUnboxedDouble; |
| 5944 } |
| 5945 |
| 5946 virtual intptr_t DeoptimizationTarget() const { |
| 5947 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5948 // was inherited from another instruction that could deoptimize. |
| 5949 return deopt_id_; |
| 5950 } |
| 5951 |
| 5952 DECLARE_INSTRUCTION(Float64x2Constructor) |
| 5953 virtual CompileType ComputeType() const; |
| 5954 |
| 5955 virtual bool AllowsCSE() const { return true; } |
| 5956 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 5957 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 5958 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 5959 |
| 5960 virtual bool MayThrow() const { return false; } |
| 5961 |
| 5962 private: |
| 5963 DISALLOW_COPY_AND_ASSIGN(Float64x2ConstructorInstr); |
| 5964 }; |
| 5965 |
| 5966 |
| 5967 class Float64x2SplatInstr : public TemplateDefinition<1> { |
| 5968 public: |
| 5969 Float64x2SplatInstr(Value* value, intptr_t deopt_id) { |
| 5970 SetInputAt(0, value); |
| 5971 deopt_id_ = deopt_id; |
| 5972 } |
| 5973 |
| 5974 Value* value() const { return inputs_[0]; } |
| 5975 |
| 5976 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 5977 |
| 5978 virtual bool CanDeoptimize() const { return false; } |
| 5979 |
| 5980 virtual Representation representation() const { |
| 5981 return kUnboxedFloat64x2; |
| 5982 } |
| 5983 |
| 5984 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 5985 ASSERT(idx == 0); |
| 5986 return kUnboxedDouble; |
| 5987 } |
| 5988 |
| 5989 virtual intptr_t DeoptimizationTarget() const { |
| 5990 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 5991 // was inherited from another instruction that could deoptimize. |
| 5992 return deopt_id_; |
| 5993 } |
| 5994 |
| 5995 DECLARE_INSTRUCTION(Float64x2Splat) |
| 5996 virtual CompileType ComputeType() const; |
| 5997 |
| 5998 virtual bool AllowsCSE() const { return true; } |
| 5999 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 6000 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 6001 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 6002 |
| 6003 virtual bool MayThrow() const { return false; } |
| 6004 |
| 6005 private: |
| 6006 DISALLOW_COPY_AND_ASSIGN(Float64x2SplatInstr); |
| 6007 }; |
| 6008 |
| 6009 |
| 6010 class Float64x2ZeroInstr : public TemplateDefinition<0> { |
| 6011 public: |
| 6012 explicit Float64x2ZeroInstr(intptr_t deopt_id) { |
| 6013 deopt_id_ = deopt_id; |
| 6014 } |
| 6015 |
| 6016 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 6017 |
| 6018 virtual bool CanDeoptimize() const { return false; } |
| 6019 |
| 6020 virtual Representation representation() const { |
| 6021 return kUnboxedFloat64x2; |
| 6022 } |
| 6023 |
| 6024 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 6025 UNIMPLEMENTED(); |
| 6026 return kUnboxedFloat64x2; |
| 6027 } |
| 6028 |
| 6029 virtual intptr_t DeoptimizationTarget() const { |
| 6030 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 6031 // was inherited from another instruction that could deoptimize. |
| 6032 return deopt_id_; |
| 6033 } |
| 6034 |
| 6035 DECLARE_INSTRUCTION(Float64x2Zero) |
| 6036 virtual CompileType ComputeType() const; |
| 6037 |
| 6038 virtual bool AllowsCSE() const { return true; } |
| 6039 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 6040 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 6041 virtual bool AttributesEqual(Instruction* other) const { return true; } |
| 6042 |
| 6043 virtual bool MayThrow() const { return false; } |
| 6044 |
| 6045 private: |
| 6046 DISALLOW_COPY_AND_ASSIGN(Float64x2ZeroInstr); |
| 6047 }; |
| 6048 |
| 6049 |
5749 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { | 6050 class Int32x4BoolConstructorInstr : public TemplateDefinition<4> { |
5750 public: | 6051 public: |
5751 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, | 6052 Int32x4BoolConstructorInstr(Value* value0, Value* value1, Value* value2, |
5752 Value* value3, intptr_t deopt_id) { | 6053 Value* value3, intptr_t deopt_id) { |
5753 SetInputAt(0, value0); | 6054 SetInputAt(0, value0); |
5754 SetInputAt(1, value1); | 6055 SetInputAt(1, value1); |
5755 SetInputAt(2, value2); | 6056 SetInputAt(2, value2); |
5756 SetInputAt(3, value3); | 6057 SetInputAt(3, value3); |
5757 deopt_id_ = deopt_id; | 6058 deopt_id_ = deopt_id; |
5758 } | 6059 } |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6098 } | 6399 } |
6099 | 6400 |
6100 virtual bool MayThrow() const { return false; } | 6401 virtual bool MayThrow() const { return false; } |
6101 | 6402 |
6102 private: | 6403 private: |
6103 const Token::Kind op_kind_; | 6404 const Token::Kind op_kind_; |
6104 | 6405 |
6105 DISALLOW_COPY_AND_ASSIGN(BinaryInt32x4OpInstr); | 6406 DISALLOW_COPY_AND_ASSIGN(BinaryInt32x4OpInstr); |
6106 }; | 6407 }; |
6107 | 6408 |
| 6409 |
| 6410 class BinaryFloat64x2OpInstr : public TemplateDefinition<2> { |
| 6411 public: |
| 6412 BinaryFloat64x2OpInstr(Token::Kind op_kind, |
| 6413 Value* left, |
| 6414 Value* right, |
| 6415 intptr_t deopt_id) |
| 6416 : op_kind_(op_kind) { |
| 6417 SetInputAt(0, left); |
| 6418 SetInputAt(1, right); |
| 6419 deopt_id_ = deopt_id; |
| 6420 } |
| 6421 |
| 6422 Value* left() const { return inputs_[0]; } |
| 6423 Value* right() const { return inputs_[1]; } |
| 6424 |
| 6425 Token::Kind op_kind() const { return op_kind_; } |
| 6426 |
| 6427 virtual bool CanDeoptimize() const { return false; } |
| 6428 |
| 6429 virtual Representation representation() const { |
| 6430 return kUnboxedFloat64x2; |
| 6431 } |
| 6432 |
| 6433 virtual Representation RequiredInputRepresentation(intptr_t idx) const { |
| 6434 ASSERT((idx == 0) || (idx == 1)); |
| 6435 return kUnboxedFloat64x2; |
| 6436 } |
| 6437 |
| 6438 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 6439 |
| 6440 virtual intptr_t DeoptimizationTarget() const { |
| 6441 // Direct access since this instruction cannot deoptimize, and the deopt-id |
| 6442 // was inherited from another instruction that could deoptimize. |
| 6443 return deopt_id_; |
| 6444 } |
| 6445 |
| 6446 DECLARE_INSTRUCTION(BinaryFloat64x2Op) |
| 6447 virtual CompileType ComputeType() const; |
| 6448 |
| 6449 virtual bool AllowsCSE() const { return true; } |
| 6450 virtual EffectSet Effects() const { return EffectSet::None(); } |
| 6451 virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| 6452 virtual bool AttributesEqual(Instruction* other) const { |
| 6453 ASSERT(other->IsBinaryFloat64x2Op()); |
| 6454 return op_kind() == other->AsBinaryFloat64x2Op()->op_kind(); |
| 6455 } |
| 6456 |
| 6457 virtual bool MayThrow() const { return false; } |
| 6458 |
| 6459 private: |
| 6460 const Token::Kind op_kind_; |
| 6461 |
| 6462 DISALLOW_COPY_AND_ASSIGN(BinaryFloat64x2OpInstr); |
| 6463 }; |
| 6464 |
| 6465 |
6108 class BinaryMintOpInstr : public TemplateDefinition<2> { | 6466 class BinaryMintOpInstr : public TemplateDefinition<2> { |
6109 public: | 6467 public: |
6110 BinaryMintOpInstr(Token::Kind op_kind, | 6468 BinaryMintOpInstr(Token::Kind op_kind, |
6111 Value* left, | 6469 Value* left, |
6112 Value* right, | 6470 Value* right, |
6113 intptr_t deopt_id) | 6471 intptr_t deopt_id) |
6114 : op_kind_(op_kind) { | 6472 : op_kind_(op_kind) { |
6115 SetInputAt(0, left); | 6473 SetInputAt(0, left); |
6116 SetInputAt(1, right); | 6474 SetInputAt(1, right); |
6117 // Override generated deopt-id. | 6475 // Override generated deopt-id. |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7183 ForwardInstructionIterator* current_iterator_; | 7541 ForwardInstructionIterator* current_iterator_; |
7184 | 7542 |
7185 private: | 7543 private: |
7186 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7544 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7187 }; | 7545 }; |
7188 | 7546 |
7189 | 7547 |
7190 } // namespace dart | 7548 } // namespace dart |
7191 | 7549 |
7192 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7550 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |