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

Unified Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 1423063005: VM: Speculative inlining in precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 1 month 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') | runtime/vm/object.h » ('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 4e3eaaf8ed055943094297f7eb453d385267d73e..16cf90c4e8c42c056ace9b3a55e5e15f3101f6b4 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 {
@@ -1528,8 +1529,12 @@ class BoundsCheckGeneralizer {
void RangeAnalysis::EliminateRedundantBoundsChecks() {
if (FLAG_array_bounds_check_elimination) {
const Function& function = flow_graph_->function();
+ // Generalization only if we have not deoptimized on a generalized
+ // check earlier, or we're compiling precompiled code (no
+ // optimistic hoisting of checks possible)
const bool try_generalization =
- function.allows_bounds_check_generalization();
+ function.allows_bounds_check_generalization() &&
+ !Compiler::always_optimize();
BoundsCheckGeneralizer generalizer(this, flow_graph_);
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698