| 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 InvocationInfo { | 5 class InvocationInfo { |
| 6 int parameterCount = -1; | 6 int parameterCount = -1; |
| 7 List<HType> providedTypes; | 7 List<HType> providedTypes; |
| 8 List<Element> compiledFunctions; | 8 List<Element> compiledFunctions; |
| 9 | 9 |
| 10 InvocationInfo(HInvoke node, HTypeMap types) | 10 InvocationInfo(HInvoke node, HTypeMap types) |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 HType optimisticFieldTypeAfterConstruction(Element field) { | 198 HType optimisticFieldTypeAfterConstruction(Element field) { |
| 199 assert(field.isField()); | 199 assert(field.isField()); |
| 200 assert(field.isMember()); | 200 assert(field.isMember()); |
| 201 | 201 |
| 202 ClassElement classElement = field.getEnclosingClass(); | 202 ClassElement classElement = field.getEnclosingClass(); |
| 203 if (hasConstructorBodyFieldSetter(field)) { | 203 if (hasConstructorBodyFieldSetter(field)) { |
| 204 // If there are field setters but there is only constructor then the type | 204 // If there are field setters but there is only constructor then the type |
| 205 // of the field is determined by the assignments in the constructor | 205 // of the field is determined by the assignments in the constructor |
| 206 // body. | 206 // body. |
| 207 var constructors = classElement.constructors; | 207 var constructors = classElement.constructors; |
| 208 if (constructors.head !== null && constructors.tail === null) { | 208 if (constructors.head !== null && constructors.tail.isEmpty()) { |
| 209 return fieldConstructorSetters[classElement][field]; | 209 return fieldConstructorSetters[classElement][field]; |
| 210 } else { | 210 } else { |
| 211 return HType.UNKNOWN; | 211 return HType.UNKNOWN; |
| 212 } | 212 } |
| 213 } else if (fieldInitializers.containsKey(classElement)) { | 213 } else if (fieldInitializers.containsKey(classElement)) { |
| 214 HType type = fieldInitializers[classElement][field]; | 214 HType type = fieldInitializers[classElement][field]; |
| 215 return type == null ? HType.CONFLICTING : type; | 215 return type == null ? HType.CONFLICTING : type; |
| 216 } else { | 216 } else { |
| 217 return HType.CONFLICTING; | 217 return HType.CONFLICTING; |
| 218 } | 218 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 FunctionSignature signature = element.computeSignature(compiler); | 346 FunctionSignature signature = element.computeSignature(compiler); |
| 347 if (signature.parameterCount == found.parameterCount) { | 347 if (signature.parameterCount == found.parameterCount) { |
| 348 found.addCompiledFunction(element); | 348 found.addCompiledFunction(element); |
| 349 return found.providedTypes; | 349 return found.providedTypes; |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 return null; | 352 return null; |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 } | 355 } |
| OLD | NEW |