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

Unified Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 2147363002: More guarding of code under #ifndef PRODUCT ... #endif (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix inadvertant change. Created 4 years, 5 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 | « no previous file | runtime/vm/isolate.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.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_;
« no previous file with comments | « no previous file | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698