Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: src/hydrogen-instructions.h

Issue 6461021: Add a genuine unary minus instruction to Crankshaft.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | src/ia32/lithium-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698