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

Unified Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 1219623004: VM: Fix issue with optimizing compiler's range analysis. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: removed outdated comments Created 5 years, 6 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_optimizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_range_analysis.cc
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index 59d2cd3b7a2ac9bfab319303f7a0c8997c61842f..5fec37b1652698d348c6fa134a6d66dde4b0f1e8 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -621,11 +621,10 @@ static RangeBoundary WidenMax(const Range* range,
static RangeBoundary NarrowMin(const Range* range,
const Range* new_range,
RangeBoundary::RangeSize size) {
-#ifdef DEBUG
const RangeBoundary min = Range::ConstantMin(range, size);
const RangeBoundary new_min = Range::ConstantMin(new_range, size);
- ASSERT(min.ConstantValue() <= new_min.ConstantValue());
-#endif
+ if (min.ConstantValue() > new_min.ConstantValue()) return range->min();
+
// TODO(vegorov): consider using negative infinity to indicate widened bound.
return range->min().IsMinimumOrBelow(size) ? new_range->min() : range->min();
}
@@ -640,11 +639,10 @@ static RangeBoundary NarrowMin(const Range* range,
static RangeBoundary NarrowMax(const Range* range,
const Range* new_range,
RangeBoundary::RangeSize size) {
-#ifdef DEBUG
const RangeBoundary max = Range::ConstantMax(range, size);
const RangeBoundary new_max = Range::ConstantMax(new_range, size);
- ASSERT(max.ConstantValue() >= new_max.ConstantValue());
-#endif
+ if (max.ConstantValue() < new_max.ConstantValue()) return range->max();
+
// TODO(vegorov): consider using positive infinity to indicate widened bound.
return range->max().IsMaximumOrAbove(size) ? new_range->max() : range->max();
}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698