| 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 ddc2352aa26d96ea459898ea90140e4c3d817da5..1e7afbdc88715791c0133e7fc754bb8cccf92216 100644
|
| --- a/runtime/vm/flow_graph_range_analysis.cc
|
| +++ b/runtime/vm/flow_graph_range_analysis.cc
|
| @@ -1024,12 +1024,14 @@ class BoundsCheckGeneralizer {
|
| // range give up on generalization for simplicity.
|
| GrowableArray<Definition*> non_positive_symbols;
|
| if (!FindNonPositiveSymbols(&non_positive_symbols, upper_bound)) {
|
| +#ifndef PRODUCT
|
| if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
|
| THR_Print("Failed to generalize %s index to %s"
|
| " (can't ensure positivity)\n",
|
| check->ToCString(),
|
| IndexBoundToCString(upper_bound));
|
| }
|
| +#endif // !PRODUCT
|
| return;
|
| }
|
|
|
| @@ -1058,21 +1060,25 @@ class BoundsCheckGeneralizer {
|
| if (!RangeUtils::IsPositive(lower_bound->range())) {
|
| // Can't prove that lower bound is positive even with additional checks
|
| // against potentially non-positive symbols. Give up.
|
| +#ifndef PRODUCT
|
| if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
|
| THR_Print("Failed to generalize %s index to %s"
|
| " (lower bound is not positive)\n",
|
| check->ToCString(),
|
| IndexBoundToCString(upper_bound));
|
| }
|
| +#endif // !PRODUCT
|
| return;
|
| }
|
|
|
| +#ifndef PRODUCT
|
| if (FLAG_support_il_printer && FLAG_trace_range_analysis) {
|
| THR_Print("For %s computed index bounds [%s, %s]\n",
|
| check->ToCString(),
|
| IndexBoundToCString(lower_bound),
|
| IndexBoundToCString(upper_bound));
|
| }
|
| +#endif // !PRODUCT
|
|
|
| // At this point we know that 0 <= index < UpperBound(index) under
|
| // certain preconditions. Start by emitting this preconditions.
|
| @@ -1495,6 +1501,7 @@ class BoundsCheckGeneralizer {
|
| return defn;
|
| }
|
|
|
| +#ifndef PRODUCT
|
| static void PrettyPrintIndexBoundRecursively(BufferFormatter* f,
|
| Definition* index_bound) {
|
| BinarySmiOpInstr* binary_op = index_bound->AsBinarySmiOp();
|
| @@ -1520,6 +1527,7 @@ class BoundsCheckGeneralizer {
|
| PrettyPrintIndexBoundRecursively(&f, index_bound);
|
| return Thread::Current()->zone()->MakeCopyOfString(buffer);
|
| }
|
| +#endif // !PRODUCT
|
|
|
| RangeAnalysis* range_analysis_;
|
| FlowGraph* flow_graph_;
|
|
|