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

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

Issue 1374243002: Remove Registry arguments from Enqueuer. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/enqueue.dart
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 14b020d0dececdef67c1831c35e48901cb3e362b..b6ecbad9884fb387743da9227aeb1261d1208ae4 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -16,8 +16,6 @@ import 'common/tasks.dart' show
CompilerTask,
DeferredAction,
DeferredTask;
-import 'common/registry.dart' show
- Registry;
import 'common/codegen.dart' show
CodegenWorkItem;
import 'common/resolution.dart' show
@@ -190,11 +188,10 @@ abstract class Enqueuer {
}
// TODO(johnniwinther): Remove the need for passing the [registry].
- void registerInstantiatedType(InterfaceType type, Registry registry,
+ void registerInstantiatedType(InterfaceType type,
{bool mirrorUsage: false}) {
task.measure(() {
ClassElement cls = type.element;
- registry.registerDependency(cls);
cls.ensureResolved(compiler);
universe.registerTypeInstantiation(
type,
@@ -204,7 +201,6 @@ abstract class Enqueuer {
cls, this, compiler.globalDependencies);
});
processInstantiatedClass(cls);
- compiler.backend.registerInstantiatedType(type, registry);
});
}
@@ -271,13 +267,12 @@ abstract class Enqueuer {
}
if (function.name == Identifiers.call &&
!cls.typeVariables.isEmpty) {
- registerCallMethodWithFreeTypeVariables(
- function, compiler.globalDependencies);
+ registerCallMethodWithFreeTypeVariables(function);
}
// If there is a property access with the same name as a method we
// need to emit the method.
if (universe.hasInvokedGetter(function, compiler.world)) {
- registerClosurizedMember(function, compiler.globalDependencies);
+ registerClosurizedMember(function);
addToWorkList(function);
return;
}
@@ -402,7 +397,10 @@ abstract class Enqueuer {
includedEnclosing: enclosingWasIncluded)) {
logEnqueueReflectiveAction(ctor);
ClassElement cls = ctor.declaration.enclosingClass;
- registerInstantiatedType(cls.rawType, compiler.mirrorDependencies,
+ compiler.backend.registerInstantiatedType(
+ cls.rawType,
+ this,
+ compiler.mirrorDependencies,
mirrorUsage: true);
registerStaticUse(ctor.declaration);
}
@@ -453,7 +451,10 @@ abstract class Enqueuer {
logEnqueueReflectiveAction(cls, "register");
ClassElement decl = cls.declaration;
decl.ensureResolved(compiler);
- registerInstantiatedType(decl.rawType, compiler.mirrorDependencies,
+ compiler.backend.registerInstantiatedType(
+ decl.rawType,
+ this,
+ compiler.mirrorDependencies,
mirrorUsage: true);
}
// If the class is never instantiated, we know nothing of it can possibly
@@ -484,7 +485,10 @@ abstract class Enqueuer {
if (compiler.backend.referencedFromMirrorSystem(cls)) {
logEnqueueReflectiveAction(cls);
cls.ensureResolved(compiler);
- registerInstantiatedType(cls.rawType, compiler.mirrorDependencies,
+ compiler.backend.registerInstantiatedType(
+ cls.rawType,
+ this,
+ compiler.mirrorDependencies,
mirrorUsage: true);
}
}
@@ -582,7 +586,7 @@ abstract class Enqueuer {
processInstanceMembers(methodName, (Element member) {
if (universeSelector.appliesUnnamed(member, compiler.world)) {
if (member.isFunction && selector.isGetter) {
- registerClosurizedMember(member, compiler.globalDependencies);
+ registerClosurizedMember(member);
}
if (member.isField && member.enclosingClass.isNative) {
if (selector.isGetter || selector.isCall) {
@@ -610,7 +614,7 @@ abstract class Enqueuer {
if (selector.isGetter) {
processInstanceFunctions(methodName, (Element member) {
if (universeSelector.appliesUnnamed(member, compiler.world)) {
- registerClosurizedMember(member, compiler.globalDependencies);
+ registerClosurizedMember(member);
return true;
}
return false;
@@ -688,33 +692,24 @@ abstract class Enqueuer {
!type.element.enclosingElement.isTypedef);
}
- void registerCallMethodWithFreeTypeVariables(
- Element element,
- Registry registry) {
+ void registerCallMethodWithFreeTypeVariables(Element element) {
compiler.backend.registerCallMethodWithFreeTypeVariables(
- element, this, registry);
+ element, this, compiler.globalDependencies);
universe.callMethodsWithFreeTypeVariables.add(element);
}
- void registerClosurizedMember(TypedElement element, Registry registry) {
+ void registerClosurizedMember(TypedElement element) {
assert(element.isInstanceMember);
- registerClosureIfFreeTypeVariables(element, registry);
- compiler.backend.registerBoundClosure(this);
- universe.closurizedMembers.add(element);
- }
-
- void registerClosureIfFreeTypeVariables(TypedElement element,
- Registry registry) {
if (element.computeType(compiler).containsTypeVariables) {
compiler.backend.registerClosureWithFreeTypeVariables(
- element, this, registry);
- universe.closuresWithFreeTypeVariables.add(element);
+ element, this, compiler.globalDependencies);
}
+ compiler.backend.registerBoundClosure(this);
+ universe.closurizedMembers.add(element);
}
- void registerClosure(LocalFunctionElement element, Registry registry) {
+ void registerClosure(LocalFunctionElement element) {
universe.allClosures.add(element);
- registerClosureIfFreeTypeVariables(element, registry);
}
void forEach(void f(WorkItem work)) {
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698