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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 10066020: prevent cached DartUnit from being referenced and resolved by multiple libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
===================================================================
--- compiler/java/com/google/dart/compiler/DartCompiler.java (revision 6466)
+++ compiler/java/com/google/dart/compiler/DartCompiler.java (working copy)
@@ -881,7 +881,9 @@
return super.parse(dartSrc, prefixes, diet);
}
URI srcUri = dartSrc.getUri();
- DartUnit parsedUnit = parsedUnits.get(srcUri);
+ // Remove the parsed unit from the map if present
+ // so that it will not be consumed a 2nd time if it is sourced by multiple libraries
+ DartUnit parsedUnit = parsedUnits.remove(srcUri);
zundel 2012/04/12 19:00:34 couldn't you just not parse it a second time? Or
danrubel 2012/04/12 19:17:44 If I analyze a library that imports two other libr
return parsedUnit == null ? super.parse(dartSrc, prefixes, diet) : parsedUnit;
}
}
@@ -1157,7 +1159,8 @@
* instead of parsing and resolving the associated source from storage.
* @param parsedUnits A collection of unresolved ASTs that should be used
* instead of parsing the associated source from storage. Intended for
- * IDE use when modified buffers must be analyzed. AST nodes in the map may be
+ * IDE use when modified buffers must be analyzed.
+ * Units are removed from this map as they are used. AST nodes in the map may be
* ignored if not referenced by {@code lib}. (May be null.)
* @param config The compiler configuration (phases and backends
* will not be used), but resolution and type-analysis will be
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698