| 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 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 assert(graph.isValid()); | 169 assert(graph.isValid()); |
| 170 bool inLoop = functionsCalledInLoop.contains(element); | 170 bool inLoop = functionsCalledInLoop.contains(element); |
| 171 if (!inLoop) { | 171 if (!inLoop) { |
| 172 Selector selector = selectorsCalledInLoop[element.name]; | 172 Selector selector = selectorsCalledInLoop[element.name]; |
| 173 inLoop = selector !== null && selector.applies(element, compiler); | 173 inLoop = selector !== null && selector.applies(element, compiler); |
| 174 } | 174 } |
| 175 graph.calledInLoop = inLoop; | 175 graph.calledInLoop = inLoop; |
| 176 | 176 |
| 177 // If there is an estimate of the parameter types assume these types when | 177 // If there is an estimate of the parameter types assume these types when |
| 178 // compiling. | 178 // compiling. |
| 179 List<HType> parameterTypes; | 179 List<HType> parameterTypes = |
| 180 backend.optimisticParameterTypesWithRecompilationOnTypeChange( | 180 backend.optimisticParameterTypesWithRecompilationOnTypeChange( |
| 181 element); | 181 element); |
| 182 if (parameterTypes != null) { | 182 if (parameterTypes != null) { |
| 183 FunctionSignature signature = element.computeSignature(compiler); | 183 FunctionSignature signature = element.computeSignature(compiler); |
| 184 int i = 0; | 184 int i = 0; |
| 185 signature.forEachParameter((Element param) { | 185 signature.forEachParameter((Element param) { |
| 186 builder.parameters[param].guaranteedType = parameterTypes[i++]; | 186 builder.parameters[param].guaranteedType = parameterTypes[i++]; |
| 187 }); | 187 }); |
| 188 } | 188 } |
| 189 | 189 |
| (...skipping 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3615 new HSubGraphBlockInformation(elseBranch.graph)); | 3615 new HSubGraphBlockInformation(elseBranch.graph)); |
| 3616 | 3616 |
| 3617 HBasicBlock conditionStartBlock = conditionBranch.block; | 3617 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 3618 conditionStartBlock.setBlockFlow(info, joinBlock); | 3618 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 3619 SubGraph conditionGraph = conditionBranch.graph; | 3619 SubGraph conditionGraph = conditionBranch.graph; |
| 3620 HIf branch = conditionGraph.end.last; | 3620 HIf branch = conditionGraph.end.last; |
| 3621 assert(branch is HIf); | 3621 assert(branch is HIf); |
| 3622 branch.blockInformation = conditionStartBlock.blockFlow; | 3622 branch.blockInformation = conditionStartBlock.blockFlow; |
| 3623 } | 3623 } |
| 3624 } | 3624 } |
| OLD | NEW |