Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 813e43dbac9926146b80361a7d8f5e0430fe720e..fc2a20037b8e956fbcb25cfbd190b80843f99535 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -1039,7 +1039,13 @@ class HValue: public ZoneObject { |
} |
Range* range() const { return range_; } |
+ // TODO(svenpanne) We should really use the null object pattern here. |
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); |