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 4e3eaaf8ed055943094297f7eb453d385267d73e..cfa01036854d145f060ea31eb0524b360886882f 100644 |
--- a/runtime/vm/flow_graph_range_analysis.cc |
+++ b/runtime/vm/flow_graph_range_analysis.cc |
@@ -5,6 +5,7 @@ |
#include "vm/flow_graph_range_analysis.h" |
#include "vm/bit_vector.h" |
+#include "vm/compiler.h" |
#include "vm/il_printer.h" |
namespace dart { |
@@ -1529,7 +1530,8 @@ void RangeAnalysis::EliminateRedundantBoundsChecks() { |
if (FLAG_array_bounds_check_elimination) { |
const Function& function = flow_graph_->function(); |
const bool try_generalization = |
- function.allows_bounds_check_generalization(); |
+ function.allows_bounds_check_generalization() && |
+ !Compiler::always_optimize(); |
srdjan
2015/11/17 17:35:24
Please add a comment why we should not try_general
Florian Schneider
2015/11/17 19:38:57
Done.
|
BoundsCheckGeneralizer generalizer(this, flow_graph_); |