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 /** | 7 /** |
8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 conditionBlock.loopInformation = null; | 1975 conditionBlock.loopInformation = null; |
1976 | 1976 |
1977 // Remove the [HLoopBranch] instruction and replace it with | 1977 // Remove the [HLoopBranch] instruction and replace it with |
1978 // [HIf]. | 1978 // [HIf]. |
1979 HInstruction condition = conditionExitBlock.last.inputs[0]; | 1979 HInstruction condition = conditionExitBlock.last.inputs[0]; |
1980 conditionExitBlock.addAtExit(new HIf(condition)); | 1980 conditionExitBlock.addAtExit(new HIf(condition)); |
1981 conditionExitBlock.addSuccessor(elseBlock); | 1981 conditionExitBlock.addSuccessor(elseBlock); |
1982 conditionExitBlock.remove(conditionExitBlock.last); | 1982 conditionExitBlock.remove(conditionExitBlock.last); |
1983 HIfBlockInformation info = | 1983 HIfBlockInformation info = |
1984 new HIfBlockInformation( | 1984 new HIfBlockInformation( |
1985 wrapExpressionGraph(conditionExpression), | 1985 wrapExpressionGraph(conditionExpression), |
1986 wrapStatementGraph(bodyGraph), | 1986 wrapStatementGraph(bodyGraph), |
1987 wrapStatementGraph(elseGraph)); | 1987 wrapStatementGraph(elseGraph)); |
1988 | 1988 |
1989 conditionBlock.setBlockFlow(info, current); | 1989 conditionExitBlock.setBlockFlow(info, current); |
1990 HIf ifBlock = conditionBlock.last; | 1990 HIf ifBlock = conditionExitBlock.last; |
1991 ifBlock.blockInformation = conditionBlock.blockFlow; | 1991 ifBlock.blockInformation = conditionExitBlock.blockFlow; |
1992 | 1992 |
1993 // If the body has any break, attach a synthesized label to the | 1993 // If the body has any break, attach a synthesized label to the |
1994 // if block. | 1994 // if block. |
1995 if (jumpHandler.hasAnyBreak()) { | 1995 if (jumpHandler.hasAnyBreak()) { |
1996 TargetElement target = elements[loop]; | 1996 TargetElement target = elements[loop]; |
1997 LabelElement label = target.addLabel(null, 'loop'); | 1997 LabelElement label = target.addLabel(null, 'loop'); |
1998 label.setBreakTarget(); | 1998 label.setBreakTarget(); |
1999 SubGraph labelGraph = new SubGraph(conditionBlock, current); | 1999 SubGraph labelGraph = new SubGraph(conditionBlock, current); |
2000 HLabeledBlockInformation labelInfo = new HLabeledBlockInformation( | 2000 HLabeledBlockInformation labelInfo = new HLabeledBlockInformation( |
2001 new HSubGraphBlockInformation(labelGraph), | 2001 new HSubGraphBlockInformation(labelGraph), |
(...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5104 new HSubGraphBlockInformation(elseBranch.graph)); | 5104 new HSubGraphBlockInformation(elseBranch.graph)); |
5105 | 5105 |
5106 HBasicBlock conditionStartBlock = conditionBranch.block; | 5106 HBasicBlock conditionStartBlock = conditionBranch.block; |
5107 conditionStartBlock.setBlockFlow(info, joinBlock); | 5107 conditionStartBlock.setBlockFlow(info, joinBlock); |
5108 SubGraph conditionGraph = conditionBranch.graph; | 5108 SubGraph conditionGraph = conditionBranch.graph; |
5109 HIf branch = conditionGraph.end.last; | 5109 HIf branch = conditionGraph.end.last; |
5110 assert(branch is HIf); | 5110 assert(branch is HIf); |
5111 branch.blockInformation = conditionStartBlock.blockFlow; | 5111 branch.blockInformation = conditionStartBlock.blockFlow; |
5112 } | 5112 } |
5113 } | 5113 } |
OLD | NEW |