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

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

Issue 11195042: Disable hoisting of checked-mode assertions out of loops. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/optimized_hoisting_checked_mode_assert.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 2317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 Instruction* current = it.Current(); 2328 Instruction* current = it.Current();
2329 if (!current->IsPushArgument() && !current->AffectedBySideEffect()) { 2329 if (!current->IsPushArgument() && !current->AffectedBySideEffect()) {
2330 bool inputs_loop_invariant = true; 2330 bool inputs_loop_invariant = true;
2331 for (int i = 0; i < current->InputCount(); ++i) { 2331 for (int i = 0; i < current->InputCount(); ++i) {
2332 Definition* input_def = current->InputAt(i)->definition(); 2332 Definition* input_def = current->InputAt(i)->definition();
2333 if (!input_def->GetBlock()->Dominates(pre_header)) { 2333 if (!input_def->GetBlock()->Dominates(pre_header)) {
2334 inputs_loop_invariant = false; 2334 inputs_loop_invariant = false;
2335 break; 2335 break;
2336 } 2336 }
2337 } 2337 }
2338 if (inputs_loop_invariant) { 2338 if (inputs_loop_invariant &&
2339 !current->IsAssertAssignable() &&
2340 !current->IsAssertBoolean()) {
2341 // TODO(fschneider): Enable hoisting of Assert-instructions
2342 // if it safe to do.
2339 Hoist(&it, pre_header, current); 2343 Hoist(&it, pre_header, current);
2340 } else if (current->IsCheckSmi() && 2344 } else if (current->IsCheckSmi() &&
2341 current->InputAt(0)->definition()->IsPhi()) { 2345 current->InputAt(0)->definition()->IsPhi()) {
2342 TryHoistCheckSmiThroughPhi( 2346 TryHoistCheckSmiThroughPhi(
2343 &it, header, pre_header, current->AsCheckSmi()); 2347 &it, header, pre_header, current->AsCheckSmi());
2344 } 2348 }
2345 } 2349 }
2346 } 2350 }
2347 } 2351 }
2348 } 2352 }
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
3338 3342
3339 if (FLAG_trace_constant_propagation) { 3343 if (FLAG_trace_constant_propagation) {
3340 OS::Print("\n==== After constant propagation ====\n"); 3344 OS::Print("\n==== After constant propagation ====\n");
3341 FlowGraphPrinter printer(*graph_); 3345 FlowGraphPrinter printer(*graph_);
3342 printer.PrintBlocks(); 3346 printer.PrintBlocks();
3343 } 3347 }
3344 } 3348 }
3345 3349
3346 3350
3347 } // namespace dart 3351 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/optimized_hoisting_checked_mode_assert.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698