| 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 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1620 // TODO(johnniwinther): remove the 'element.patch' hack. | 1620 // TODO(johnniwinther): remove the 'element.patch' hack. |
| 1621 if (element is FunctionElement) { | 1621 if (element is FunctionElement) { |
| 1622 FunctionElement functionElement = element; | 1622 FunctionElement functionElement = element; |
| 1623 if (functionElement.patch != null) element = functionElement.patch; | 1623 if (functionElement.patch != null) element = functionElement.patch; |
| 1624 } | 1624 } |
| 1625 Script script = element.getCompilationUnit().script; | 1625 Script script = element.getCompilationUnit().script; |
| 1626 SourceFile sourceFile = script.file; | 1626 SourceFile sourceFile = script.file; |
| 1627 SourceFileLocation location = new SourceFileLocation(sourceFile, token); | 1627 SourceFileLocation location = new SourceFileLocation(sourceFile, token); |
| 1628 if (!location.isValid()) { | 1628 if (!location.isValid()) { |
| 1629 throw MessageKind.INVALID_SOURCE_FILE_LOCATION.message( | 1629 throw MessageKind.INVALID_SOURCE_FILE_LOCATION.message( |
| 1630 [token.charOffset, sourceFile.filename, sourceFile.text.length]); | 1630 {'offset': token.charOffset, |
| 1631 'fileName': sourceFile.filename, |
| 1632 'length': sourceFile.text.length}); |
| 1631 } | 1633 } |
| 1632 return location; | 1634 return location; |
| 1633 } | 1635 } |
| 1634 | 1636 |
| 1635 void visit(Node node) { | 1637 void visit(Node node) { |
| 1636 if (node != null) node.accept(this); | 1638 if (node != null) node.accept(this); |
| 1637 } | 1639 } |
| 1638 | 1640 |
| 1639 visitBlock(Block node) { | 1641 visitBlock(Block node) { |
| 1640 for (Link<Node> link = node.statements.nodes; | 1642 for (Link<Node> link = node.statements.nodes; |
| (...skipping 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4952 new HSubGraphBlockInformation(elseBranch.graph)); | 4954 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4953 | 4955 |
| 4954 HBasicBlock conditionStartBlock = conditionBranch.block; | 4956 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4955 conditionStartBlock.setBlockFlow(info, joinBlock); | 4957 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4956 SubGraph conditionGraph = conditionBranch.graph; | 4958 SubGraph conditionGraph = conditionBranch.graph; |
| 4957 HIf branch = conditionGraph.end.last; | 4959 HIf branch = conditionGraph.end.last; |
| 4958 assert(branch is HIf); | 4960 assert(branch is HIf); |
| 4959 branch.blockInformation = conditionStartBlock.blockFlow; | 4961 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4960 } | 4962 } |
| 4961 } | 4963 } |
| OLD | NEW |