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

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

Issue 2265473004: Introduce "CommonElements" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cl Created 4 years, 4 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 | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.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.resolution; 5 library dart2js.resolution;
6 6
7 import 'dart:collection' show Queue; 7 import 'dart:collection' show Queue;
8 8
9 import '../common.dart'; 9 import '../common.dart';
10 import '../common/names.dart' show Identifiers; 10 import '../common/names.dart' show Identifiers;
11 import '../common/resolution.dart' 11 import '../common/resolution.dart'
12 show ParsingContext, Resolution, ResolutionImpact, Target; 12 show ParsingContext, Resolution, ResolutionImpact, Target;
13 import '../common/tasks.dart' show CompilerTask, Measurer; 13 import '../common/tasks.dart' show CompilerTask, Measurer;
14 import '../compile_time_constants.dart' show ConstantCompiler; 14 import '../compile_time_constants.dart' show ConstantCompiler;
15 import '../constants/expressions.dart' 15 import '../constants/expressions.dart'
16 show 16 show
17 ConstantExpression, 17 ConstantExpression,
18 ConstantExpressionKind, 18 ConstantExpressionKind,
19 ConstructedConstantExpression, 19 ConstructedConstantExpression,
20 ErroneousConstantExpression; 20 ErroneousConstantExpression;
21 import '../constants/values.dart' show ConstantValue; 21 import '../constants/values.dart' show ConstantValue;
22 import '../core_types.dart' show CoreClasses, CoreTypes; 22 import '../core_types.dart' show CoreClasses, CoreTypes, CommonElements;
23 import '../dart_types.dart'; 23 import '../dart_types.dart';
24 import '../elements/elements.dart'; 24 import '../elements/elements.dart';
25 import '../elements/modelx.dart' 25 import '../elements/modelx.dart'
26 show 26 show
27 BaseClassElementX, 27 BaseClassElementX,
28 BaseFunctionElementX, 28 BaseFunctionElementX,
29 ConstructorElementX, 29 ConstructorElementX,
30 FieldElementX, 30 FieldElementX,
31 FunctionElementX, 31 FunctionElementX,
32 GetterElementX, 32 GetterElementX,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 ResolverTask( 69 ResolverTask(
70 this.resolution, this.constantCompiler, this.world, Measurer measurer) 70 this.resolution, this.constantCompiler, this.world, Measurer measurer)
71 : super(measurer); 71 : super(measurer);
72 72
73 String get name => 'Resolver'; 73 String get name => 'Resolver';
74 74
75 DiagnosticReporter get reporter => resolution.reporter; 75 DiagnosticReporter get reporter => resolution.reporter;
76 Target get target => resolution.target; 76 Target get target => resolution.target;
77 CoreTypes get coreTypes => resolution.coreTypes; 77 CoreTypes get coreTypes => resolution.coreTypes;
78 CoreClasses get coreClasses => resolution.coreClasses; 78 CoreClasses get coreClasses => resolution.coreClasses;
79 CommonElements get commonElements => resolution.commonElements;
79 ParsingContext get parsingContext => resolution.parsingContext; 80 ParsingContext get parsingContext => resolution.parsingContext;
80 CompilerOptions get options => resolution.options; 81 CompilerOptions get options => resolution.options;
81 ResolutionEnqueuer get enqueuer => resolution.enqueuer; 82 ResolutionEnqueuer get enqueuer => resolution.enqueuer;
82 83
83 ResolutionImpact resolve(Element element) { 84 ResolutionImpact resolve(Element element) {
84 return measure(() { 85 return measure(() {
85 if (Elements.isMalformed(element)) { 86 if (Elements.isMalformed(element)) {
86 // TODO(johnniwinther): Add a predicate for this. 87 // TODO(johnniwinther): Add a predicate for this.
87 assert(invariant(element, element is! ErroneousElement, 88 assert(invariant(element, element is! ErroneousElement,
88 message: "Element $element expected to have parse errors.")); 89 message: "Element $element expected to have parse errors."));
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 () => measure(() { 628 () => measure(() {
628 assert(element.resolutionState == STATE_NOT_STARTED); 629 assert(element.resolutionState == STATE_NOT_STARTED);
629 element.resolutionState = STATE_STARTED; 630 element.resolutionState = STATE_STARTED;
630 Node tree = element.parseNode(parsingContext); 631 Node tree = element.parseNode(parsingContext);
631 loadSupertypes(element, tree); 632 loadSupertypes(element, tree);
632 633
633 ClassResolverVisitor visitor = 634 ClassResolverVisitor visitor =
634 new ClassResolverVisitor(resolution, element, registry); 635 new ClassResolverVisitor(resolution, element, registry);
635 visitor.visit(tree); 636 visitor.visit(tree);
636 element.resolutionState = STATE_DONE; 637 element.resolutionState = STATE_DONE;
637 resolution.onClassResolved(element);
638 pendingClassesToBePostProcessed.add(element); 638 pendingClassesToBePostProcessed.add(element);
639 })); 639 }));
640 if (element.isPatched) { 640 if (element.isPatched) {
641 // Ensure handling patch after origin. 641 // Ensure handling patch after origin.
642 element.patch.ensureResolved(resolution); 642 element.patch.ensureResolved(resolution);
643 } 643 }
644 } else { 644 } else {
645 // Handle patch classes: 645 // Handle patch classes:
646 element.resolutionState = STATE_STARTED; 646 element.resolutionState = STATE_STARTED;
647 // Ensure handling origin before patch. 647 // Ensure handling origin before patch.
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 TreeElements get treeElements { 1122 TreeElements get treeElements {
1123 assert(invariant(this, _treeElements != null, 1123 assert(invariant(this, _treeElements != null,
1124 message: "TreeElements have not been computed for $this.")); 1124 message: "TreeElements have not been computed for $this."));
1125 return _treeElements; 1125 return _treeElements;
1126 } 1126 }
1127 1127
1128 void reuseElement() { 1128 void reuseElement() {
1129 _treeElements = null; 1129 _treeElements = null;
1130 } 1130 }
1131 } 1131 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698