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

Side by Side Diff: lib/compiler/implementation/ssa/optimize.dart

Issue 9956172: Revert "Refactoring if block-information." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/utils/utils.status » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 interface OptimizationPhase { 5 interface OptimizationPhase {
6 String get name(); 6 String get name();
7 void visitGraph(HGraph graph); 7 void visitGraph(HGraph graph);
8 } 8 }
9 9
10 class SsaOptimizerTask extends CompilerTask { 10 class SsaOptimizerTask extends CompilerTask {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 computeChangesFlags(graph); 472 computeChangesFlags(graph);
473 moveLoopInvariantCode(graph); 473 moveLoopInvariantCode(graph);
474 visitBasicBlock(graph.entry, new ValueSet()); 474 visitBasicBlock(graph.entry, new ValueSet());
475 } 475 }
476 476
477 void moveLoopInvariantCode(HGraph graph) { 477 void moveLoopInvariantCode(HGraph graph) {
478 for (int i = graph.blocks.length - 1; i >= 0; i--) { 478 for (int i = graph.blocks.length - 1; i >= 0; i--) {
479 HBasicBlock block = graph.blocks[i]; 479 HBasicBlock block = graph.blocks[i];
480 if (block.isLoopHeader()) { 480 if (block.isLoopHeader()) {
481 int changesFlags = loopChangesFlags[block.id]; 481 int changesFlags = loopChangesFlags[block.id];
482 HLoopInformation info = block.blockInformation; 482 HBasicBlock last = block.loopInformation.getLastBackEdge();
483 HBasicBlock last = info.getLastBackEdge();
484 for (int j = block.id; j <= last.id; j++) { 483 for (int j = block.id; j <= last.id; j++) {
485 moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags); 484 moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags);
486 } 485 }
487 } 486 }
488 } 487 }
489 } 488 }
490 489
491 void moveLoopInvariantCodeFromBlock(HBasicBlock block, 490 void moveLoopInvariantCodeFromBlock(HBasicBlock block,
492 HBasicBlock loopHeader, 491 HBasicBlock loopHeader,
493 int changesFlags) { 492 int changesFlags) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 } 712 }
714 } 713 }
715 if (!canBeMoved) continue; 714 if (!canBeMoved) continue;
716 715
717 // This is safe because we are running after GVN. 716 // This is safe because we are running after GVN.
718 // TODO(ngeoffray): ensure GVN has been run. 717 // TODO(ngeoffray): ensure GVN has been run.
719 set_.add(current); 718 set_.add(current);
720 } 719 }
721 } 720 }
722 } 721 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | tests/utils/utils.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698