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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10834358: Remove cached constructor elements from the resolver. They are already stored in the resolution wor… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 8e7b7a3edb9f7fbcacd6d8e59598e88020f66081..423426887b8dbafb54244fc71f12493839b0efad 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -36,13 +36,7 @@ class TreeElementMapping implements TreeElements {
}
class ResolverTask extends CompilerTask {
- // Caches the elements of analyzed constructors to make them available
- // for inlining in later tasks.
- Map<FunctionElement, TreeElements> constructorElements;
-
- ResolverTask(Compiler compiler)
- : super(compiler),
- constructorElements = new Map<FunctionElement, TreeElements>();
+ ResolverTask(Compiler compiler) : super(compiler);
String get name() => 'Resolver';
@@ -112,10 +106,11 @@ class ResolverTask extends CompilerTask {
TreeElements resolveMethodElement(FunctionElement element) {
return compiler.withCurrentElement(element, () {
bool isConstructor = element.kind === ElementKind.GENERATIVE_CONSTRUCTOR;
- if (constructorElements.containsKey(element)) {
+ TreeElements elements =
+ compiler.enqueuer.resolution.getCachedElements(element);
+ if (elements !== null) {
assert(isConstructor);
- TreeElements elements = constructorElements[element];
- if (elements !== null) return elements;
+ return elements;
}
FunctionExpression tree = element.parseNode(compiler);
if (isConstructor) {
@@ -139,9 +134,6 @@ class ResolverTask extends CompilerTask {
}
visitBody(visitor, tree.body);
- if (isConstructor) {
- constructorElements[element] = visitor.mapping;
- }
return visitor.mapping;
});
}
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698