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

Side by Side Diff: runtime/vm/aot_optimizer.cc

Issue 2152683003: Revert "VM: Array bounds checks that don't deoptimize for precompiled code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 ASSERT(!store->IsUnboxedStore()); 2736 ASSERT(!store->IsUnboxedStore());
2737 2737
2738 // Discard the environment from the original instruction because the store 2738 // Discard the environment from the original instruction because the store
2739 // can't deoptimize. 2739 // can't deoptimize.
2740 instr->RemoveEnvironment(); 2740 instr->RemoveEnvironment();
2741 ReplaceCall(instr, store); 2741 ReplaceCall(instr, store);
2742 return true; 2742 return true;
2743 } 2743 }
2744 2744
2745 2745
2746 void AotOptimizer::ReplaceArrayBoundChecks() {
2747 for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
2748 !block_it.Done();
2749 block_it.Advance()) {
2750 ForwardInstructionIterator it(block_it.Current());
2751 current_iterator_ = ⁢
2752 for (; !it.Done(); it.Advance()) {
2753 CheckArrayBoundInstr* check = it.Current()->AsCheckArrayBound();
2754 if (check != NULL) {
2755 GenericCheckBoundInstr* new_check = new(Z) GenericCheckBoundInstr(
2756 new(Z) Value(check->length()->definition()),
2757 new(Z) Value(check->index()->definition()),
2758 check->deopt_id());
2759 flow_graph_->InsertBefore(check, new_check,
2760 check->env(), FlowGraph::kEffect);
2761 current_iterator()->RemoveCurrentFromGraph();
2762 }
2763 }
2764 }
2765 }
2766
2767
2768 } // namespace dart 2746 } // 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