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

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2149023002: VM: Array bounds checks that don't deoptimize for precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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 | « runtime/vm/aot_optimizer.h ('k') | runtime/vm/assembler_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 2d11dcef7996df9f29ff976acfd93d9e561116be..3d4b07fc13290aeb954feb1dc2e41883c50fb052 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -2748,4 +2748,26 @@ bool AotOptimizer::TryInlineInstanceSetter(InstanceCallInstr* instr,
}
+void AotOptimizer::ReplaceArrayBoundChecks() {
+ for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
+ !block_it.Done();
+ block_it.Advance()) {
+ ForwardInstructionIterator it(block_it.Current());
+ current_iterator_ = ⁢
+ for (; !it.Done(); it.Advance()) {
+ CheckArrayBoundInstr* check = it.Current()->AsCheckArrayBound();
+ if (check != NULL) {
+ GenericCheckBoundInstr* new_check = new(Z) GenericCheckBoundInstr(
+ new(Z) Value(check->length()->definition()),
+ new(Z) Value(check->index()->definition()),
+ check->deopt_id());
+ flow_graph_->InsertBefore(check, new_check,
+ check->env(), FlowGraph::kEffect);
+ current_iterator()->RemoveCurrentFromGraph();
+ }
+ }
+ }
+}
+
+
} // namespace dart
« no previous file with comments | « runtime/vm/aot_optimizer.h ('k') | runtime/vm/assembler_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698