Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Side by Side Diff: pkg/compiler/lib/src/universe/world_builder.dart

Issue 2608273002: Reduce use of Element in optimize.dart (Closed)
Patch Set: Fix. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698