Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 2b9dbf2bb68f1f92a0ea43e5eaff012478298101..c79db8d52c17925ef0ee125629ba13e3a7e94843 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -1039,7 +1039,13 @@ class HValue: public ZoneObject { |
} |
Range* range() const { return range_; } |
+ // We should really use the null object pattern here... |
Jakob Kummerow
2013/06/07 16:50:07
nit: I don't think this comment adds value.
Sven Panne
2013/06/10 11:05:39
I'll change this into a real TODO then, code like
|
bool HasRange() const { return range_ != NULL; } |
+ bool CanBeNegative() const { return !HasRange() || range()->CanBeNegative(); } |
+ bool CanBeZero() const { return !HasRange() || range()->CanBeZero(); } |
+ bool RangeCanInclude(int value) const { |
+ return !HasRange() || range()->Includes(value); |
+ } |
void AddNewRange(Range* r, Zone* zone); |
void RemoveLastAddedRange(); |
void ComputeInitialRange(Zone* zone); |