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 SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
8 | 8 |
9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
10 | 10 |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1493 node); | 1493 node); |
1494 } | 1494 } |
1495 } else { | 1495 } else { |
1496 TargetElement target = node.target; | 1496 TargetElement target = node.target; |
1497 if (!tryCallAction(continueAction, target)) { | 1497 if (!tryCallAction(continueAction, target)) { |
1498 pushStatement(new js.Continue(null), node); | 1498 pushStatement(new js.Continue(null), node); |
1499 } | 1499 } |
1500 } | 1500 } |
1501 } | 1501 } |
1502 | 1502 |
1503 visitExitTry(HExitTry node) { | |
1504 // A [HExitTry] is used for having the control flow graph of a | |
floitsch
2012/11/05 14:24:52
An
ngeoffray
2012/11/05 16:58:07
Done.
| |
1505 // try/catch block right, ie the try body is always a predecessor | |
floitsch
2012/11/05 14:24:52
"right" is a strong word...
ngeoffray
2012/11/05 16:58:07
Comment updated.
| |
1506 // of the catch and finally. Here, we continue visiting the try | |
1507 // body by visiting the block that contains the user-level control | |
1508 // flow instruction. | |
1509 visitBasicBlock(node.bodyTrySuccessor); | |
1510 } | |
1511 | |
1503 visitTry(HTry node) { | 1512 visitTry(HTry node) { |
1504 // We should never get here. Try/catch/finally is always handled using block | 1513 // We should never get here. Try/catch/finally is always handled using block |
1505 // information in [visitTryInfo], or not at all, in the case of the bailout | 1514 // information in [visitTryInfo], or not at all, in the case of the bailout |
1506 // generator. | 1515 // generator. |
1507 compiler.internalError('visitTry should not be called', instruction: node); | 1516 compiler.internalError('visitTry should not be called', instruction: node); |
1508 } | 1517 } |
1509 | 1518 |
1510 bool tryControlFlowOperation(HIf node) { | 1519 bool tryControlFlowOperation(HIf node) { |
1511 if (!controlFlowOperators.contains(node)) return false; | 1520 if (!controlFlowOperators.contains(node)) return false; |
1512 HPhi phi = node.joinBlock.phis.first; | 1521 HPhi phi = node.joinBlock.phis.first; |
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3133 if (leftType.canBeNull() && rightType.canBeNull()) { | 3142 if (leftType.canBeNull() && rightType.canBeNull()) { |
3134 if (left.isConstantNull() || right.isConstantNull() || | 3143 if (left.isConstantNull() || right.isConstantNull() || |
3135 (leftType.isPrimitive() && leftType == rightType)) { | 3144 (leftType.isPrimitive() && leftType == rightType)) { |
3136 return '=='; | 3145 return '=='; |
3137 } | 3146 } |
3138 return null; | 3147 return null; |
3139 } else { | 3148 } else { |
3140 return '==='; | 3149 return '==='; |
3141 } | 3150 } |
3142 } | 3151 } |
OLD | NEW |