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

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

Issue 10520003: Use short-hand update syntax for simple updating definitions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address more comments. Created 8 years, 6 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/codegen.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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 values = new List<ValueSet>(graph.blocks.length); 993 values = new List<ValueSet>(graph.blocks.length);
994 for (int i = 0; i < graph.blocks.length; i++) { 994 for (int i = 0; i < graph.blocks.length; i++) {
995 values[graph.blocks[i].id] = new ValueSet(); 995 values[graph.blocks[i].id] = new ValueSet();
996 } 996 }
997 visitPostDominatorTree(graph); 997 visitPostDominatorTree(graph);
998 } 998 }
999 999
1000 void visitBasicBlock(HBasicBlock block) { 1000 void visitBasicBlock(HBasicBlock block) {
1001 List<HBasicBlock> successors = block.successors; 1001 List<HBasicBlock> successors = block.successors;
1002 1002
1003 // Phase 1: get the ValueSet of all successors, compute the 1003 // Phase 1: get the ValueSet of all successors (if there are more than one),
1004 // intersection and move the instructions of the intersection into 1004 // compute the intersection and move the instructions of the intersection
1005 // this block. 1005 // into this block.
1006 if (successors.length != 0) { 1006 if (successors.length > 1) {
1007 ValueSet instructions = values[successors[0].id]; 1007 ValueSet instructions = values[successors[0].id];
1008 for (int i = 1; i < successors.length; i++) { 1008 for (int i = 1; i < successors.length; i++) {
1009 ValueSet other = values[successors[i].id]; 1009 ValueSet other = values[successors[i].id];
1010 instructions = instructions.intersection(other); 1010 instructions = instructions.intersection(other);
1011 } 1011 }
1012 1012
1013 if (!instructions.isEmpty()) { 1013 if (!instructions.isEmpty()) {
1014 List<HInstruction> list = instructions.toList(); 1014 List<HInstruction> list = instructions.toList();
1015 for (HInstruction instruction in list) { 1015 for (HInstruction instruction in list) {
1016 // Move the instruction to the current block. 1016 // Move the instruction to the current block.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 // the if block terminates. So any use of the instruction 1130 // the if block terminates. So any use of the instruction
1131 // after the join block should be changed to the new 1131 // after the join block should be changed to the new
1132 // instruction. 1132 // instruction.
1133 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); 1133 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType);
1134 } 1134 }
1135 // TODO(ngeoffray): Also change uses for the then block on a HType 1135 // TODO(ngeoffray): Also change uses for the then block on a HType
1136 // that knows it is not of a specific Type. 1136 // that knows it is not of a specific Type.
1137 } 1137 }
1138 } 1138 }
1139 } 1139 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698