| 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; | 5 library universe; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import '../cache_strategy.dart'; | 9 import '../cache_strategy.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 /// | 32 /// |
| 33 /// class Bar { | 33 /// class Bar { |
| 34 /// void foo() {} | 34 /// void foo() {} |
| 35 /// } | 35 /// } |
| 36 /// main() => new Bar().foo(); | 36 /// main() => new Bar().foo(); |
| 37 /// | 37 /// |
| 38 abstract class ReceiverConstraint { | 38 abstract class ReceiverConstraint { |
| 39 /// Returns whether [element] is a potential target when being | 39 /// Returns whether [element] is a potential target when being |
| 40 /// invoked on a receiver with this constraint. [selector] is used to ensure | 40 /// invoked on a receiver with this constraint. [selector] is used to ensure |
| 41 /// library privacy is taken into account. | 41 /// library privacy is taken into account. |
| 42 bool canHit(Element element, Selector selector, World world); | 42 bool canHit(MemberElement element, Selector selector, World world); |
| 43 | 43 |
| 44 /// Returns whether this [TypeMask] applied to [selector] can hit a | 44 /// Returns whether this [TypeMask] applied to [selector] can hit a |
| 45 /// [noSuchMethod]. | 45 /// [noSuchMethod]. |
| 46 bool needsNoSuchMethodHandling(Selector selector, World world); | 46 bool needsNoSuchMethodHandling(Selector selector, World world); |
| 47 } | 47 } |
| 48 | 48 |
| 49 /// The combined constraints on receivers all the dynamic call sites of the same | 49 /// The combined constraints on receivers all the dynamic call sites of the same |
| 50 /// selector. | 50 /// selector. |
| 51 /// | 51 /// |
| 52 /// For instance for these calls | 52 /// For instance for these calls |
| (...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1966 @override | 1966 @override |
| 1967 EnumSet<MemberUse> get _originalUse => MemberUses.ALL_STATIC; | 1967 EnumSet<MemberUse> get _originalUse => MemberUses.ALL_STATIC; |
| 1968 } | 1968 } |
| 1969 | 1969 |
| 1970 void removeFromSet(Map<String, Set<_MemberUsage>> map, Element element) { | 1970 void removeFromSet(Map<String, Set<_MemberUsage>> map, Element element) { |
| 1971 Set<_MemberUsage> set = map[element.name]; | 1971 Set<_MemberUsage> set = map[element.name]; |
| 1972 if (set == null) return; | 1972 if (set == null) return; |
| 1973 set.removeAll( | 1973 set.removeAll( |
| 1974 set.where((_MemberUsage usage) => usage.entity == element).toList()); | 1974 set.where((_MemberUsage usage) => usage.entity == element).toList()); |
| 1975 } | 1975 } |
| OLD | NEW |