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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart

Issue 119183003: Revert revision 31272, some unit tests fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/inferrer/type_graph_inferrer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart (revision 31272)
+++ sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart (working copy)
@@ -59,8 +59,9 @@
final Map<Node, TypeInformation> allocatedLists =
new Map<Node, TypeInformation>();
- /// Closures found during the analysis.
- final Set<TypeInformation> allocatedClosures = new Set<TypeInformation>();
+ /// [ClosureTypeInformation] for allocated closures.
+ final Map<Node, TypeInformation> allocatedClosures =
+ new Map<Node, TypeInformation>();
/// Cache of [ConcreteTypeInformation].
final Map<TypeMask, TypeInformation> concreteTypes =
@@ -306,9 +307,8 @@
}
TypeInformation allocateClosure(Node node, Element element) {
- TypeInformation result = new ClosureTypeInformation(node, element);
- allocatedClosures.add(result);
- return result;
+ return allocatedClosures[node] =
+ new ClosureTypeInformation(node, element);
}
TypeInformation allocateMap(TypeInformation keyType,
@@ -486,10 +486,8 @@
workQueue.add(info.elementType);
});
- types.allocatedClosures.forEach((info) {
- ClosureTracerVisitor tracer = info is ClosureTypeInformation
- ? new ClosureTracerVisitor(info.element, info, this)
- : new StaticTearOffClosureTracerVisitor(info.element, info, this);
+ types.allocatedClosures.values.forEach((ClosureTypeInformation info) {
+ ClosureTracerVisitor tracer = new ClosureTracerVisitor(info, this);
tracer.run();
if (!tracer.continueAnalyzing) return;
FunctionElement element = info.element;
@@ -628,7 +626,7 @@
void buildWorkQueue() {
workQueue.addAll(types.typeInformations.values);
workQueue.addAll(types.allocatedTypes);
- workQueue.addAll(types.allocatedClosures);
+ workQueue.addAll(types.allocatedClosures.values);
workQueue.addAll(allocatedCalls);
}
@@ -661,14 +659,11 @@
info.closurizedCount--;
} else {
info.closurizedCount++;
- if (Elements.isStaticOrTopLevel(callee)) {
- types.allocatedClosures.add(info);
- }
FunctionElement function = callee.implementation;
FunctionSignature signature = function.computeSignature(compiler);
signature.forEachParameter((Element parameter) {
ElementTypeInformation info = types.getInferredTypeOf(parameter);
- info.giveUp(this, clearAssignments: false);
+ info.giveUp(this);
if (addToQueue) workQueue.addAll(info.users);
});
}

Powered by Google App Engine
This is Rietveld 408576698