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

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

Issue 9878001: Fix a bug where a block would be visited twice: by a non-dominating loop, and by its dominator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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/co19/co19-leg.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) 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 class SsaCodeGeneratorTask extends CompilerTask { 5 class SsaCodeGeneratorTask extends CompilerTask {
6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler);
7 String get name() => 'SSA code generator'; 7 String get name() => 'SSA code generator';
8 8
9 9
10 String generateMethod(WorkItem work, HGraph graph) { 10 String generateMethod(WorkItem work, HGraph graph) {
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 842
843 visitLoopBranch(HLoopBranch node) { 843 visitLoopBranch(HLoopBranch node) {
844 HBasicBlock branchBlock = currentBlock; 844 HBasicBlock branchBlock = currentBlock;
845 handleLoopCondition(node); 845 handleLoopCondition(node);
846 List<HBasicBlock> dominated = currentBlock.dominatedBlocks; 846 List<HBasicBlock> dominated = currentBlock.dominatedBlocks;
847 // For a do while loop, the body has already been visited. 847 // For a do while loop, the body has already been visited.
848 if (!node.isDoWhile()) { 848 if (!node.isDoWhile()) {
849 visitBasicBlock(dominated[0]); 849 visitBasicBlock(dominated[0]);
850 } 850 }
851 endLoop(node.block); 851 endLoop(node.block);
852
853 // If the branch does not dominate the code after the loop, the
854 // dominator will visit it.
855 if (branchBlock.successors[1].dominator !== branchBlock) return;
856
852 visitBasicBlock(branchBlock.successors[1]); 857 visitBasicBlock(branchBlock.successors[1]);
853 // With labeled breaks we can have more dominated blocks. 858 // With labeled breaks we can have more dominated blocks.
854 if (dominated.length >= 3) { 859 if (dominated.length >= 3) {
855 for (int i = 2; i < dominated.length; i++) { 860 for (int i = 2; i < dominated.length; i++) {
856 visitBasicBlock(dominated[i]); 861 visitBasicBlock(dominated[i]);
857 } 862 }
858 } 863 }
859 } 864 }
860 865
861 visitNot(HNot node) { 866 visitNot(HNot node) {
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 startBailoutSwitch(); 1561 startBailoutSwitch();
1557 } 1562 }
1558 } 1563 }
1559 1564
1560 void endElse(HIf node) { 1565 void endElse(HIf node) {
1561 if (node.elseBlock.hasGuards()) { 1566 if (node.elseBlock.hasGuards()) {
1562 endBailoutSwitch(); 1567 endBailoutSwitch();
1563 } 1568 }
1564 } 1569 }
1565 } 1570 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698