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

Side by Side Diff: pkg/compiler/lib/src/js_backend/enqueuer.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
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.js.enqueue; 5 library dart2js.js.enqueue;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common/codegen.dart' show CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenWorkItem;
10 import '../common/tasks.dart' show CompilerTask; 10 import '../common/tasks.dart' show CompilerTask;
(...skipping 13 matching lines...) Expand all
24 ConstantUse, 24 ConstantUse,
25 DynamicUse, 25 DynamicUse,
26 StaticUse, 26 StaticUse,
27 StaticUseKind, 27 StaticUseKind,
28 TypeUse, 28 TypeUse,
29 TypeUseKind; 29 TypeUseKind;
30 import '../universe/world_impact.dart' 30 import '../universe/world_impact.dart'
31 show ImpactUseCase, WorldImpact, WorldImpactVisitor; 31 show ImpactUseCase, WorldImpact, WorldImpactVisitor;
32 import '../util/enumset.dart'; 32 import '../util/enumset.dart';
33 import '../util/util.dart' show Setlet; 33 import '../util/util.dart' show Setlet;
34 import '../world.dart' show ClosedWorld;
34 35
35 /// [Enqueuer] which is specific to code generation. 36 /// [Enqueuer] which is specific to code generation.
36 class CodegenEnqueuer extends EnqueuerImpl { 37 class CodegenEnqueuer extends EnqueuerImpl {
37 final String name; 38 final String name;
38 final EnqueuerStrategy strategy; 39 final EnqueuerStrategy strategy;
39 40
40 Set<ClassEntity> _recentClasses = new Setlet<ClassEntity>(); 41 Set<ClassEntity> _recentClasses = new Setlet<ClassEntity>();
41 bool _recentConstants = false; 42 bool _recentConstants = false;
42 final CodegenWorldBuilderImpl _worldBuilder; 43 final CodegenWorldBuilderImpl _worldBuilder;
43 final WorkItemBuilder _workItemBuilder; 44 final WorkItemBuilder _workItemBuilder;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 @override 264 @override
264 Iterable<MemberEntity> get processedEntities => _processedEntities; 265 Iterable<MemberEntity> get processedEntities => _processedEntities;
265 266
266 @override 267 @override
267 Iterable<ClassEntity> get processedClasses => _worldBuilder.processedClasses; 268 Iterable<ClassEntity> get processedClasses => _worldBuilder.processedClasses;
268 } 269 }
269 270
270 /// Builder that creates the work item necessary for the code generation of a 271 /// Builder that creates the work item necessary for the code generation of a
271 /// [MemberElement]. 272 /// [MemberElement].
272 class CodegenWorkItemBuilder extends WorkItemBuilder { 273 class CodegenWorkItemBuilder extends WorkItemBuilder {
273 JavaScriptBackend _backend; 274 final JavaScriptBackend _backend;
274 CompilerOptions _options; 275 final ClosedWorld _closedWorld;
276 final CompilerOptions _options;
275 277
276 CodegenWorkItemBuilder(this._backend, this._options); 278 CodegenWorkItemBuilder(this._backend, this._closedWorld, this._options);
277 279
278 @override 280 @override
279 WorkItem createWorkItem(MemberElement element) { 281 WorkItem createWorkItem(MemberElement element) {
280 assert(invariant(element, element.isDeclaration)); 282 assert(invariant(element, element.isDeclaration));
281 // Don't generate code for foreign elements. 283 // Don't generate code for foreign elements.
282 if (_backend.isForeign(element)) return null; 284 if (_backend.isForeign(element)) return null;
283 if (element.isAbstract) return null; 285 if (element.isAbstract) return null;
284 286
285 // Codegen inlines field initializers. It only needs to generate 287 // Codegen inlines field initializers. It only needs to generate
286 // code for checked setters. 288 // code for checked setters.
287 if (element.isField && element.isInstanceMember) { 289 if (element.isField && element.isInstanceMember) {
288 if (!_options.enableTypeAssertions || 290 if (!_options.enableTypeAssertions ||
289 element.enclosingElement.isClosure) { 291 element.enclosingElement.isClosure) {
290 return null; 292 return null;
291 } 293 }
292 } 294 }
293 return new CodegenWorkItem(_backend, element); 295 return new CodegenWorkItem(_backend, _closedWorld, element);
294 } 296 }
295 } 297 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/interceptor_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698