Commit 2ac7d67e authored by Ryan Macnak's avatar Ryan Macnak Committed by GitHub

Roll Dart VM. (#6472)

parent 8b197bdd
......@@ -270,37 +270,39 @@ Future<String> _buildAotSnapshot(
printStatus('Building app.dylib...');
// These names are known to from the engine.
const String kDartVmIsolateSnapshotBuffer = 'kDartVmIsolateSnapshotBuffer';
const String kDartIsolateSnapshotBuffer = 'kDartIsolateSnapshotBuffer';
String kVmIsolateSnapshot = 'kVmIsolateSnapshot';
String kIsolateSnapshot = 'kIsolateSnapshot';
runCheckedSync(<String>['mv', vmIsolateSnapshot, path.join(outputDir.path, kDartVmIsolateSnapshotBuffer)]);
runCheckedSync(<String>['mv', isolateSnapshot, path.join(outputDir.path, kDartIsolateSnapshotBuffer)]);
String kVmIsolateSnapshotC = path.join(outputDir.path, '$kVmIsolateSnapshot.c');
String kIsolateSnapshotC = path.join(outputDir.path, '$kIsolateSnapshot.c');
String assemblyO = path.join(outputDir.path, 'snapshot_assembly.o');
String kVmIsolateSnapshotO = path.join(outputDir.path, '$kVmIsolateSnapshot.o');
String kIsolateSnapshotO = path.join(outputDir.path, '$kIsolateSnapshot.o');
String kDartVmIsolateSnapshotBufferC = path.join(outputDir.path, '$kDartVmIsolateSnapshotBuffer.c');
String kDartIsolateSnapshotBufferC = path.join(outputDir.path, '$kDartIsolateSnapshotBuffer.c');
List<String> commonBuildOptions = <String>['-arch', 'arm64', '-miphoneos-version-min=8.0'];
runCheckedSync(<String>[
'xxd', '--include', kDartVmIsolateSnapshotBuffer, path.basename(kDartVmIsolateSnapshotBufferC)
], workingDirectory: outputDir.path);
runCheckedSync(<String>[
'xxd', '--include', kDartIsolateSnapshotBuffer, path.basename(kDartIsolateSnapshotBufferC)
], workingDirectory: outputDir.path);
if (interpreter) {
runCheckedSync(<String>['mv', vmIsolateSnapshot, path.join(outputDir.path, kVmIsolateSnapshot)]);
runCheckedSync(<String>['mv', isolateSnapshot, path.join(outputDir.path, kIsolateSnapshot)]);
String assemblyO = path.join(outputDir.path, 'snapshot_assembly.o');
String kDartVmIsolateSnapshotBufferO = path.join(outputDir.path, '$kDartVmIsolateSnapshotBuffer.o');
String kDartIsolateSnapshotBufferO = path.join(outputDir.path, '$kDartIsolateSnapshotBuffer.o');
runCheckedSync(<String>[
'xxd', '--include', kVmIsolateSnapshot, path.basename(kVmIsolateSnapshotC)
], workingDirectory: outputDir.path);
runCheckedSync(<String>[
'xxd', '--include', kIsolateSnapshot, path.basename(kIsolateSnapshotC)
], workingDirectory: outputDir.path);
List<String> commonBuildOptions = <String>['-arch', 'arm64', '-miphoneos-version-min=8.0'];
if (!interpreter)
runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions)
..addAll(<String>['-c', kVmIsolateSnapshotC, '-o', kVmIsolateSnapshotO]));
runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions)
..addAll(<String>['-c', kIsolateSnapshotC, '-o', kIsolateSnapshotO]));
} else {
runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions)
..addAll(<String>['-c', assembly, '-o', assemblyO]));
runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions)
..addAll(<String>['-c', kDartVmIsolateSnapshotBufferC, '-o', kDartVmIsolateSnapshotBufferO]));
runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions)
..addAll(<String>['-c', kDartIsolateSnapshotBufferC, '-o', kDartIsolateSnapshotBufferO]));
}
String appSo = path.join(outputDir.path, 'app.dylib');
......@@ -312,11 +314,13 @@ Future<String> _buildAotSnapshot(
'-Xlinker', '-rpath', '-Xlinker', '@loader_path/Frameworks',
'-install_name', '@rpath/app.dylib',
'-o', appSo,
kDartVmIsolateSnapshotBufferO,
kDartIsolateSnapshotBufferO,
]);
if (!interpreter)
if (interpreter) {
linkCommand.add(kVmIsolateSnapshotO);
linkCommand.add(kIsolateSnapshotO);
} else {
linkCommand.add(assemblyO);
}
runCheckedSync(linkCommand);
}
......
......@@ -222,14 +222,19 @@ class _DevFSHttpWriter {
Future<Null> _scheduleWrite(DevFSEntry entry,
DevFSProgressReporter progressReporter) async {
HttpClientRequest request = await _client.putUrl(httpAddress);
request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING);
request.headers.add('dev_fs_name', fsName);
request.headers.add('dev_fs_path', entry.devicePath);
Stream<List<int>> contents = entry.contentsAsCompressedStream();
await request.addStream(contents);
HttpClientResponse response = await request.close();
await response.drain();
try {
HttpClientRequest request = await _client.putUrl(httpAddress);
request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING);
request.headers.add('dev_fs_name', fsName);
request.headers.add('dev_fs_path_b64',
BASE64.encode(UTF8.encode(entry.devicePath)));
Stream<List<int>> contents = entry.contentsAsCompressedStream();
await request.addStream(contents);
HttpClientResponse response = await request.close();
await response.drain();
} catch (e, stackTrace) {
printError('Error writing "${entry.devicePath}" to DevFS: $e\n$stackTrace');
}
if (progressReporter != null) {
_done++;
progressReporter(_done, _max);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment