Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| =================================================================== |
| --- src/hydrogen-instructions.h (revision 6698) |
| +++ src/hydrogen-instructions.h (working copy) |
| @@ -129,6 +129,7 @@ |
| V(LoadNamedGeneric) \ |
| V(Mod) \ |
| V(Mul) \ |
| + V(Neg) \ |
| V(ObjectLiteral) \ |
| V(OsrEntry) \ |
| V(OuterContext) \ |
| @@ -1354,6 +1355,37 @@ |
| }; |
| +class HNeg: public HUnaryOperation { |
| + public: |
| + explicit HNeg(HValue* value) : HUnaryOperation(value) { |
| + set_representation(Representation::Tagged()); |
| + SetFlag(kFlexibleRepresentation); |
| + SetFlag(kCanOverflow); |
| + SetAllSideEffects(); |
| + } |
| + |
| + virtual void RepresentationChanged(Representation to) { |
| + 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.
|
| + ClearAllSideEffects(); |
| + SetFlag(kUseGVN); |
| + } |
| + } |
| + |
| + virtual Representation RequiredInputRepresentation(int index) const { |
| + return representation(); |
| + } |
| + |
| + virtual HType CalculateInferredType() const; |
| + virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
| + virtual void PrintDataTo(StringStream* stream) const; |
| + DECLARE_CONCRETE_INSTRUCTION(Neg, "neg") |
| + |
| + protected: |
| + virtual bool DataEquals(HValue* other) const { return true; } |
| + virtual Range* InferRange(); |
| +}; |
| + |
| + |
| class HUnaryMathOperation: public HUnaryOperation { |
| public: |
| HUnaryMathOperation(HValue* value, BuiltinFunctionId op) |