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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/aot_optimizer.h ('k') | runtime/vm/assembler_arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/aot_optimizer.h" 5 #include "vm/aot_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/branch_optimizer.h" 8 #include "vm/branch_optimizer.h"
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2741 ASSERT(!store->IsUnboxedStore()); 2741 ASSERT(!store->IsUnboxedStore());
2742 2742
2743 // Discard the environment from the original instruction because the store 2743 // Discard the environment from the original instruction because the store
2744 // can't deoptimize. 2744 // can't deoptimize.
2745 instr->RemoveEnvironment(); 2745 instr->RemoveEnvironment();
2746 ReplaceCall(instr, store); 2746 ReplaceCall(instr, store);
2747 return true; 2747 return true;
2748 } 2748 }
2749 2749
2750 2750
2751 void AotOptimizer::ReplaceArrayBoundChecks() {
2752 for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
2753 !block_it.Done();
2754 block_it.Advance()) {
2755 ForwardInstructionIterator it(block_it.Current());
2756 current_iterator_ = ⁢
2757 for (; !it.Done(); it.Advance()) {
2758 CheckArrayBoundInstr* check = it.Current()->AsCheckArrayBound();
2759 if (check != NULL) {
2760 GenericCheckBoundInstr* new_check = new(Z) GenericCheckBoundInstr(
2761 new(Z) Value(check->length()->definition()),
2762 new(Z) Value(check->index()->definition()),
2763 check->deopt_id());
2764 flow_graph_->InsertBefore(check, new_check,
2765 check->env(), FlowGraph::kEffect);
2766 current_iterator()->RemoveCurrentFromGraph();
2767 }
2768 }
2769 }
2770 }
2771
2772
2751 } // namespace dart 2773 } // namespace dart
OLDNEW
« 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