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

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

Issue 10384027: Wrap block-informations when embedding them in the graph. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 7 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') | no next file » | 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 computeChangesFlags(graph); 775 computeChangesFlags(graph);
776 moveLoopInvariantCode(graph); 776 moveLoopInvariantCode(graph);
777 visitBasicBlock(graph.entry, new ValueSet()); 777 visitBasicBlock(graph.entry, new ValueSet());
778 } 778 }
779 779
780 void moveLoopInvariantCode(HGraph graph) { 780 void moveLoopInvariantCode(HGraph graph) {
781 for (int i = graph.blocks.length - 1; i >= 0; i--) { 781 for (int i = graph.blocks.length - 1; i >= 0; i--) {
782 HBasicBlock block = graph.blocks[i]; 782 HBasicBlock block = graph.blocks[i];
783 if (block.isLoopHeader()) { 783 if (block.isLoopHeader()) {
784 int changesFlags = loopChangesFlags[block.id]; 784 int changesFlags = loopChangesFlags[block.id];
785 HLoopInformation info = block.blockInformation; 785 HLoopInformation info = block.loopInformation;
786 HBasicBlock last = info.getLastBackEdge(); 786 HBasicBlock last = info.getLastBackEdge();
787 for (int j = block.id; j <= last.id; j++) { 787 for (int j = block.id; j <= last.id; j++) {
788 moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags); 788 moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags);
789 } 789 }
790 } 790 }
791 } 791 }
792 } 792 }
793 793
794 void moveLoopInvariantCodeFromBlock(HBasicBlock block, 794 void moveLoopInvariantCodeFromBlock(HBasicBlock block,
795 HBasicBlock loopHeader, 795 HBasicBlock loopHeader,
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 // the if block terminates. So any use of the instruction 1088 // the if block terminates. So any use of the instruction
1089 // after the join block should be changed to the new 1089 // after the join block should be changed to the new
1090 // instruction. 1090 // instruction.
1091 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); 1091 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType);
1092 } 1092 }
1093 // TODO(ngeoffray): Also change uses for the then block on a HType 1093 // TODO(ngeoffray): Also change uses for the then block on a HType
1094 // that knows it is not of a specific Type. 1094 // that knows it is not of a specific Type.
1095 } 1095 }
1096 } 1096 }
1097 } 1097 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698