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

Side by Side Diff: pkg/compiler/lib/src/kernel/kernel_strategy.dart

Issue 2850143002: Reuse RuntimeTypesNeedBuilderImpl and _RuntimeTypesNeed for kernel based elements (Closed)
Patch Set: Fix comment Created 3 years, 7 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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.kernel.frontend_strategy; 5 library dart2js.kernel.frontend_strategy;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common_elements.dart'; 9 import '../common_elements.dart';
10 import '../common/backend_api.dart'; 10 import '../common/backend_api.dart';
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 MirrorsDataBuilder createMirrorsDataBuilder() { 92 MirrorsDataBuilder createMirrorsDataBuilder() {
93 return new MirrorsDataBuilderImpl(); 93 return new MirrorsDataBuilderImpl();
94 } 94 }
95 95
96 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( 96 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis(
97 JavaScriptBackend backend) { 97 JavaScriptBackend backend) {
98 return new MirrorsResolutionAnalysisImpl(); 98 return new MirrorsResolutionAnalysisImpl();
99 } 99 }
100 100
101 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { 101 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() {
102 return new RuntimeTypesNeedBuilderImpl(); 102 return new RuntimeTypesNeedBuilderImpl(
103 elementEnvironment, elementMap.types);
103 } 104 }
104 105
105 ResolutionWorldBuilder createResolutionWorldBuilder( 106 ResolutionWorldBuilder createResolutionWorldBuilder(
106 NativeBasicData nativeBasicData, 107 NativeBasicData nativeBasicData,
107 SelectorConstraintsStrategy selectorConstraintsStrategy) { 108 SelectorConstraintsStrategy selectorConstraintsStrategy) {
108 return new KernelResolutionWorldBuilder( 109 return new KernelResolutionWorldBuilder(
109 elementMap, nativeBasicData, selectorConstraintsStrategy); 110 elementMap, nativeBasicData, selectorConstraintsStrategy);
110 } 111 }
111 112
112 WorkItemBuilder createResolutionWorkItemBuilder( 113 WorkItemBuilder createResolutionWorkItemBuilder(
(...skipping 21 matching lines...) Expand all
134 135
135 KernelWorkItem(this._elementMap, this._impactTransformer, this.element); 136 KernelWorkItem(this._elementMap, this._impactTransformer, this.element);
136 137
137 @override 138 @override
138 WorldImpact run() { 139 WorldImpact run() {
139 ResolutionImpact impact = _elementMap.computeWorldImpact(element); 140 ResolutionImpact impact = _elementMap.computeWorldImpact(element);
140 return _impactTransformer.transformResolutionImpact(impact); 141 return _impactTransformer.transformResolutionImpact(impact);
141 } 142 }
142 } 143 }
143 144
144 /// Mock implementation of [RuntimeTypesNeedBuilder].
145 class RuntimeTypesNeedBuilderImpl implements RuntimeTypesNeedBuilder {
146 @override
147 void registerClassUsingTypeVariableExpression(ClassEntity cls) {}
148
149 @override
150 RuntimeTypesNeed computeRuntimeTypesNeed(
151 ResolutionWorldBuilder resolutionWorldBuilder,
152 ClosedWorld closedWorld,
153 DartTypes types,
154 CommonElements commonElements,
155 BackendUsage backendUsage,
156 {bool enableTypeAssertions}) {
157 throw new UnimplementedError(
158 'RuntimeTypesNeedBuilderImpl.computeRuntimeTypesNeed');
159 }
160
161 @override
162 void registerRtiDependency(ClassEntity element, ClassEntity dependency) {}
163 }
164
165 /// Mock implementation of [MirrorsDataImpl]. 145 /// Mock implementation of [MirrorsDataImpl].
166 class MirrorsDataBuilderImpl extends MirrorsDataImpl { 146 class MirrorsDataBuilderImpl extends MirrorsDataImpl {
167 MirrorsDataBuilderImpl() : super(null, null, null); 147 MirrorsDataBuilderImpl() : super(null, null, null);
168 148
169 @override 149 @override
170 void registerUsedMember(MemberEntity member) {} 150 void registerUsedMember(MemberEntity member) {}
171 151
172 @override 152 @override
173 void computeMembersNeededForReflection( 153 void computeMembersNeededForReflection(
174 ResolutionWorldBuilder worldBuilder, ClosedWorld closedWorld) {} 154 ResolutionWorldBuilder worldBuilder, ClosedWorld closedWorld) {}
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void onQueueEmpty(Enqueuer enqueuer, Iterable<ClassEntity> recentClasses) {} 197 void onQueueEmpty(Enqueuer enqueuer, Iterable<ClassEntity> recentClasses) {}
218 198
219 @override 199 @override
220 MirrorsCodegenAnalysis close() { 200 MirrorsCodegenAnalysis close() {
221 throw new UnimplementedError('MirrorsResolutionAnalysisImpl.close'); 201 throw new UnimplementedError('MirrorsResolutionAnalysisImpl.close');
222 } 202 }
223 203
224 @override 204 @override
225 void onResolutionComplete() {} 205 void onResolutionComplete() {}
226 } 206 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698