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

Side by Side Diff: pkg/compiler/lib/src/world.dart

Issue 2464103002: Introduce ClassLike, MemberLike, FieldLike and FunctionLike (Closed)
Patch Set: Updated cf. comments. Created 4 years, 1 month 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/types_propagation.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart2js.world; 5 library dart2js.world;
6 6
7 import 'closure.dart' show SynthesizedCallMethodElementX; 7 import 'closure.dart' show SynthesizedCallMethodElementX;
8 import 'common/backend_api.dart' show BackendClasses; 8 import 'common/backend_api.dart' show BackendClasses;
9 import 'common.dart'; 9 import 'common.dart';
10 import 'compiler.dart' show Compiler; 10 import 'compiler.dart' show Compiler;
11 import 'core_types.dart' show CoreClasses; 11 import 'core_types.dart' show CoreClasses;
12 import 'dart_types.dart'; 12 import 'dart_types.dart';
13 import 'elements/elements.dart' 13 import 'elements/elements.dart'
14 show 14 show
15 ClassElement, 15 ClassElement,
16 Element, 16 Element,
17 FunctionElement, 17 FunctionElement,
18 MixinApplicationElement, 18 MixinApplicationElement,
19 TypedefElement, 19 TypedefElement,
20 VariableElement; 20 FieldElement;
21 import 'js_backend/backend.dart' show JavaScriptBackend; 21 import 'js_backend/backend.dart' show JavaScriptBackend;
22 import 'ordered_typeset.dart'; 22 import 'ordered_typeset.dart';
23 import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask; 23 import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask;
24 import 'universe/class_set.dart'; 24 import 'universe/class_set.dart';
25 import 'universe/function_set.dart' show FunctionSet; 25 import 'universe/function_set.dart' show FunctionSet;
26 import 'universe/selector.dart' show Selector; 26 import 'universe/selector.dart' show Selector;
27 import 'universe/side_effects.dart' show SideEffects; 27 import 'universe/side_effects.dart' show SideEffects;
28 import 'util/enumset.dart'; 28 import 'util/enumset.dart';
29 import 'util/util.dart' show Link; 29 import 'util/util.dart' show Link;
30 30
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 /// Returns all resolved typedefs. 257 /// Returns all resolved typedefs.
258 Iterable<TypedefElement> get allTypedefs; 258 Iterable<TypedefElement> get allTypedefs;
259 259
260 /// Returns the single [Element] that matches a call to [selector] on a 260 /// Returns the single [Element] that matches a call to [selector] on a
261 /// receiver of type [mask]. If multiple targets exist, `null` is returned. 261 /// receiver of type [mask]. If multiple targets exist, `null` is returned.
262 Element locateSingleElement(Selector selector, TypeMask mask); 262 Element locateSingleElement(Selector selector, TypeMask mask);
263 263
264 /// Returns the single field that matches a call to [selector] on a 264 /// Returns the single field that matches a call to [selector] on a
265 /// receiver of type [mask]. If multiple targets exist or the single target 265 /// receiver of type [mask]. If multiple targets exist or the single target
266 /// is not a field, `null` is returned. 266 /// is not a field, `null` is returned.
267 VariableElement locateSingleField(Selector selector, TypeMask mask); 267 FieldElement locateSingleField(Selector selector, TypeMask mask);
268 268
269 /// Returns the side effects of executing [element]. 269 /// Returns the side effects of executing [element].
270 SideEffects getSideEffectsOfElement(Element element); 270 SideEffects getSideEffectsOfElement(Element element);
271 271
272 /// Returns the side effects of calling [selector] on a receiver of type 272 /// Returns the side effects of calling [selector] on a receiver of type
273 /// [mask]. 273 /// [mask].
274 SideEffects getSideEffectsOfSelector(Selector selector, TypeMask mask); 274 SideEffects getSideEffectsOfSelector(Selector selector, TypeMask mask);
275 275
276 /// Returns `true` if [element] is guaranteed not to throw an exception. 276 /// Returns `true` if [element] is guaranteed not to throw an exception.
277 bool getCannotThrow(Element element); 277 bool getCannotThrow(Element element);
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 bool hasAnyUserDefinedGetter(Selector selector, TypeMask mask) { 1059 bool hasAnyUserDefinedGetter(Selector selector, TypeMask mask) {
1060 return allFunctions.filter(selector, mask).any((each) => each.isGetter); 1060 return allFunctions.filter(selector, mask).any((each) => each.isGetter);
1061 } 1061 }
1062 1062
1063 void registerUsedElement(Element element) { 1063 void registerUsedElement(Element element) {
1064 if (element.isInstanceMember && !element.isAbstract) { 1064 if (element.isInstanceMember && !element.isAbstract) {
1065 allFunctions.add(element); 1065 allFunctions.add(element);
1066 } 1066 }
1067 } 1067 }
1068 1068
1069 VariableElement locateSingleField(Selector selector, TypeMask mask) { 1069 FieldElement locateSingleField(Selector selector, TypeMask mask) {
1070 Element result = locateSingleElement(selector, mask); 1070 Element result = locateSingleElement(selector, mask);
1071 return (result != null && result.isField) ? result : null; 1071 return (result != null && result.isField) ? result : null;
1072 } 1072 }
1073 1073
1074 Element locateSingleElement(Selector selector, TypeMask mask) { 1074 Element locateSingleElement(Selector selector, TypeMask mask) {
1075 mask ??= commonMasks.dynamicType; 1075 mask ??= commonMasks.dynamicType;
1076 return mask.locateSingleElement(selector, _compiler); 1076 return mask.locateSingleElement(selector, _compiler);
1077 } 1077 }
1078 1078
1079 TypeMask extendMaskIfReachesAll(Selector selector, TypeMask mask) { 1079 TypeMask extendMaskIfReachesAll(Selector selector, TypeMask mask) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 /// Only the class itself is included. 1202 /// Only the class itself is included.
1203 EXACT, 1203 EXACT,
1204 1204
1205 /// The class and all subclasses (transitively) are included. 1205 /// The class and all subclasses (transitively) are included.
1206 SUBCLASS, 1206 SUBCLASS,
1207 1207
1208 /// The class and all classes that implement or subclass it (transitively) 1208 /// The class and all classes that implement or subclass it (transitively)
1209 /// are included. 1209 /// are included.
1210 SUBTYPE, 1210 SUBTYPE,
1211 } 1211 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/types_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698