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

Unified Diff: pkg/compiler/lib/src/resolution/resolution.dart

Issue 1376863004: Avoid eager enqueueing from resolution (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update minimal_resolution_test. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/resolution/resolution.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index 4a3118bf585f45f0a27fc95b2ba84f6707038589..943f75af3ddf2d2f99ae78b4a8fac0bea9f6561d 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -10,7 +10,8 @@ import '../common/names.dart' show
Identifiers;
import '../common/resolution.dart' show
Parsing,
- Resolution;
+ Resolution,
+ ResolutionWorldImpact;
import '../common/tasks.dart' show
CompilerTask,
DeferredAction;
@@ -76,14 +77,14 @@ class ResolverTask extends CompilerTask {
Parsing get parsing => compiler.parsing;
- WorldImpact resolve(Element element) {
+ ResolutionWorldImpact resolve(Element element) {
return measure(() {
if (Elements.isErroneous(element)) {
// TODO(johnniwinther): Add a predicate for this.
assert(invariant(element, element is! ErroneousElement,
message: "Element $element expected to have parse errors."));
_ensureTreeElements(element);
- return const WorldImpact();
+ return const ResolutionWorldImpact();
}
WorldImpact processMetadata([WorldImpact result]) {
@@ -107,7 +108,7 @@ class ResolverTask extends CompilerTask {
if (element.isClass) {
ClassElement cls = element;
cls.ensureResolved(resolution);
- return processMetadata(const WorldImpact());
+ return processMetadata(const ResolutionWorldImpact());
} else if (element.isTypedef) {
TypedefElement typdef = element;
return processMetadata(resolveTypedef(typdef));
@@ -284,13 +285,13 @@ class ResolverTask extends CompilerTask {
WorldImpact resolveMethodElement(FunctionElementX element) {
assert(invariant(element, element.isDeclaration));
return compiler.withCurrentElement(element, () {
- if (compiler.enqueuer.resolution.hasBeenResolved(element)) {
+ if (compiler.enqueuer.resolution.hasBeenProcessed(element)) {
// TODO(karlklose): Remove the check for [isConstructor]. [elememts]
// should never be non-null, not even for constructors.
assert(invariant(element, element.isConstructor,
message: 'Non-constructor element $element '
'has already been analyzed.'));
- return const WorldImpact();
+ return const ResolutionWorldImpact();
}
if (element.isSynthesized) {
if (element.isGenerativeConstructor) {
@@ -310,7 +311,7 @@ class ResolverTask extends CompilerTask {
} else {
assert(element.isDeferredLoaderGetter || element.isErroneous);
_ensureTreeElements(element);
- return const WorldImpact();
+ return const ResolutionWorldImpact();
}
} else {
element.parseNode(resolution.parsing);
@@ -715,7 +716,7 @@ class ResolverTask extends CompilerTask {
// mixin application has been performed.
// TODO(johnniwinther): Obtain the [TreeElements] for [member]
// differently.
- if (compiler.enqueuer.resolution.hasBeenResolved(member)) {
+ if (compiler.enqueuer.resolution.hasBeenProcessed(member)) {
checkMixinSuperUses(
member.resolvedAst.elements,
mixinApplication,
@@ -992,7 +993,7 @@ class ResolverTask extends CompilerTask {
}
WorldImpact resolveTypedef(TypedefElementX element) {
- if (element.isResolved) return const WorldImpact();
+ if (element.isResolved) return const ResolutionWorldImpact();
compiler.world.allTypedefs.add(element);
return _resolveTypeDeclaration(element, () {
ResolutionRegistry registry = new ResolutionRegistry(
@@ -1040,7 +1041,7 @@ class ResolverTask extends CompilerTask {
// and the annotated element instead. This will allow the backend to
// retrieve the backend constant and only register metadata on the
// elements for which it is needed. (Issue 17732).
- registry.registerMetadataConstant(annotation, annotatedElement);
+ registry.registerMetadataConstant(annotation);
annotation.resolutionState = STATE_DONE;
}));
}

Powered by Google App Engine
This is Rietveld 408576698