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

Side by Side Diff: pkg/compiler/lib/src/resolution/registry.dart

Issue 1568213003: Add EnumSet. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.resolution.registry; 5 library dart2js.resolution.registry;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' show 8 import '../common/backend_api.dart' show
9 Backend, 9 Backend,
10 ForeignResolver; 10 ForeignResolver;
(...skipping 18 matching lines...) Expand all
29 import '../universe/call_structure.dart' show 29 import '../universe/call_structure.dart' show
30 CallStructure; 30 CallStructure;
31 import '../universe/selector.dart' show 31 import '../universe/selector.dart' show
32 Selector; 32 Selector;
33 import '../universe/use.dart' show 33 import '../universe/use.dart' show
34 DynamicUse, 34 DynamicUse,
35 StaticUse, 35 StaticUse,
36 TypeUse; 36 TypeUse;
37 import '../universe/world_impact.dart' show 37 import '../universe/world_impact.dart' show
38 WorldImpactBuilder; 38 WorldImpactBuilder;
39 import '../world.dart' show World; 39 import '../util/enumset.dart' show
40 EnumSet;
41 import '../world.dart' show
42 World;
40 43
41 import 'send_structure.dart'; 44 import 'send_structure.dart';
42 45
43 import 'members.dart' show 46 import 'members.dart' show
44 ResolverVisitor; 47 ResolverVisitor;
45 import 'tree_elements.dart' show 48 import 'tree_elements.dart' show
46 TreeElementMapping; 49 TreeElementMapping;
47 50
48 class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder { 51 class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder {
49 final String name; 52 final String name;
50 Setlet<Feature> _features; 53 EnumSet<Feature> _features;
51 Setlet<MapLiteralUse> _mapLiterals; 54 Setlet<MapLiteralUse> _mapLiterals;
52 Setlet<ListLiteralUse> _listLiterals; 55 Setlet<ListLiteralUse> _listLiterals;
53 Setlet<String> _constSymbolNames; 56 Setlet<String> _constSymbolNames;
54 Setlet<ConstantExpression> _constantLiterals; 57 Setlet<ConstantExpression> _constantLiterals;
55 58
56 _ResolutionWorldImpact(this.name); 59 _ResolutionWorldImpact(this.name);
57 60
58 void registerMapLiteral(MapLiteralUse mapLiteralUse) { 61 void registerMapLiteral(MapLiteralUse mapLiteralUse) {
59 assert(mapLiteralUse != null); 62 assert(mapLiteralUse != null);
60 if (_mapLiterals == null) { 63 if (_mapLiterals == null) {
(...skipping 30 matching lines...) Expand all
91 } 94 }
92 95
93 @override 96 @override
94 Iterable<String> get constSymbolNames { 97 Iterable<String> get constSymbolNames {
95 return _constSymbolNames != null 98 return _constSymbolNames != null
96 ? _constSymbolNames : const <String>[]; 99 ? _constSymbolNames : const <String>[];
97 } 100 }
98 101
99 void registerFeature(Feature feature) { 102 void registerFeature(Feature feature) {
100 if (_features == null) { 103 if (_features == null) {
101 _features = new Setlet<Feature>(); 104 _features = new EnumSet<Feature>();
102 } 105 }
103 _features.add(feature); 106 _features.add(feature);
104 } 107 }
105 108
106 @override 109 @override
107 Iterable<Feature> get features { 110 Iterable<Feature> get features {
108 return _features != null ? _features : const <Feature>[]; 111 return _features != null
112 ? _features.iterable(Feature.values) : const <Feature>[];
109 } 113 }
110 114
111 void registerConstantLiteral(ConstantExpression constant) { 115 void registerConstantLiteral(ConstantExpression constant) {
112 if (_constantLiterals == null) { 116 if (_constantLiterals == null) {
113 _constantLiterals = new Setlet<ConstantExpression>(); 117 _constantLiterals = new Setlet<ConstantExpression>();
114 } 118 }
115 _constantLiterals.add(constant); 119 _constantLiterals.add(constant);
116 } 120 }
117 121
118 Iterable<ConstantExpression> get constantLiterals { 122 Iterable<ConstantExpression> get constantLiterals {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 @override 417 @override
414 void registerInstantiatedType(InterfaceType type) { 418 void registerInstantiatedType(InterfaceType type) {
415 registry.registerInstantiation(type); 419 registry.registerInstantiation(type);
416 } 420 }
417 421
418 @override 422 @override
419 DartType resolveTypeFromString(Node node, String typeName) { 423 DartType resolveTypeFromString(Node node, String typeName) {
420 return visitor.resolveTypeFromString(node, typeName); 424 return visitor.resolveTypeFromString(node, typeName);
421 } 425 }
422 } 426 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/universe/class_set.dart » ('j') | pkg/compiler/lib/src/universe/class_set.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698