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 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 if (node.isRedirectingFactoryBody) { | 3452 if (node.isRedirectingFactoryBody) { |
3453 compiler.internalError("Unimplemented: Redirecting factory constructor", | 3453 compiler.internalError("Unimplemented: Redirecting factory constructor", |
3454 node: node); | 3454 node: node); |
3455 } | 3455 } |
3456 HInstruction value; | 3456 HInstruction value; |
3457 if (node.expression == null) { | 3457 if (node.expression == null) { |
3458 value = graph.addConstantNull(constantSystem); | 3458 value = graph.addConstantNull(constantSystem); |
3459 } else { | 3459 } else { |
3460 visit(node.expression); | 3460 visit(node.expression); |
3461 value = pop(); | 3461 value = pop(); |
3462 value = potentiallyCheckType(value, returnType); | 3462 if (returnType == compiler.types.voidType |
| 3463 && value is HForeign) { |
| 3464 // TODO(6530): remove this check. |
| 3465 } else { |
| 3466 value = potentiallyCheckType(value, returnType); |
| 3467 } |
3463 } | 3468 } |
3464 if (!inliningStack.isEmpty) { | 3469 if (!inliningStack.isEmpty) { |
3465 localsHandler.updateLocal(returnElement, value); | 3470 localsHandler.updateLocal(returnElement, value); |
3466 } else { | 3471 } else { |
3467 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit); | 3472 close(attachPosition(new HReturn(value), node)).addSuccessor(graph.exit); |
3468 } | 3473 } |
3469 } | 3474 } |
3470 | 3475 |
3471 visitThrow(Throw node) { | 3476 visitThrow(Throw node) { |
3472 if (node.expression == null) { | 3477 if (node.expression == null) { |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4675 new HSubGraphBlockInformation(elseBranch.graph)); | 4680 new HSubGraphBlockInformation(elseBranch.graph)); |
4676 | 4681 |
4677 HBasicBlock conditionStartBlock = conditionBranch.block; | 4682 HBasicBlock conditionStartBlock = conditionBranch.block; |
4678 conditionStartBlock.setBlockFlow(info, joinBlock); | 4683 conditionStartBlock.setBlockFlow(info, joinBlock); |
4679 SubGraph conditionGraph = conditionBranch.graph; | 4684 SubGraph conditionGraph = conditionBranch.graph; |
4680 HIf branch = conditionGraph.end.last; | 4685 HIf branch = conditionGraph.end.last; |
4681 assert(branch is HIf); | 4686 assert(branch is HIf); |
4682 branch.blockInformation = conditionStartBlock.blockFlow; | 4687 branch.blockInformation = conditionStartBlock.blockFlow; |
4683 } | 4688 } |
4684 } | 4689 } |
OLD | NEW |