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

Side by Side Diff: lib/compiler/implementation/world.dart

Issue 10825337: Add name and library to selectors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make library == null for non-private selectors. Created 8 years, 4 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 | Annotate | Revision Log
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 class World { 5 class World {
6 Compiler compiler; // Set in populate(). 6 Compiler compiler; // Set in populate().
7 final Map<ClassElement, Set<ClassElement>> subtypes; 7 final Map<ClassElement, Set<ClassElement>> subtypes;
8 8
9 World() : subtypes = new Map<ClassElement, Set<ClassElement>>(); 9 World() : subtypes = new Map<ClassElement, Set<ClassElement>>();
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } else { 65 } else {
66 nonFieldCount++; 66 nonFieldCount++;
67 } 67 }
68 }); 68 });
69 return (fieldCount == 1 && nonFieldCount == 0) ? field : null; 69 return (fieldCount == 1 && nonFieldCount == 0) ? field : null;
70 } 70 }
71 71
72 Set<ClassElement> findNoSuchMethodHolders(Type type) { 72 Set<ClassElement> findNoSuchMethodHolders(Type type) {
73 Set<ClassElement> result = new Set<ClassElement>(); 73 Set<ClassElement> result = new Set<ClassElement>();
74 MemberSet memberSet = _memberSetFor(type, Compiler.NO_SUCH_METHOD); 74 MemberSet memberSet = _memberSetFor(type, Compiler.NO_SUCH_METHOD);
75 Selector noSuchMethodSelector = new Selector.noSuchMethod();
75 for (Element element in memberSet.elements) { 76 for (Element element in memberSet.elements) {
76 ClassElement holder = element.getEnclosingClass(); 77 ClassElement holder = element.getEnclosingClass();
77 if (holder !== compiler.objectClass && 78 if (holder !== compiler.objectClass &&
78 Selector.INVOCATION_2.applies(element, compiler)) { 79 noSuchMethodSelector.applies(element, compiler)) {
79 result.add(holder); 80 result.add(holder);
80 } 81 }
81 } 82 }
82 return result; 83 return result;
83 } 84 }
84 } 85 }
85 86
86 /** 87 /**
87 * A [MemberSet] contains all the possible targets for a selector. 88 * A [MemberSet] contains all the possible targets for a selector.
88 */ 89 */
89 class MemberSet { 90 class MemberSet {
90 final Set<Element> elements; 91 final Set<Element> elements;
91 final SourceString name; 92 final SourceString name;
92 93
93 MemberSet(SourceString this.name) : elements = new Set<Element>(); 94 MemberSet(SourceString this.name) : elements = new Set<Element>();
94 95
95 void add(Element element) { 96 void add(Element element) {
96 elements.add(element); 97 elements.add(element);
97 } 98 }
98 99
99 bool isEmpty() => elements.isEmpty(); 100 bool isEmpty() => elements.isEmpty();
100 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698