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

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

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Reinsert missing features uses. Created 4 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | 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.common.registry; 5 library dart2js.common.registry;
6 6
7 import '../dart_types.dart' show InterfaceType;
8 import '../elements/elements.dart' show Element; 7 import '../elements/elements.dart' show Element;
9 import '../enqueue.dart' show Enqueuer;
10 import '../universe/use.dart' show DynamicUse, StaticUse;
11 8
9 // TODO(johnniwinther): Remove this.
12 /// Interface for registration of element dependencies. 10 /// Interface for registration of element dependencies.
13 abstract class Registry { 11 abstract class Registry {
14 // TODO(johnniwinther): Remove this.
15 void registerDependency(Element element) {} 12 void registerDependency(Element element) {}
16
17 bool get isForResolution;
18
19 void registerDynamicUse(DynamicUse staticUse);
20
21 void registerStaticUse(StaticUse staticUse);
22
23 void registerInstantiation(InterfaceType type);
24 } 13 }
25
26 // TODO(johnniwinther): Remove this.
27 class EagerRegistry extends Registry {
28 final String name;
29 final Enqueuer world;
30
31 EagerRegistry(this.name, this.world);
32
33 bool get isForResolution => world.isResolutionQueue;
34
35 @override
36 void registerDynamicUse(DynamicUse dynamicUse) {
37 world.registerDynamicUse(dynamicUse);
38 }
39
40 @override
41 void registerInstantiation(InterfaceType type) {
42 world.registerInstantiatedType(type);
43 }
44
45 @override
46 void registerStaticUse(StaticUse staticUse) {
47 world.registerStaticUse(staticUse);
48 }
49
50 String toString() => name;
51 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698