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