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

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
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 avoidEdge = addNewBlock();
floitsch 2012/11/16 14:05:43 avoidCriticalEdge, or but comment somewhere.
ngeoffray 2012/11/16 14:14:59 Renamed to avoidCriticalEdge.
2053 conditionEndBlock.addSuccessor(avoidEdge); // The back-edge.
2054 open(avoidEdge);
2055 close(new HGoto());
2056 avoidEdge.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 2778 matching lines...) Expand 10 before | Expand all | Expand 10 after
4841 new HSubGraphBlockInformation(elseBranch.graph)); 4846 new HSubGraphBlockInformation(elseBranch.graph));
4842 4847
4843 HBasicBlock conditionStartBlock = conditionBranch.block; 4848 HBasicBlock conditionStartBlock = conditionBranch.block;
4844 conditionStartBlock.setBlockFlow(info, joinBlock); 4849 conditionStartBlock.setBlockFlow(info, joinBlock);
4845 SubGraph conditionGraph = conditionBranch.graph; 4850 SubGraph conditionGraph = conditionBranch.graph;
4846 HIf branch = conditionGraph.end.last; 4851 HIf branch = conditionGraph.end.last;
4847 assert(branch is HIf); 4852 assert(branch is HIf);
4848 branch.blockInformation = conditionStartBlock.blockFlow; 4853 branch.blockInformation = conditionStartBlock.blockFlow;
4849 } 4854 }
4850 } 4855 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698