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

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

Issue 2871583002: Pass InterceptorData through ResolutionWorldBuilder and access it through ClosedWorld (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/frontend_strategy.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.codegen; 5 library dart2js.common.codegen;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../elements/elements.dart' 8 import '../elements/elements.dart'
9 show 9 show
10 AsyncMarker, 10 AsyncMarker,
11 ClassElement, 11 ClassElement,
12 LocalFunctionElement, 12 LocalFunctionElement,
13 MemberElement, 13 MemberElement,
14 ResolvedAst; 14 ResolvedAst;
15 import '../elements/entities.dart'; 15 import '../elements/entities.dart';
16 import '../elements/types.dart' show DartType, InterfaceType; 16 import '../elements/types.dart' show DartType, InterfaceType;
17 import '../js_backend/backend.dart' show JavaScriptBackend; 17 import '../js_backend/backend.dart' show JavaScriptBackend;
18 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse; 18 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse;
19 import '../universe/world_impact.dart' 19 import '../universe/world_impact.dart'
20 show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor; 20 show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor;
21 import '../util/enumset.dart'; 21 import '../util/enumset.dart';
22 import '../util/util.dart' show Pair, Setlet; 22 import '../util/util.dart' show Pair, Setlet;
23 import '../world.dart' show ClosedWorld;
23 import 'work.dart' show WorkItem; 24 import 'work.dart' show WorkItem;
24 25
25 class CodegenImpact extends WorldImpact { 26 class CodegenImpact extends WorldImpact {
26 const CodegenImpact(); 27 const CodegenImpact();
27 28
28 Iterable<Pair<DartType, DartType>> get typeVariableBoundsSubtypeChecks { 29 Iterable<Pair<DartType, DartType>> get typeVariableBoundsSubtypeChecks {
29 return const <Pair<DartType, DartType>>[]; 30 return const <Pair<DartType, DartType>>[];
30 } 31 }
31 32
32 Iterable<String> get constSymbols => const <String>[]; 33 Iterable<String> get constSymbols => const <String>[];
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 177
177 void registerAsyncMarker(AsyncMarker asyncMarker) { 178 void registerAsyncMarker(AsyncMarker asyncMarker) {
178 worldImpact.registerAsyncMarker(asyncMarker); 179 worldImpact.registerAsyncMarker(asyncMarker);
179 } 180 }
180 } 181 }
181 182
182 /// [WorkItem] used exclusively by the [CodegenEnqueuer]. 183 /// [WorkItem] used exclusively by the [CodegenEnqueuer].
183 class CodegenWorkItem extends WorkItem { 184 class CodegenWorkItem extends WorkItem {
184 CodegenRegistry registry; 185 CodegenRegistry registry;
185 final ResolvedAst resolvedAst; 186 final ResolvedAst resolvedAst;
186 final JavaScriptBackend backend; 187 final JavaScriptBackend _backend;
188 final ClosedWorld _closedWorld;
187 189
188 factory CodegenWorkItem(JavaScriptBackend backend, MemberElement element) { 190 factory CodegenWorkItem(JavaScriptBackend backend, ClosedWorld closedWorld,
191 MemberElement element) {
189 // If this assertion fails, the resolution callbacks of the backend may be 192 // If this assertion fails, the resolution callbacks of the backend may be
190 // missing call of form registry.registerXXX. Alternatively, the code 193 // missing call of form registry.registerXXX. Alternatively, the code
191 // generation could spuriously be adding dependencies on things we know we 194 // generation could spuriously be adding dependencies on things we know we
192 // don't need. 195 // don't need.
193 assert(invariant(element, element.hasResolvedAst, 196 assert(invariant(element, element.hasResolvedAst,
194 message: "$element has no resolved ast.")); 197 message: "$element has no resolved ast."));
195 ResolvedAst resolvedAst = element.resolvedAst; 198 ResolvedAst resolvedAst = element.resolvedAst;
196 return new CodegenWorkItem.internal(resolvedAst, backend); 199 return new CodegenWorkItem.internal(resolvedAst, backend, closedWorld);
197 } 200 }
198 201
199 CodegenWorkItem.internal(ResolvedAst resolvedAst, this.backend) 202 CodegenWorkItem.internal(this.resolvedAst, this._backend, this._closedWorld);
200 : this.resolvedAst = resolvedAst;
201 203
202 MemberElement get element => resolvedAst.element; 204 MemberElement get element => resolvedAst.element;
203 205
204 WorldImpact run() { 206 WorldImpact run() {
205 registry = new CodegenRegistry(element); 207 registry = new CodegenRegistry(element);
206 return backend.codegen(this); 208 return _backend.codegen(this, _closedWorld);
207 } 209 }
208 210
209 String toString() => 'CodegenWorkItem(${resolvedAst.element})'; 211 String toString() => 'CodegenWorkItem(${resolvedAst.element})';
210 } 212 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/frontend_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698