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

Side by Side Diff: pkg/compiler/lib/src/enqueue.dart

Issue 2868813003: Move ResolutionEnqueuer.hasBeenResolved to Resolver (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/resolution/resolution.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.enqueue; 5 library dart2js.enqueue;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import 'common/resolution.dart' show Resolution;
10 import 'common/tasks.dart' show CompilerTask; 9 import 'common/tasks.dart' show CompilerTask;
11 import 'common/work.dart' show WorkItem; 10 import 'common/work.dart' show WorkItem;
12 import 'common.dart'; 11 import 'common.dart';
13 import 'common_elements.dart' show ElementEnvironment; 12 import 'common_elements.dart' show ElementEnvironment;
14 import 'constants/values.dart'; 13 import 'constants/values.dart';
15 import 'compiler.dart' show Compiler; 14 import 'compiler.dart' show Compiler;
16 import 'options.dart'; 15 import 'options.dart';
17 import 'elements/elements.dart' show MemberElement;
18 import 'elements/entities.dart'; 16 import 'elements/entities.dart';
19 import 'elements/resolution_types.dart' show ResolutionTypedefType; 17 import 'elements/resolution_types.dart' show ResolutionTypedefType;
20 import 'elements/types.dart'; 18 import 'elements/types.dart';
21 import 'universe/world_builder.dart'; 19 import 'universe/world_builder.dart';
22 import 'universe/use.dart' 20 import 'universe/use.dart'
23 show 21 show
24 ConstantUse, 22 ConstantUse,
25 DynamicUse, 23 DynamicUse,
26 StaticUse, 24 StaticUse,
27 StaticUseKind, 25 StaticUseKind,
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 409 }
412 410
413 String toString() => 'Enqueuer($name)'; 411 String toString() => 'Enqueuer($name)';
414 412
415 Iterable<MemberEntity> get processedEntities => _processedEntities; 413 Iterable<MemberEntity> get processedEntities => _processedEntities;
416 414
417 ImpactUseCase get impactUse => IMPACT_USE; 415 ImpactUseCase get impactUse => IMPACT_USE;
418 416
419 bool get isResolutionQueue => true; 417 bool get isResolutionQueue => true;
420 418
421 /// Returns `true` if [element] has been processed by the resolution enqueuer.
422 // TODO(johnniwinther): Remove this together with the resolver.
423 bool hasBeenProcessed(MemberElement element) {
424 assert(invariant(element, element == element.analyzableElement.declaration,
425 message: "Unexpected element $element"));
426 return _processedEntities.contains(element);
427 }
428
429 /// Registers [entity] as processed by the resolution enqueuer. Used only for 419 /// Registers [entity] as processed by the resolution enqueuer. Used only for
430 /// testing. 420 /// testing.
431 void registerProcessedElementInternal(MemberEntity entity) { 421 void registerProcessedElementInternal(MemberEntity entity) {
432 _processedEntities.add(entity); 422 _processedEntities.add(entity);
433 } 423 }
434 424
435 /// Create a [WorkItem] for [entity] and add it to the work list if it has not 425 /// Create a [WorkItem] for [entity] and add it to the work list if it has not
436 /// already been processed. 426 /// already been processed.
437 void _addToWorkList(MemberEntity entity) { 427 void _addToWorkList(MemberEntity entity) {
438 if (_processedEntities.contains(entity)) return; 428 if (_processedEntities.contains(entity)) return;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 final Entity element; 592 final Entity element;
603 final DeferredActionFunction action; 593 final DeferredActionFunction action;
604 594
605 DeferredAction(this.element, this.action); 595 DeferredAction(this.element, this.action);
606 } 596 }
607 597
608 /// Interface for creating work items for enqueued member entities. 598 /// Interface for creating work items for enqueued member entities.
609 abstract class WorkItemBuilder { 599 abstract class WorkItemBuilder {
610 WorkItem createWorkItem(MemberEntity entity); 600 WorkItem createWorkItem(MemberEntity entity);
611 } 601 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698