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

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 15987007: Revert r23380, some browser tests fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/enqueue.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/enqueue.dart (revision 23381)
+++ sdk/lib/_internal/compiler/implementation/enqueue.dart (working copy)
@@ -87,8 +87,6 @@
final Function itemCompilationContextCreator;
final Map<String, Link<Element>> instanceMembersByName
= new Map<String, Link<Element>>();
- final Map<String, Link<Element>> instanceFunctionsByName
- = new Map<String, Link<Element>>();
final Set<ClassElement> seenClasses = new Set<ClassElement>();
final Universe universe = new Universe();
@@ -211,24 +209,20 @@
if (member.name == Compiler.NO_SUCH_METHOD) {
enableNoSuchMethod(member);
}
+ if (universe.hasInvocation(member, compiler)) {
+ return addToWorkList(member);
+ }
// If there is a property access with the same name as a method we
// need to emit the method.
if (universe.hasInvokedGetter(member, compiler)) {
- // We will emit a closure, so make sure the bound closure class is
+ // We will emit a closure, so make sure the closure class is
// generated.
- registerInstantiatedClass(compiler.boundClosureClass,
+ compiler.closureClass.ensureResolved(compiler);
+ registerInstantiatedClass(compiler.closureClass,
// Precise dependency is not important here.
compiler.globalDependencies);
return addToWorkList(member);
}
- // Store the member in [instanceFunctionsByName] to catch
- // getters on the function.
- Link<Element> members = instanceFunctionsByName.putIfAbsent(
- memberName, () => const Link<Element>());
- instanceFunctionsByName[memberName] = members.prepend(member);
- if (universe.hasInvocation(member, compiler)) {
- return addToWorkList(member);
- }
} else if (member.kind == ElementKind.GETTER) {
if (universe.hasInvokedGetter(member, compiler)) {
return addToWorkList(member);
@@ -392,28 +386,18 @@
void registerNewSymbol(TreeElements elements) {
}
- processLink(Map<String, Link<Element>> map,
- SourceString n,
- bool f(Element e)) {
+ processInstanceMembers(SourceString n, bool f(Element e)) {
String memberName = n.slowToString();
- Link<Element> members = map[memberName];
+ Link<Element> members = instanceMembersByName[memberName];
if (members != null) {
LinkBuilder<Element> remaining = new LinkBuilder<Element>();
for (; !members.isEmpty; members = members.tail) {
if (!f(members.head)) remaining.addLast(members.head);
}
- map[memberName] = remaining.toLink();
+ instanceMembersByName[memberName] = remaining.toLink();
}
}
- processInstanceMembers(SourceString n, bool f(Element e)) {
- processLink(instanceMembersByName, n, f);
- }
-
- processInstanceFunctions(SourceString n, bool f(Element e)) {
- processLink(instanceFunctionsByName, n, f);
- }
-
void handleUnseenSelector(SourceString methodName, Selector selector) {
processInstanceMembers(methodName, (Element member) {
if (selector.appliesUnnamed(member, compiler)) {
@@ -440,19 +424,6 @@
}
return false;
});
- if (selector.isGetter()) {
- processInstanceFunctions(methodName, (Element member) {
- if (selector.appliesUnnamed(member, compiler)) {
- // We will emit a closure, so make sure the bound closure class is
- // generated.
- registerInstantiatedClass(compiler.boundClosureClass,
- // Precise dependency is not important here.
- compiler.globalDependencies);
- return true;
- }
- return false;
- });
- }
}
/**
@@ -468,8 +439,6 @@
void registerGetOfStaticFunction(FunctionElement element) {
registerStaticUse(element);
- registerInstantiatedClass(compiler.closureClass,
- compiler.globalDependencies);
universe.staticFunctionsNeedingGetter.add(element);
}

Powered by Google App Engine
This is Rietveld 408576698