mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
Fixes to incremental DDK/blaze
This CL fixes a number of issues: * Semi-leaking old components when starting over (i.e. when loading a new sdk) * Setting new filesystem not really working because the old one was cached in the ProcessedOptions * Leaking old state because of an apparent VM bug (http://dartbug.com/36983) Change-Id: Ib124257c456b019941e253409c1ef56eedcf66b2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103121 Reviewed-by: Kevin Millikin <kmillikin@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
This commit is contained in:
parent
e7f7984995
commit
2bbb6aae9b
|
@ -70,8 +70,11 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
if (oldState == null ||
|
||||
oldState.incrementalCompiler == null ||
|
||||
oldState.incrementalCompiler.outlineOnly != outlineOnly) {
|
||||
// No previous state.
|
||||
// No - or immediately not correct - previous state.
|
||||
startOver = true;
|
||||
|
||||
// We'll load a new sdk, anything loaded already will have a wrong root.
|
||||
workerInputCache.clear();
|
||||
} else {
|
||||
// We do have a previous state.
|
||||
cachedSdkInput = workerInputCache[sdkSummary];
|
||||
|
@ -79,6 +82,8 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
!digestsEqual(cachedSdkInput.digest, sdkDigest)) {
|
||||
// The sdk is out of date.
|
||||
startOver = true;
|
||||
// We'll load a new sdk, anything loaded already will have a wrong root.
|
||||
workerInputCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,6 +125,7 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
incrementalCompiler.invalidateAllSources();
|
||||
options.packagesFileUri = packagesFile;
|
||||
options.fileSystem = fileSystem;
|
||||
processedOpts.clearFileSystemCache();
|
||||
}
|
||||
|
||||
// Then read all the input summary components.
|
||||
|
|
|
@ -165,6 +165,9 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
..fileSystem = fileSystem ?? StandardFileSystem.instance;
|
||||
if (experiments != null) options.experimentalFlags = experiments;
|
||||
|
||||
// We'll load a new sdk, anything loaded already will have a wrong root.
|
||||
workerInputCache.clear();
|
||||
|
||||
processedOpts = new ProcessedOptions(options: options);
|
||||
|
||||
cachedSdkInput = new WorkerInputComponent(null /* not compared anyway */,
|
||||
|
@ -190,6 +193,7 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
|
|||
incrementalCompiler.invalidateAllSources();
|
||||
options.packagesFileUri = packagesFile;
|
||||
options.fileSystem = fileSystem;
|
||||
processedOpts.clearFileSystemCache();
|
||||
}
|
||||
InitializedCompilerState compilerState = new InitializedCompilerState(
|
||||
options, processedOpts,
|
||||
|
|
|
@ -299,6 +299,8 @@ Future<ComputeKernelResult> computeKernel(List<String> args,
|
|||
|
||||
return Future.value(fe.serializeComponent(incrementalComponent));
|
||||
});
|
||||
|
||||
state.options.onDiagnostic = null; // See http://dartbug.com/36983.
|
||||
} else if (summaryOnly) {
|
||||
kernel = await fe.compileSummary(state, sources, onDiagnostic,
|
||||
includeOffsets: false);
|
||||
|
|
Loading…
Reference in a new issue