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

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

Issue 11299011: Avoid critical edge on do/while, and do not make handleLoopInfo return conditionnaly false: block b… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | sdk/lib/_internal/compiler/implementation/ssa/codegen.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 class Interceptors { 7 class Interceptors {
8 Compiler compiler; 8 Compiler compiler;
9 Interceptors(Compiler this.compiler); 9 Interceptors(Compiler this.compiler);
10 10
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 bodyEntryBlock.setBlockFlow(info, conditionBlock); 2042 bodyEntryBlock.setBlockFlow(info, conditionBlock);
2043 } 2043 }
2044 open(conditionBlock); 2044 open(conditionBlock);
2045 2045
2046 visit(node.condition); 2046 visit(node.condition);
2047 assert(!isAborted()); 2047 assert(!isAborted());
2048 HInstruction conditionInstruction = popBoolified(); 2048 HInstruction conditionInstruction = popBoolified();
2049 conditionEndBlock = close( 2049 conditionEndBlock = close(
2050 new HLoopBranch(conditionInstruction, HLoopBranch.DO_WHILE_LOOP)); 2050 new HLoopBranch(conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
2051 2051
2052 conditionEndBlock.addSuccessor(loopEntryBlock); // The back-edge. 2052 HBasicBlock avoidCriticalEdge = addNewBlock();
2053 conditionEndBlock.addSuccessor(avoidCriticalEdge); // The back-edge.
Lasse Reichstein Nielsen 2012/11/16 15:12:17 Seems like the avoidCriticalEdge's successor is th
ngeoffray 2012/11/16 16:39:45 Done.
2054 open(avoidCriticalEdge);
2055 close(new HGoto());
2056 avoidCriticalEdge.addSuccessor(loopEntryBlock);
2057
2053 conditionExpression = 2058 conditionExpression =
2054 new SubExpression(conditionBlock, conditionEndBlock); 2059 new SubExpression(conditionBlock, conditionEndBlock);
2055 } 2060 }
2056 2061
2057 loopEntryBlock.postProcessLoopHeader(); 2062 loopEntryBlock.postProcessLoopHeader();
2058 2063
2059 endLoop(loopEntryBlock, conditionEndBlock, jumpHandler, localsHandler); 2064 endLoop(loopEntryBlock, conditionEndBlock, jumpHandler, localsHandler);
2060 jumpHandler.close(); 2065 jumpHandler.close();
2061 2066
2062 SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock); 2067 SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock);
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
4844 new HSubGraphBlockInformation(elseBranch.graph)); 4849 new HSubGraphBlockInformation(elseBranch.graph));
4845 4850
4846 HBasicBlock conditionStartBlock = conditionBranch.block; 4851 HBasicBlock conditionStartBlock = conditionBranch.block;
4847 conditionStartBlock.setBlockFlow(info, joinBlock); 4852 conditionStartBlock.setBlockFlow(info, joinBlock);
4848 SubGraph conditionGraph = conditionBranch.graph; 4853 SubGraph conditionGraph = conditionBranch.graph;
4849 HIf branch = conditionGraph.end.last; 4854 HIf branch = conditionGraph.end.last;
4850 assert(branch is HIf); 4855 assert(branch is HIf);
4851 branch.blockInformation = conditionStartBlock.blockFlow; 4856 branch.blockInformation = conditionStartBlock.blockFlow;
4852 } 4857 }
4853 } 4858 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698