| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 interface OptimizationPhase { | 5 interface OptimizationPhase { |
| 6 String get name(); | 6 String get name(); |
| 7 void visitGraph(HGraph graph); | 7 void visitGraph(HGraph graph); |
| 8 } | 8 } |
| 9 | 9 |
| 10 class SsaOptimizerTask extends CompilerTask { | 10 class SsaOptimizerTask extends CompilerTask { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 HInstruction visitInvokeDynamic(HInvokeDynamic node) { | 194 HInstruction visitInvokeDynamic(HInvokeDynamic node) { |
| 195 HType receiverType = node.receiver.propagatedType; | 195 HType receiverType = node.receiver.propagatedType; |
| 196 if (receiverType.isExact()) { | 196 if (receiverType.isExact()) { |
| 197 HExactType type = receiverType; | 197 HExactType type = receiverType; |
| 198 Element element = type.lookupMember(node.name); | 198 Element element = type.lookupMember(node.name); |
| 199 // TODO(ngeoffray): Also fold if it's a getter or variable. | 199 // TODO(ngeoffray): Also fold if it's a getter or variable. |
| 200 if (element != null && element.isFunction()) { | 200 if (element != null && element.isFunction()) { |
| 201 if (node.selector.applies(element, compiler)) { | 201 if (node.selector.applies(element, compiler)) { |
| 202 FunctionElement method = element; | 202 FunctionElement method = element; |
| 203 FunctionParameters parameters = method.computeParameters(compiler); | 203 FunctionSignature parameters = method.computeSignature(compiler); |
| 204 if (parameters.optionalParameterCount == 0) { | 204 if (parameters.optionalParameterCount == 0) { |
| 205 node.element = element; | 205 node.element = element; |
| 206 } | 206 } |
| 207 // TODO(ngeoffray): If the method has optional parameters, | 207 // TODO(ngeoffray): If the method has optional parameters, |
| 208 // we should pass the default values here. | 208 // we should pass the default values here. |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 return node; | 212 return node; |
| 213 } | 213 } |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 // the if block terminates. So any use of the instruction | 1086 // the if block terminates. So any use of the instruction |
| 1087 // after the join block should be changed to the new | 1087 // after the join block should be changed to the new |
| 1088 // instruction. | 1088 // instruction. |
| 1089 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); | 1089 changeUsesDominatedBy(ifUser.joinBlock, input, convertedType); |
| 1090 } | 1090 } |
| 1091 // TODO(ngeoffray): Also change uses for the then block on a HType | 1091 // TODO(ngeoffray): Also change uses for the then block on a HType |
| 1092 // that knows it is not of a specific Type. | 1092 // that knows it is not of a specific Type. |
| 1093 } | 1093 } |
| 1094 } | 1094 } |
| 1095 } | 1095 } |
| OLD | NEW |