| OLD | NEW |
| 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 Loading... |
| 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 } | |
| OLD | NEW |