Index: runtime/vm/flow_graph_range_analysis.h |
diff --git a/runtime/vm/flow_graph_range_analysis.h b/runtime/vm/flow_graph_range_analysis.h |
index 8dce8de72880c2b8c1b85901225893bb333166d8..6690e18268e23830d5a110e8947c9943883d564c 100644 |
--- a/runtime/vm/flow_graph_range_analysis.h |
+++ b/runtime/vm/flow_graph_range_analysis.h |
@@ -396,6 +396,9 @@ class Range : public ZoneAllocated { |
// Clamp this to be within size. |
void Clamp(RangeBoundary::RangeSize size); |
+ // Clamp this to be within size and eliminate symbols. |
+ void ClampToConstant(RangeBoundary::RangeSize size); |
+ |
static void Add(const Range* left_range, |
const Range* right_range, |
RangeBoundary* min, |
@@ -469,6 +472,16 @@ class RangeUtils : public AllStatic { |
static bool IsPositive(Range* range) { |
return !Range::IsUnknown(range) && range->IsPositive(); |
} |
+ |
+ static bool Overlaps(Range* range, intptr_t min, intptr_t max) { |
+ return Range::IsUnknown(range) || range->Overlaps(min, max); |
+ } |
+ |
+ static bool CanBeZero(Range* range) { return Overlaps(range, 0, 0); } |
+ |
+ static bool OnlyLessThanOrEqualTo(Range* range, intptr_t value) { |
+ return !Range::IsUnknown(range) && range->OnlyLessThanOrEqualTo(value); |
+ } |
}; |