OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |