Chromium Code Reviews| 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 4164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4175 handleInTryStatement(); | 4175 handleInTryStatement(); |
| 4176 closeAndGotoExit(new HThrow(exception, isRethrow: true)); | 4176 closeAndGotoExit(new HThrow(exception, isRethrow: true)); |
| 4177 } | 4177 } |
| 4178 | 4178 |
| 4179 visitReturn(Return node) { | 4179 visitReturn(Return node) { |
| 4180 if (identical(node.getBeginToken().stringValue, 'native')) { | 4180 if (identical(node.getBeginToken().stringValue, 'native')) { |
| 4181 native.handleSsaNative(this, node.expression); | 4181 native.handleSsaNative(this, node.expression); |
| 4182 return; | 4182 return; |
| 4183 } | 4183 } |
| 4184 HInstruction value; | 4184 HInstruction value; |
| 4185 if (node.isRedirectingFactoryBody) { | 4185 if (node.isRedirectingFactoryBody) { |
|
karlklose
2013/09/17 09:12:51
Please add a TODO for me that this implementation
ngeoffray
2013/09/17 12:02:24
I've implemented it instead.
| |
| 4186 // TODO(ahe): This is only for reflection, and it is not correct yet. | 4186 FunctionElement element = elements[node.expression]; |
| 4187 value = graph.addConstantNull(compiler); | 4187 FunctionElement function = currentElement; |
| 4188 List<HInstruction> inputs = <HInstruction>[]; | |
| 4189 FunctionSignature calleeSignature = element.functionSignature; | |
| 4190 FunctionSignature callerSignature = function.functionSignature; | |
| 4191 callerSignature.forEachRequiredParameter((Element element) { | |
| 4192 inputs.add(localsHandler.readLocal(element)); | |
| 4193 }); | |
| 4194 List<Element> calleeOptionals = | |
| 4195 calleeSignature.orderedOptionalParameters; | |
| 4196 List<Element> callerOptionals = | |
| 4197 callerSignature.orderedOptionalParameters; | |
| 4198 int i = 0; | |
| 4199 for (; i < callerOptionals.length; i++) { | |
| 4200 inputs.add(localsHandler.readLocal(callerOptionals[i])); | |
| 4201 } | |
| 4202 for (; i < calleeOptionals.length; i++) { | |
| 4203 inputs.add(handleConstantForOptionalParameter(calleeOptionals[i])); | |
| 4204 } | |
| 4205 | |
| 4206 if (backend.classNeedsRti(element.getEnclosingClass())) { | |
| 4207 ClassElement cls = function.getEnclosingClass(); | |
| 4208 cls.typeVariables.forEach((TypeVariableType typeVariable) { | |
| 4209 inputs.add(localsHandler.readLocal(typeVariable.element)); | |
| 4210 }); | |
| 4211 } | |
| 4212 pushInvokeStatic(node, element, inputs); | |
| 4213 value = pop(); | |
| 4188 } else if (node.expression == null) { | 4214 } else if (node.expression == null) { |
| 4189 value = graph.addConstantNull(compiler); | 4215 value = graph.addConstantNull(compiler); |
| 4190 } else { | 4216 } else { |
| 4191 visit(node.expression); | 4217 visit(node.expression); |
| 4192 value = pop(); | 4218 value = pop(); |
| 4193 value = potentiallyCheckType(value, returnType); | 4219 value = potentiallyCheckType(value, returnType); |
| 4194 } | 4220 } |
| 4195 | 4221 |
| 4196 handleInTryStatement(); | 4222 handleInTryStatement(); |
| 4197 | 4223 |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5509 new HSubGraphBlockInformation(elseBranch.graph)); | 5535 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5510 | 5536 |
| 5511 HBasicBlock conditionStartBlock = conditionBranch.block; | 5537 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5512 conditionStartBlock.setBlockFlow(info, joinBlock); | 5538 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5513 SubGraph conditionGraph = conditionBranch.graph; | 5539 SubGraph conditionGraph = conditionBranch.graph; |
| 5514 HIf branch = conditionGraph.end.last; | 5540 HIf branch = conditionGraph.end.last; |
| 5515 assert(branch is HIf); | 5541 assert(branch is HIf); |
| 5516 branch.blockInformation = conditionStartBlock.blockFlow; | 5542 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5517 } | 5543 } |
| 5518 } | 5544 } |
| OLD | NEW |