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

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

Issue 2638423002: Fix incremental kernel builder to handle multiple calls to computeDelta. (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_resolved_ast_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart b/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
index 6569fa7d92b0a20885f7bfbcd7afe16df13f3a22..20c4e2edecd7f61cc0c72338211f54911b088fc4 100644
--- a/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_resolved_ast_generator_impl.dart
@@ -51,6 +51,7 @@ class IncrementalResolvedAstGeneratorImpl
bool _isInitialized = false;
final ProcessedOptions _options;
final Uri _source;
+ bool _schedulerStarted = false;
IncrementalResolvedAstGeneratorImpl(this._source, this._options);
@@ -67,8 +68,10 @@ class IncrementalResolvedAstGeneratorImpl
var libraries = <Uri, ResolvedLibrary>{};
// TODO(paulberry): it should be possible to seed the driver using a URI,
// not a file path.
- // TODO(paulberry): only start the scheduler the first time.
- _scheduler.start();
+ if (!_schedulerStarted) {
+ _scheduler.start();
+ _schedulerStarted = true;
+ }
_driver.addFile(_source.path);
for (var libraryCycle in graph.topologicallySortedCycles) {
for (var uri in libraryCycle.libraries.keys) {
@@ -130,7 +133,11 @@ class IncrementalResolvedAstGeneratorImpl
@override
void invalidateAll() {
- throw new UnimplementedError();
+ // TODO(paulberry): verify that this has an effect (requires a multi-file
+ // test).
+ if (_isInitialized) {
+ _driver.knownFiles.forEach(_driver.changeFile);
+ }
}
void _storeVirtualFile(Uri uri, String path, String contents) {
@@ -245,7 +252,8 @@ class _SourceFactoryProxy implements SourceFactory {
_SourceFactoryProxy(this.dartSdk, this.pathToUriMap, this.uriToPathMap);
@override
- SourceFactory clone() => this;
+ SourceFactory clone() =>
+ new _SourceFactoryProxy(dartSdk, pathToUriMap, uriToPathMap);
@override
Source forUri(String absoluteUri) {

Powered by Google App Engine
This is Rietveld 408576698