OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library fletchc.fletch_codegen_registry; | 5 library fletchc.fletch_codegen_registry; |
6 | 6 |
7 import 'package:compiler/src/compiler.dart' show | |
8 GlobalDependencyRegistry; | |
9 | |
10 import 'package:compiler/src/common/codegen.dart' show | |
11 CodegenRegistry; | |
12 | |
13 import 'package:compiler/src/common/registry.dart' show | |
14 Registry; | |
15 | |
16 import 'package:compiler/src/universe/selector.dart' show | 7 import 'package:compiler/src/universe/selector.dart' show |
17 Selector; | 8 Selector; |
18 | 9 |
19 import 'package:compiler/src/universe/use.dart' show | |
20 DynamicUse, | |
21 StaticUse; | |
22 | |
23 import 'package:compiler/src/elements/elements.dart' show | 10 import 'package:compiler/src/elements/elements.dart' show |
24 ClassElement, | 11 ClassElement, |
25 Element, | 12 Element, |
26 FunctionElement, | 13 FunctionElement, |
27 LocalElement; | 14 LocalElement; |
28 | 15 |
29 import 'package:compiler/src/dart_types.dart' show | 16 import 'package:compiler/src/dart_types.dart' show |
30 DartType, | 17 DartType, |
31 InterfaceType; | 18 InterfaceType; |
32 | 19 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 /// The result of getting a super instance function | 59 /// The result of getting a super instance function |
73 superTearOff, | 60 superTearOff, |
74 } | 61 } |
75 | 62 |
76 class FletchRegistry { | 63 class FletchRegistry { |
77 final FletchEnqueuer world; | 64 final FletchEnqueuer world; |
78 | 65 |
79 FletchRegistry(FletchCompilerImplementation compiler) | 66 FletchRegistry(FletchCompilerImplementation compiler) |
80 : world = compiler.enqueuer.codegen; | 67 : world = compiler.enqueuer.codegen; |
81 | 68 |
82 void registerStaticUse(StaticUse staticUse) { | 69 void registerStaticInvocation(FunctionElement function) { |
83 // TODO(ahe): Call a different method. | 70 // TODO(ahe): Call a different method. |
84 world.registerStaticUse(staticUse); | 71 world.registerStaticInvocation(function); |
85 } | 72 } |
86 | 73 |
87 void registerInstantiatedClass(ClassElement element) { | 74 void registerInstantiatedClass(ClassElement element) { |
88 world.registerInstantiatedType(element.rawType); | 75 world.registerInstantiatedType(element.rawType); |
89 } | 76 } |
90 | 77 |
91 void registerDynamicUse(Selector selector) { | 78 void registerDynamicSelector(Selector selector) { |
92 world.registerDynamicUse(new DynamicUse(selector, null)); | 79 world.registerDynamicSelector(selector); |
93 } | 80 } |
94 | 81 |
95 void registerInstantiatedType(InterfaceType type) { | 82 void registerInstantiatedType(InterfaceType type) { |
96 world.registerInstantiatedType(type); | 83 world.registerInstantiatedType(type); |
97 } | 84 } |
98 | 85 |
99 void registerIsCheck(DartType type) { | 86 void registerIsCheck(DartType type) { |
100 world.registerIsCheck(type); | 87 world.registerIsCheck(type); |
101 } | 88 } |
102 | 89 |
(...skipping 14 matching lines...) Expand all Loading... |
117 assert(function.isInstanceMember); | 104 assert(function.isInstanceMember); |
118 assert(function.name == "call"); | 105 assert(function.name == "call"); |
119 break; | 106 break; |
120 | 107 |
121 case ClosureKind.localFunction: | 108 case ClosureKind.localFunction: |
122 assert(function.memberContext != function); | 109 assert(function.memberContext != function); |
123 } | 110 } |
124 world.dynamicCallEnqueuer.enqueueClosure(function, kind); | 111 world.dynamicCallEnqueuer.enqueueClosure(function, kind); |
125 } | 112 } |
126 } | 113 } |
OLD | NEW |