Read correct cached VM snapshot in dynamic mode (PRODUCT vs RELEASE) (#25472)

This commit is contained in:
Stanislav Baranov
2018-12-18 12:53:30 -08:00
committed by GitHub
parent e41f1463cd
commit 0d4f279fb8
2 changed files with 9 additions and 4 deletions

View File

@@ -359,8 +359,8 @@ class JITSnapshotter {
final Directory outputDir = fs.directory(outputPath);
outputDir.createSync(recursive: true);
final String engineVmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData);
final String engineIsolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData);
final String engineVmSnapshotData = artifacts.getArtifactPath(Artifact.vmSnapshotData, null, buildMode);
final String engineIsolateSnapshotData = artifacts.getArtifactPath(Artifact.isolateSnapshotData, null, buildMode);
final String isolateSnapshotData = fs.path.join(outputDir.path, 'isolate_snapshot_data');
final String isolateSnapshotInstructions = fs.path.join(outputDir.path, 'isolate_snapshot_instr');

View File

@@ -526,8 +526,13 @@ void main() {
snapshotter = JITSnapshotter();
mockAndroidSdk = MockAndroidSdk();
mockArtifacts = MockArtifacts();
when(mockArtifacts.getArtifactPath(Artifact.vmSnapshotData)).thenReturn(kEngineVmSnapshotData);
when(mockArtifacts.getArtifactPath(Artifact.isolateSnapshotData)).thenReturn(kEngineIsolateSnapshotData);
for (BuildMode mode in BuildMode.values) {
when(mockArtifacts.getArtifactPath(Artifact.vmSnapshotData, null, mode))
.thenReturn(kEngineVmSnapshotData);
when(mockArtifacts.getArtifactPath(Artifact.isolateSnapshotData, null, mode))
.thenReturn(kEngineIsolateSnapshotData);
}
});
final Map<Type, Generator> contextOverrides = <Type, Generator>{