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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2665043003: Simplify the API for incremental_resolved_ast_generator. (Closed)
Patch Set: Created 3 years, 11 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: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 50473ebc34fb0f6466988b3b2f0cc7c1c9c41bfe..efd4ddd002330151ea1545936fbde1c0a366c775 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -93,7 +93,7 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
}
class _AnalysisContextProxy implements AnalysisContext {
- final Map<Uri, ResolvedLibrary> _resolvedLibraries;
+ final Map<Uri, Map<Uri, CompilationUnit>> _resolvedLibraries;
@override
final _SourceFactoryProxy sourceFactory = new _SourceFactoryProxy();
@@ -112,7 +112,7 @@ class _AnalysisContextProxy implements AnalysisContext {
assert(_resolvedLibraries.containsKey(source.uri));
return resolutionMap
.elementDeclaredByCompilationUnit(
- _resolvedLibraries[source.uri].definingCompilationUnit)
+ _resolvedLibraries[source.uri][source.uri])
.library;
}
@@ -120,14 +120,9 @@ class _AnalysisContextProxy implements AnalysisContext {
CompilationUnit resolveCompilationUnit(
Source unitSource, LibraryElement library) {
- assert(_resolvedLibraries.containsKey(library.source.uri));
- var resolvedLibrary = _resolvedLibraries[library.source.uri];
- if (unitSource == library.source) {
- return resolvedLibrary.definingCompilationUnit;
- } else {
- assert(resolvedLibrary.partUnits.containsKey(unitSource.uri));
- return resolvedLibrary.partUnits[unitSource.uri];
- }
+ var unit = _resolvedLibraries[library.source.uri][unitSource.uri];
+ assert(unit != null);
+ return unit;
}
}

Powered by Google App Engine
This is Rietveld 408576698