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

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

Issue 14972005: Fix https://code.google.com/p/dart/issues/detail?id=10474 by not loop hoisting instructions that ma… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | tests/compiler/dart2js/dead_bailout_target_test.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 part of ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 void moveLoopInvariantCodeFromBlock(HBasicBlock block, 1166 void moveLoopInvariantCodeFromBlock(HBasicBlock block,
1167 HBasicBlock loopHeader, 1167 HBasicBlock loopHeader,
1168 int changesFlags) { 1168 int changesFlags) {
1169 assert(block.parentLoopHeader == loopHeader); 1169 assert(block.parentLoopHeader == loopHeader);
1170 HBasicBlock preheader = loopHeader.predecessors[0]; 1170 HBasicBlock preheader = loopHeader.predecessors[0];
1171 int dependsFlags = SideEffects.computeDependsOnFlags(changesFlags); 1171 int dependsFlags = SideEffects.computeDependsOnFlags(changesFlags);
1172 HInstruction instruction = block.first; 1172 HInstruction instruction = block.first;
1173 while (instruction != null) { 1173 while (instruction != null) {
1174 HInstruction next = instruction.next; 1174 HInstruction next = instruction.next;
1175 if (instruction.useGvn() 1175 if (instruction.useGvn()
1176 && (instruction is !HCheck) 1176 && !instruction.canThrow()
1177 && !instruction.sideEffects.dependsOn(dependsFlags)) { 1177 && !instruction.sideEffects.dependsOn(dependsFlags)) {
1178 bool loopInvariantInputs = true; 1178 bool loopInvariantInputs = true;
1179 List<HInstruction> inputs = instruction.inputs; 1179 List<HInstruction> inputs = instruction.inputs;
1180 for (int i = 0, length = inputs.length; i < length; i++) { 1180 for (int i = 0, length = inputs.length; i < length; i++) {
1181 if (isInputDefinedAfterDominator(inputs[i], preheader)) { 1181 if (isInputDefinedAfterDominator(inputs[i], preheader)) {
1182 loopInvariantInputs = false; 1182 loopInvariantInputs = false;
1183 break; 1183 break;
1184 } 1184 }
1185 } 1185 }
1186 1186
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 HBasicBlock block = user.block; 1706 HBasicBlock block = user.block;
1707 block.addAfter(user, interceptor); 1707 block.addAfter(user, interceptor);
1708 block.rewrite(user, interceptor); 1708 block.rewrite(user, interceptor);
1709 block.remove(user); 1709 block.remove(user);
1710 1710
1711 // The interceptor will be removed in the dead code elimination 1711 // The interceptor will be removed in the dead code elimination
1712 // phase. Note that removing it here would not work because of how 1712 // phase. Note that removing it here would not work because of how
1713 // the [visitBasicBlock] is implemented. 1713 // the [visitBasicBlock] is implemented.
1714 } 1714 }
1715 } 1715 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/dead_bailout_target_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698