OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // HShl | 70 // HShl |
71 // HShr | 71 // HShr |
72 // HBoundsCheck | 72 // HBoundsCheck |
73 // HCompare | 73 // HCompare |
74 // HCompareJSObjectEq | 74 // HCompareJSObjectEq |
75 // HInstanceOf | 75 // HInstanceOf |
76 // HLoadKeyed | 76 // HLoadKeyed |
77 // HLoadKeyedFastElement | 77 // HLoadKeyedFastElement |
78 // HLoadKeyedGeneric | 78 // HLoadKeyedGeneric |
79 // HLoadNamedGeneric | 79 // HLoadNamedGeneric |
80 // HPower | |
81 // HStoreNamed | 80 // HStoreNamed |
82 // HStoreNamedField | 81 // HStoreNamedField |
83 // HStoreNamedGeneric | 82 // HStoreNamedGeneric |
84 // HBlockEntry | 83 // HBlockEntry |
85 // HCall | 84 // HCall |
86 // HCallConstantFunction | 85 // HCallConstantFunction |
87 // HCallFunction | 86 // HCallFunction |
88 // HCallGlobal | 87 // HCallGlobal |
89 // HCallKeyed | 88 // HCallKeyed |
90 // HCallKnownGlobal | 89 // HCallKnownGlobal |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 V(LoadGlobal) \ | 216 V(LoadGlobal) \ |
218 V(LoadKeyedFastElement) \ | 217 V(LoadKeyedFastElement) \ |
219 V(LoadKeyedGeneric) \ | 218 V(LoadKeyedGeneric) \ |
220 V(LoadNamedField) \ | 219 V(LoadNamedField) \ |
221 V(LoadNamedGeneric) \ | 220 V(LoadNamedGeneric) \ |
222 V(Mod) \ | 221 V(Mod) \ |
223 V(Mul) \ | 222 V(Mul) \ |
224 V(ObjectLiteral) \ | 223 V(ObjectLiteral) \ |
225 V(OsrEntry) \ | 224 V(OsrEntry) \ |
226 V(Parameter) \ | 225 V(Parameter) \ |
227 V(Power) \ | |
228 V(PushArgument) \ | 226 V(PushArgument) \ |
229 V(RegExpLiteral) \ | 227 V(RegExpLiteral) \ |
230 V(Return) \ | 228 V(Return) \ |
231 V(Sar) \ | 229 V(Sar) \ |
232 V(Shl) \ | 230 V(Shl) \ |
233 V(Shr) \ | 231 V(Shr) \ |
234 V(Simulate) \ | 232 V(Simulate) \ |
235 V(StackCheck) \ | 233 V(StackCheck) \ |
236 V(StoreGlobal) \ | 234 V(StoreGlobal) \ |
237 V(StoreKeyedFastElement) \ | 235 V(StoreKeyedFastElement) \ |
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 case kMathFloor: | 1370 case kMathFloor: |
1373 case kMathRound: | 1371 case kMathRound: |
1374 case kMathCeil: | 1372 case kMathCeil: |
1375 set_representation(Representation::Integer32()); | 1373 set_representation(Representation::Integer32()); |
1376 break; | 1374 break; |
1377 case kMathAbs: | 1375 case kMathAbs: |
1378 set_representation(Representation::Tagged()); | 1376 set_representation(Representation::Tagged()); |
1379 SetFlag(kFlexibleRepresentation); | 1377 SetFlag(kFlexibleRepresentation); |
1380 break; | 1378 break; |
1381 case kMathSqrt: | 1379 case kMathSqrt: |
1382 case kMathPowHalf: | |
1383 default: | 1380 default: |
1384 set_representation(Representation::Double()); | 1381 set_representation(Representation::Double()); |
1385 } | 1382 } |
1386 SetFlag(kUseGVN); | 1383 SetFlag(kUseGVN); |
1387 } | 1384 } |
1388 | 1385 |
1389 virtual void PrintDataTo(StringStream* stream) const; | 1386 virtual void PrintDataTo(StringStream* stream) const; |
1390 | 1387 |
1391 virtual HType CalculateInferredType() const; | 1388 virtual HType CalculateInferredType() const; |
1392 | 1389 |
1393 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 1390 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
1394 | 1391 |
1395 virtual Representation RequiredInputRepresentation(int index) const { | 1392 virtual Representation RequiredInputRepresentation(int index) const { |
1396 switch (op_) { | 1393 switch (op_) { |
1397 case kMathFloor: | 1394 case kMathFloor: |
1398 case kMathRound: | 1395 case kMathRound: |
1399 case kMathCeil: | 1396 case kMathCeil: |
1400 case kMathSqrt: | 1397 case kMathSqrt: |
1401 case kMathPowHalf: | |
1402 return Representation::Double(); | 1398 return Representation::Double(); |
1403 break; | 1399 break; |
1404 case kMathAbs: | 1400 case kMathAbs: |
1405 return representation(); | 1401 return representation(); |
1406 break; | 1402 break; |
1407 default: | 1403 default: |
1408 return Representation::None(); | 1404 return Representation::None(); |
1409 } | 1405 } |
1410 } | 1406 } |
1411 | 1407 |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 virtual bool EmitAtUses() const { return uses()->length() <= 1; } | 2177 virtual bool EmitAtUses() const { return uses()->length() <= 1; } |
2182 | 2178 |
2183 virtual Representation RequiredInputRepresentation(int index) const { | 2179 virtual Representation RequiredInputRepresentation(int index) const { |
2184 return Representation::Tagged(); | 2180 return Representation::Tagged(); |
2185 } | 2181 } |
2186 | 2182 |
2187 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") | 2183 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") |
2188 }; | 2184 }; |
2189 | 2185 |
2190 | 2186 |
2191 class HPower: public HBinaryOperation { | |
2192 public: | |
2193 HPower(HValue* left, HValue* right) | |
2194 : HBinaryOperation(left, right) { | |
2195 set_representation(Representation::Double()); | |
2196 SetFlag(kUseGVN); | |
2197 } | |
2198 | |
2199 virtual Representation RequiredInputRepresentation(int index) const { | |
2200 return (index == 1) ? Representation::None() : Representation::Double(); | |
2201 } | |
2202 | |
2203 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | |
2204 }; | |
2205 | |
2206 | |
2207 class HAdd: public HArithmeticBinaryOperation { | 2187 class HAdd: public HArithmeticBinaryOperation { |
2208 public: | 2188 public: |
2209 HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) { | 2189 HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) { |
2210 SetFlag(kCanOverflow); | 2190 SetFlag(kCanOverflow); |
2211 } | 2191 } |
2212 | 2192 |
2213 // Add is only commutative if two integer values are added and not if two | 2193 // Add is only commutative if two integer values are added and not if two |
2214 // tagged values are added (because it might be a String concatenation). | 2194 // tagged values are added (because it might be a String concatenation). |
2215 virtual bool IsCommutative() const { | 2195 virtual bool IsCommutative() const { |
2216 return !representation().IsTagged(); | 2196 return !representation().IsTagged(); |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 HValue* object() const { return left(); } | 2876 HValue* object() const { return left(); } |
2897 HValue* key() const { return right(); } | 2877 HValue* key() const { return right(); } |
2898 }; | 2878 }; |
2899 | 2879 |
2900 #undef DECLARE_INSTRUCTION | 2880 #undef DECLARE_INSTRUCTION |
2901 #undef DECLARE_CONCRETE_INSTRUCTION | 2881 #undef DECLARE_CONCRETE_INSTRUCTION |
2902 | 2882 |
2903 } } // namespace v8::internal | 2883 } } // namespace v8::internal |
2904 | 2884 |
2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 2885 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |