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

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

Issue 2865953003: Move ResolutionWorkItem to resolution_strategy.dart (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_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.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; 9 import 'common/resolution.dart' show Resolution;
10 import 'common/tasks.dart' show CompilerTask; 10 import 'common/tasks.dart' show CompilerTask;
11 import 'common/work.dart' show WorkItem; 11 import 'common/work.dart' show WorkItem;
12 import 'common.dart'; 12 import 'common.dart';
13 import 'common_elements.dart' show ElementEnvironment; 13 import 'common_elements.dart' show ElementEnvironment;
14 import 'constants/values.dart'; 14 import 'constants/values.dart';
15 import 'compiler.dart' show Compiler; 15 import 'compiler.dart' show Compiler;
16 import 'options.dart'; 16 import 'options.dart';
17 import 'elements/elements.dart' show AnalyzableElement, MemberElement; 17 import 'elements/elements.dart' show MemberElement;
18 import 'elements/entities.dart'; 18 import 'elements/entities.dart';
19 import 'elements/resolution_types.dart' show ResolutionTypedefType; 19 import 'elements/resolution_types.dart' show ResolutionTypedefType;
20 import 'elements/types.dart'; 20 import 'elements/types.dart';
21 import 'universe/world_builder.dart'; 21 import 'universe/world_builder.dart';
22 import 'universe/use.dart' 22 import 'universe/use.dart'
23 show 23 show
24 ConstantUse, 24 ConstantUse,
25 DynamicUse, 25 DynamicUse,
26 StaticUse, 26 StaticUse,
27 StaticUseKind, 27 StaticUseKind,
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 final Entity element; 602 final Entity element;
603 final DeferredActionFunction action; 603 final DeferredActionFunction action;
604 604
605 DeferredAction(this.element, this.action); 605 DeferredAction(this.element, this.action);
606 } 606 }
607 607
608 /// Interface for creating work items for enqueued member entities. 608 /// Interface for creating work items for enqueued member entities.
609 abstract class WorkItemBuilder { 609 abstract class WorkItemBuilder {
610 WorkItem createWorkItem(MemberEntity entity); 610 WorkItem createWorkItem(MemberEntity entity);
611 } 611 }
612
613 /// Builder that creates work item necessary for the resolution of a
614 /// [MemberElement].
615 class ResolutionWorkItemBuilder extends WorkItemBuilder {
616 final Resolution _resolution;
617
618 ResolutionWorkItemBuilder(this._resolution);
619
620 @override
621 WorkItem createWorkItem(MemberElement element) {
622 assert(invariant(element, element.isDeclaration));
623 if (element.isMalformed) return null;
624
625 assert(invariant(element, element is AnalyzableElement,
626 message: 'Element $element is not analyzable.'));
627 return _resolution.createWorkItem(element);
628 }
629 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698