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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/universe/function_set.dart

Issue 24952003: Change TypeMask.base to be a ClassElement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moar declaration. Created 7 years, 2 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 part of universe; 5 part of universe;
6 6
7 // TODO(kasperl): This actually holds getters and setters just fine 7 // TODO(kasperl): This actually holds getters and setters just fine
8 // too and stricly they aren't functions. Maybe this needs a better 8 // too and stricly they aren't functions. Maybe this needs a better
9 // name -- something like ElementSet seems a bit too generic. 9 // name -- something like ElementSet seems a bit too generic.
10 class FunctionSet { 10 class FunctionSet {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 void forEach(Function action) { 140 void forEach(Function action) {
141 elements.forEach(action); 141 elements.forEach(action);
142 } 142 }
143 143
144 TypeMask getNonNullTypeMaskOfSelector(Selector selector, Compiler compiler) { 144 TypeMask getNonNullTypeMaskOfSelector(Selector selector, Compiler compiler) {
145 // TODO(ngeoffray): We should probably change untyped selector 145 // TODO(ngeoffray): We should probably change untyped selector
146 // to always be a subclass of Object. 146 // to always be a subclass of Object.
147 return selector.mask != null 147 return selector.mask != null
148 ? selector.mask 148 ? selector.mask
149 : new TypeMask.subclass(compiler.objectClass.rawType); 149 : new TypeMask.subclass(compiler.objectClass);
150 } 150 }
151 151
152 FunctionSetQuery query(Selector selector, 152 FunctionSetQuery query(Selector selector,
153 Compiler compiler, 153 Compiler compiler,
154 FunctionSetNode noSuchMethods) { 154 FunctionSetNode noSuchMethods) {
155 assert(selector.name == name); 155 assert(selector.name == name);
156 FunctionSetQuery result = cache[selector]; 156 FunctionSetQuery result = cache[selector];
157 if (result != null) return result; 157 if (result != null) return result;
158 Set<Element> functions; 158 Set<Element> functions;
159 for (Element element in elements) { 159 for (Element element in elements) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ClassElement cls = element.getEnclosingClass(); 218 ClassElement cls = element.getEnclosingClass();
219 return compiler.world.isUsedAsMixin(cls) 219 return compiler.world.isUsedAsMixin(cls)
220 ? ([cls]..addAll(compiler.world.mixinUses[cls])) 220 ? ([cls]..addAll(compiler.world.mixinUses[cls]))
221 : [cls]; 221 : [cls];
222 }) 222 })
223 .map((cls) { 223 .map((cls) {
224 if (compiler.backend.isNullImplementation(cls)) { 224 if (compiler.backend.isNullImplementation(cls)) {
225 return const TypeMask.empty(); 225 return const TypeMask.empty();
226 } 226 }
227 return compiler.world.hasSubclasses(cls) 227 return compiler.world.hasSubclasses(cls)
228 ? new TypeMask.nonNullSubclass(cls.rawType) 228 ? new TypeMask.nonNullSubclass(cls)
229 : new TypeMask.nonNullExact(cls.rawType); 229 : new TypeMask.nonNullExact(cls);
230 }), 230 }),
231 compiler); 231 compiler);
232 } 232 }
233 233
234 FullFunctionSetQuery(functions) : super(functions); 234 FullFunctionSetQuery(functions) : super(functions);
235 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698