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

Unified Diff: runtime/vm/flow_graph_range_analysis.h

Issue 2891113002: Use same range info when emitting code and computing if instruction can deopt. (Closed)
Patch Set: Add a comment to the test Created 3 years, 7 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
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_range_analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
};
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_range_analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698