| 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 library universe.function_set; | 5 library universe.function_set; |
| 6 | 6 |
| 7 import '../common/names.dart' show Identifiers, Selectors; | 7 import '../common/names.dart' show Identifiers, Selectors; |
| 8 import '../compiler.dart' show Compiler; | 8 import '../compiler.dart' show Compiler; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../types/types.dart'; | 10 import '../types/types.dart'; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 : this.selector = selector, | 118 : this.selector = selector, |
| 119 this.constraint = constraint, | 119 this.constraint = constraint, |
| 120 this.hashCode = | 120 this.hashCode = |
| 121 Hashing.mixHashCodeBits(selector.hashCode, constraint.hashCode) { | 121 Hashing.mixHashCodeBits(selector.hashCode, constraint.hashCode) { |
| 122 assert(constraint != null); | 122 assert(constraint != null); |
| 123 } | 123 } |
| 124 | 124 |
| 125 String get name => selector.name; | 125 String get name => selector.name; |
| 126 | 126 |
| 127 bool applies(Element element, ClosedWorld closedWorld) { | 127 bool applies(Element element, ClosedWorld closedWorld) { |
| 128 if (!selector.appliesUnnamed(element, closedWorld.backend)) return false; | 128 if (!selector.appliesUnnamed(element)) return false; |
| 129 return constraint.canHit(element, selector, closedWorld); | 129 return constraint.canHit(element, selector, closedWorld); |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool needsNoSuchMethodHandling(ClosedWorld closedWorld) { | 132 bool needsNoSuchMethodHandling(ClosedWorld closedWorld) { |
| 133 return constraint.needsNoSuchMethodHandling(selector, closedWorld); | 133 return constraint.needsNoSuchMethodHandling(selector, closedWorld); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool operator ==(other) { | 136 bool operator ==(other) { |
| 137 if (identical(this, other)) return true; | 137 if (identical(this, other)) return true; |
| 138 return selector == other.selector && constraint == other.constraint; | 138 return selector == other.selector && constraint == other.constraint; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } else if (closedWorld.isInstantiated(cls.declaration)) { | 292 } else if (closedWorld.isInstantiated(cls.declaration)) { |
| 293 return new TypeMask.nonNullSubclass(cls.declaration, closedWorld); | 293 return new TypeMask.nonNullSubclass(cls.declaration, closedWorld); |
| 294 } else { | 294 } else { |
| 295 // TODO(johnniwinther): Avoid the need for this case. | 295 // TODO(johnniwinther): Avoid the need for this case. |
| 296 return const TypeMask.empty(); | 296 return const TypeMask.empty(); |
| 297 } | 297 } |
| 298 }), | 298 }), |
| 299 closedWorld); | 299 closedWorld); |
| 300 } | 300 } |
| 301 } | 301 } |
| OLD | NEW |