OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 V(LoadContextSlot) \ | 122 V(LoadContextSlot) \ |
123 V(LoadElements) \ | 123 V(LoadElements) \ |
124 V(LoadFunctionPrototype) \ | 124 V(LoadFunctionPrototype) \ |
125 V(LoadGlobal) \ | 125 V(LoadGlobal) \ |
126 V(LoadKeyedFastElement) \ | 126 V(LoadKeyedFastElement) \ |
127 V(LoadKeyedGeneric) \ | 127 V(LoadKeyedGeneric) \ |
128 V(LoadNamedField) \ | 128 V(LoadNamedField) \ |
129 V(LoadNamedGeneric) \ | 129 V(LoadNamedGeneric) \ |
130 V(Mod) \ | 130 V(Mod) \ |
131 V(Mul) \ | 131 V(Mul) \ |
132 V(Neg) \ | |
132 V(ObjectLiteral) \ | 133 V(ObjectLiteral) \ |
133 V(OsrEntry) \ | 134 V(OsrEntry) \ |
134 V(OuterContext) \ | 135 V(OuterContext) \ |
135 V(Parameter) \ | 136 V(Parameter) \ |
136 V(Power) \ | 137 V(Power) \ |
137 V(PushArgument) \ | 138 V(PushArgument) \ |
138 V(RegExpLiteral) \ | 139 V(RegExpLiteral) \ |
139 V(Return) \ | 140 V(Return) \ |
140 V(Sar) \ | 141 V(Sar) \ |
141 V(Shl) \ | 142 V(Shl) \ |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1347 } | 1348 } |
1348 virtual HType CalculateInferredType() const; | 1349 virtual HType CalculateInferredType() const; |
1349 | 1350 |
1350 DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not") | 1351 DECLARE_CONCRETE_INSTRUCTION(BitNot, "bit_not") |
1351 | 1352 |
1352 protected: | 1353 protected: |
1353 virtual bool DataEquals(HValue* other) const { return true; } | 1354 virtual bool DataEquals(HValue* other) const { return true; } |
1354 }; | 1355 }; |
1355 | 1356 |
1356 | 1357 |
1358 class HNeg: public HUnaryOperation { | |
1359 public: | |
1360 explicit HNeg(HValue* value) : HUnaryOperation(value) { | |
1361 set_representation(Representation::Tagged()); | |
1362 SetFlag(kFlexibleRepresentation); | |
1363 SetFlag(kCanOverflow); | |
1364 SetAllSideEffects(); | |
1365 } | |
1366 | |
1367 virtual void RepresentationChanged(Representation to) { | |
1368 if (!to.IsTagged()) { | |
Kevin Millikin (Chromium)
2011/02/11 12:12:59
This function always makes me nervous, because the
fschneider
2011/02/11 12:44:12
Done.
| |
1369 ClearAllSideEffects(); | |
1370 SetFlag(kUseGVN); | |
1371 } | |
1372 } | |
1373 | |
1374 virtual Representation RequiredInputRepresentation(int index) const { | |
1375 return representation(); | |
1376 } | |
1377 | |
1378 virtual HType CalculateInferredType() const; | |
1379 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | |
1380 virtual void PrintDataTo(StringStream* stream) const; | |
1381 DECLARE_CONCRETE_INSTRUCTION(Neg, "neg") | |
1382 | |
1383 protected: | |
1384 virtual bool DataEquals(HValue* other) const { return true; } | |
1385 virtual Range* InferRange(); | |
1386 }; | |
1387 | |
1388 | |
1357 class HUnaryMathOperation: public HUnaryOperation { | 1389 class HUnaryMathOperation: public HUnaryOperation { |
1358 public: | 1390 public: |
1359 HUnaryMathOperation(HValue* value, BuiltinFunctionId op) | 1391 HUnaryMathOperation(HValue* value, BuiltinFunctionId op) |
1360 : HUnaryOperation(value), op_(op) { | 1392 : HUnaryOperation(value), op_(op) { |
1361 switch (op) { | 1393 switch (op) { |
1362 case kMathFloor: | 1394 case kMathFloor: |
1363 case kMathRound: | 1395 case kMathRound: |
1364 case kMathCeil: | 1396 case kMathCeil: |
1365 set_representation(Representation::Integer32()); | 1397 set_representation(Representation::Integer32()); |
1366 break; | 1398 break; |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3194 HValue* object() const { return left(); } | 3226 HValue* object() const { return left(); } |
3195 HValue* key() const { return right(); } | 3227 HValue* key() const { return right(); } |
3196 }; | 3228 }; |
3197 | 3229 |
3198 #undef DECLARE_INSTRUCTION | 3230 #undef DECLARE_INSTRUCTION |
3199 #undef DECLARE_CONCRETE_INSTRUCTION | 3231 #undef DECLARE_CONCRETE_INSTRUCTION |
3200 | 3232 |
3201 } } // namespace v8::internal | 3233 } } // namespace v8::internal |
3202 | 3234 |
3203 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3235 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |