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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 V(MathExp) \ | 135 V(MathExp) \ |
136 V(MathFloor) \ | 136 V(MathFloor) \ |
137 V(MathFloorOfDiv) \ | 137 V(MathFloorOfDiv) \ |
138 V(MathLog) \ | 138 V(MathLog) \ |
139 V(MathMinMax) \ | 139 V(MathMinMax) \ |
140 V(MathPowHalf) \ | 140 V(MathPowHalf) \ |
141 V(MathRound) \ | 141 V(MathRound) \ |
142 V(MathSin) \ | 142 V(MathSin) \ |
143 V(MathSqrt) \ | 143 V(MathSqrt) \ |
144 V(MathTan) \ | 144 V(MathTan) \ |
| 145 V(NullarySIMDOperation) \ |
| 146 V(UnarySIMDOperation) \ |
| 147 V(BinarySIMDOperation) \ |
| 148 V(TernarySIMDOperation) \ |
| 149 V(QuarternarySIMDOperation) \ |
145 V(ModI) \ | 150 V(ModI) \ |
146 V(MulI) \ | 151 V(MulI) \ |
147 V(NumberTagD) \ | 152 V(NumberTagD) \ |
| 153 V(Float32x4ToTagged) \ |
| 154 V(Int32x4ToTagged) \ |
148 V(NumberTagI) \ | 155 V(NumberTagI) \ |
149 V(NumberTagU) \ | 156 V(NumberTagU) \ |
150 V(NumberUntagD) \ | 157 V(NumberUntagD) \ |
| 158 V(TaggedToFloat32x4) \ |
| 159 V(TaggedToInt32x4) \ |
151 V(OsrEntry) \ | 160 V(OsrEntry) \ |
152 V(OuterContext) \ | 161 V(OuterContext) \ |
153 V(Parameter) \ | 162 V(Parameter) \ |
154 V(Power) \ | 163 V(Power) \ |
155 V(PushArgument) \ | 164 V(PushArgument) \ |
156 V(RegExpLiteral) \ | 165 V(RegExpLiteral) \ |
157 V(Return) \ | 166 V(Return) \ |
158 V(SeqStringGetChar) \ | 167 V(SeqStringGetChar) \ |
159 V(SeqStringSetChar) \ | 168 V(SeqStringSetChar) \ |
160 V(ShiftI) \ | 169 V(ShiftI) \ |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 explicit LMathPowHalf(LOperand* value) { | 849 explicit LMathPowHalf(LOperand* value) { |
841 inputs_[0] = value; | 850 inputs_[0] = value; |
842 } | 851 } |
843 | 852 |
844 LOperand* value() { return inputs_[0]; } | 853 LOperand* value() { return inputs_[0]; } |
845 | 854 |
846 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") | 855 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
847 }; | 856 }; |
848 | 857 |
849 | 858 |
| 859 class LNullarySIMDOperation V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
| 860 public: |
| 861 explicit LNullarySIMDOperation(BuiltinFunctionId op) |
| 862 : op_(op) { |
| 863 } |
| 864 |
| 865 BuiltinFunctionId op() const { return op_; } |
| 866 |
| 867 virtual Opcode opcode() const V8_OVERRIDE { |
| 868 return LInstruction::kNullarySIMDOperation; |
| 869 } |
| 870 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
| 871 virtual const char* Mnemonic() const V8_OVERRIDE; |
| 872 static LNullarySIMDOperation* cast(LInstruction* instr) { |
| 873 ASSERT(instr->IsNullarySIMDOperation()); |
| 874 return reinterpret_cast<LNullarySIMDOperation*>(instr); |
| 875 } |
| 876 |
| 877 DECLARE_HYDROGEN_ACCESSOR(NullarySIMDOperation) |
| 878 |
| 879 private: |
| 880 BuiltinFunctionId op_; |
| 881 }; |
| 882 |
| 883 |
| 884 class LUnarySIMDOperation V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 885 public: |
| 886 LUnarySIMDOperation(LOperand* value, BuiltinFunctionId op) |
| 887 : op_(op) { |
| 888 inputs_[0] = value; |
| 889 } |
| 890 |
| 891 LOperand* value() { return inputs_[0]; } |
| 892 BuiltinFunctionId op() const { return op_; } |
| 893 |
| 894 virtual Opcode opcode() const V8_OVERRIDE { |
| 895 return LInstruction::kUnarySIMDOperation; |
| 896 } |
| 897 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
| 898 virtual const char* Mnemonic() const V8_OVERRIDE; |
| 899 static LUnarySIMDOperation* cast(LInstruction* instr) { |
| 900 ASSERT(instr->IsUnarySIMDOperation()); |
| 901 return reinterpret_cast<LUnarySIMDOperation*>(instr); |
| 902 } |
| 903 |
| 904 DECLARE_HYDROGEN_ACCESSOR(UnarySIMDOperation) |
| 905 |
| 906 private: |
| 907 BuiltinFunctionId op_; |
| 908 }; |
| 909 |
| 910 |
| 911 class LBinarySIMDOperation V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
| 912 public: |
| 913 LBinarySIMDOperation(LOperand* left, LOperand* right, BuiltinFunctionId op) |
| 914 : op_(op) { |
| 915 inputs_[0] = left; |
| 916 inputs_[1] = right; |
| 917 } |
| 918 |
| 919 LOperand* left() { return inputs_[0]; } |
| 920 LOperand* right() { return inputs_[1]; } |
| 921 BuiltinFunctionId op() const { return op_; } |
| 922 |
| 923 virtual Opcode opcode() const V8_OVERRIDE { |
| 924 return LInstruction::kBinarySIMDOperation; |
| 925 } |
| 926 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
| 927 virtual const char* Mnemonic() const V8_OVERRIDE; |
| 928 static LBinarySIMDOperation* cast(LInstruction* instr) { |
| 929 ASSERT(instr->IsBinarySIMDOperation()); |
| 930 return reinterpret_cast<LBinarySIMDOperation*>(instr); |
| 931 } |
| 932 |
| 933 DECLARE_HYDROGEN_ACCESSOR(BinarySIMDOperation) |
| 934 |
| 935 private: |
| 936 BuiltinFunctionId op_; |
| 937 }; |
| 938 |
| 939 |
| 940 class LTernarySIMDOperation V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
| 941 public: |
| 942 LTernarySIMDOperation(LOperand* first, LOperand* second, LOperand* third, |
| 943 BuiltinFunctionId op) |
| 944 : op_(op) { |
| 945 inputs_[0] = first; |
| 946 inputs_[1] = second; |
| 947 inputs_[2] = third; |
| 948 } |
| 949 |
| 950 LOperand* first() { return inputs_[0]; } |
| 951 LOperand* second() { return inputs_[1]; } |
| 952 LOperand* third() { return inputs_[2]; } |
| 953 BuiltinFunctionId op() const { return op_; } |
| 954 |
| 955 virtual Opcode opcode() const V8_OVERRIDE { |
| 956 return LInstruction::kTernarySIMDOperation; |
| 957 } |
| 958 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
| 959 virtual const char* Mnemonic() const V8_OVERRIDE; |
| 960 static LTernarySIMDOperation* cast(LInstruction* instr) { |
| 961 ASSERT(instr->IsTernarySIMDOperation()); |
| 962 return reinterpret_cast<LTernarySIMDOperation*>(instr); |
| 963 } |
| 964 |
| 965 DECLARE_HYDROGEN_ACCESSOR(TernarySIMDOperation) |
| 966 |
| 967 private: |
| 968 BuiltinFunctionId op_; |
| 969 }; |
| 970 |
| 971 |
| 972 class LQuarternarySIMDOperation V8_FINAL |
| 973 : public LTemplateInstruction<1, 4, 0> { |
| 974 public: |
| 975 LQuarternarySIMDOperation(LOperand* x, LOperand* y, LOperand* z, |
| 976 LOperand* w, BuiltinFunctionId op) |
| 977 : op_(op) { |
| 978 inputs_[0] = x; |
| 979 inputs_[1] = y; |
| 980 inputs_[2] = z; |
| 981 inputs_[3] = w; |
| 982 } |
| 983 |
| 984 LOperand* x() { return inputs_[0]; } |
| 985 LOperand* y() { return inputs_[1]; } |
| 986 LOperand* z() { return inputs_[2]; } |
| 987 LOperand* w() { return inputs_[3]; } |
| 988 BuiltinFunctionId op() const { return op_; } |
| 989 |
| 990 virtual Opcode opcode() const V8_OVERRIDE { |
| 991 return LInstruction::kQuarternarySIMDOperation; |
| 992 } |
| 993 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
| 994 virtual const char* Mnemonic() const V8_OVERRIDE; |
| 995 static LQuarternarySIMDOperation* cast(LInstruction* instr) { |
| 996 ASSERT(instr->IsQuarternarySIMDOperation()); |
| 997 return reinterpret_cast<LQuarternarySIMDOperation*>(instr); |
| 998 } |
| 999 |
| 1000 DECLARE_HYDROGEN_ACCESSOR(QuarternarySIMDOperation) |
| 1001 |
| 1002 private: |
| 1003 BuiltinFunctionId op_; |
| 1004 }; |
| 1005 |
| 1006 |
850 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> { | 1007 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> { |
851 public: | 1008 public: |
852 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 1009 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
853 inputs_[0] = left; | 1010 inputs_[0] = left; |
854 inputs_[1] = right; | 1011 inputs_[1] = right; |
855 } | 1012 } |
856 | 1013 |
857 LOperand* left() { return inputs_[0]; } | 1014 LOperand* left() { return inputs_[0]; } |
858 LOperand* right() { return inputs_[1]; } | 1015 LOperand* right() { return inputs_[1]; } |
859 | 1016 |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 } | 2240 } |
2084 | 2241 |
2085 LOperand* value() { return inputs_[0]; } | 2242 LOperand* value() { return inputs_[0]; } |
2086 LOperand* temp() { return temps_[0]; } | 2243 LOperand* temp() { return temps_[0]; } |
2087 | 2244 |
2088 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 2245 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
2089 DECLARE_HYDROGEN_ACCESSOR(Change) | 2246 DECLARE_HYDROGEN_ACCESSOR(Change) |
2090 }; | 2247 }; |
2091 | 2248 |
2092 | 2249 |
| 2250 class LFloat32x4ToTagged V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2251 public: |
| 2252 explicit LFloat32x4ToTagged(LOperand* value, LOperand* temp) { |
| 2253 inputs_[0] = value; |
| 2254 temps_[0] = temp; |
| 2255 } |
| 2256 |
| 2257 LOperand* value() { return inputs_[0]; } |
| 2258 LOperand* temp() { return temps_[0]; } |
| 2259 |
| 2260 DECLARE_CONCRETE_INSTRUCTION(Float32x4ToTagged, "float32x4-tag") |
| 2261 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2262 }; |
| 2263 |
| 2264 |
| 2265 class LInt32x4ToTagged V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2266 public: |
| 2267 explicit LInt32x4ToTagged(LOperand* value, LOperand* temp) { |
| 2268 inputs_[0] = value; |
| 2269 temps_[0] = temp; |
| 2270 } |
| 2271 |
| 2272 LOperand* value() { return inputs_[0]; } |
| 2273 LOperand* temp() { return temps_[0]; } |
| 2274 |
| 2275 DECLARE_CONCRETE_INSTRUCTION(Int32x4ToTagged, "int32x4-tag") |
| 2276 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2277 }; |
| 2278 |
| 2279 |
2093 // Sometimes truncating conversion from a tagged value to an int32. | 2280 // Sometimes truncating conversion from a tagged value to an int32. |
2094 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2281 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2095 public: | 2282 public: |
2096 explicit LDoubleToI(LOperand* value) { | 2283 explicit LDoubleToI(LOperand* value) { |
2097 inputs_[0] = value; | 2284 inputs_[0] = value; |
2098 } | 2285 } |
2099 | 2286 |
2100 LOperand* value() { return inputs_[0]; } | 2287 LOperand* value() { return inputs_[0]; } |
2101 | 2288 |
2102 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 2289 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 inputs_[0] = value; | 2342 inputs_[0] = value; |
2156 } | 2343 } |
2157 | 2344 |
2158 LOperand* value() { return inputs_[0]; } | 2345 LOperand* value() { return inputs_[0]; } |
2159 | 2346 |
2160 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 2347 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
2161 DECLARE_HYDROGEN_ACCESSOR(Change); | 2348 DECLARE_HYDROGEN_ACCESSOR(Change); |
2162 }; | 2349 }; |
2163 | 2350 |
2164 | 2351 |
| 2352 class LTaggedToFloat32x4 V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2353 public: |
| 2354 explicit LTaggedToFloat32x4(LOperand* value) { |
| 2355 inputs_[0] = value; |
| 2356 } |
| 2357 |
| 2358 LOperand* value() { return inputs_[0]; } |
| 2359 |
| 2360 DECLARE_CONCRETE_INSTRUCTION(TaggedToFloat32x4, "float32x4-untag") |
| 2361 DECLARE_HYDROGEN_ACCESSOR(Change); |
| 2362 }; |
| 2363 |
| 2364 |
| 2365 class LTaggedToInt32x4 V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2366 public: |
| 2367 explicit LTaggedToInt32x4(LOperand* value) { |
| 2368 inputs_[0] = value; |
| 2369 } |
| 2370 |
| 2371 LOperand* value() { return inputs_[0]; } |
| 2372 |
| 2373 DECLARE_CONCRETE_INSTRUCTION(TaggedToInt32x4, "int32x4-untag") |
| 2374 DECLARE_HYDROGEN_ACCESSOR(Change); |
| 2375 }; |
| 2376 |
| 2377 |
2165 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2378 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2166 public: | 2379 public: |
2167 LSmiUntag(LOperand* value, bool needs_check) | 2380 LSmiUntag(LOperand* value, bool needs_check) |
2168 : needs_check_(needs_check) { | 2381 : needs_check_(needs_check) { |
2169 inputs_[0] = value; | 2382 inputs_[0] = value; |
2170 } | 2383 } |
2171 | 2384 |
2172 LOperand* value() { return inputs_[0]; } | 2385 LOperand* value() { return inputs_[0]; } |
2173 bool needs_check() const { return needs_check_; } | 2386 bool needs_check() const { return needs_check_; } |
2174 | 2387 |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 | 3056 |
2844 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3057 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2845 }; | 3058 }; |
2846 | 3059 |
2847 #undef DECLARE_HYDROGEN_ACCESSOR | 3060 #undef DECLARE_HYDROGEN_ACCESSOR |
2848 #undef DECLARE_CONCRETE_INSTRUCTION | 3061 #undef DECLARE_CONCRETE_INSTRUCTION |
2849 | 3062 |
2850 } } // namespace v8::int | 3063 } } // namespace v8::int |
2851 | 3064 |
2852 #endif // V8_X64_LITHIUM_X64_H_ | 3065 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |