Commit 76460967 authored by Ryan Macnak's avatar Ryan Macnak Committed by GitHub

Adapt to refactoring of snapshot APIs in the Dart VM. (#7589)

parent bf296f71
858e401c4d83f44634341a0e1fe2b01428fe6746 adef37080fc7dd025c53bec5413edc353ff25b06
...@@ -134,10 +134,10 @@ class FlutterTask extends DefaultTask { ...@@ -134,10 +134,10 @@ class FlutterTask extends DefaultTask {
return project.copySpec { return project.copySpec {
from "${intermediateDir}/app.flx" from "${intermediateDir}/app.flx"
if (buildMode != 'debug') { if (buildMode != 'debug') {
from "${intermediateDir}/snapshot_aot_instr" from "${intermediateDir}/vm_snapshot_data"
from "${intermediateDir}/snapshot_aot_isolate" from "${intermediateDir}/vm_snapshot_instr"
from "${intermediateDir}/snapshot_aot_rodata" from "${intermediateDir}/isolate_snapshot_data"
from "${intermediateDir}/snapshot_aot_vmisolate" from "${intermediateDir}/isolate_snapshot_instr"
} }
} }
} }
......
...@@ -19,7 +19,7 @@ import 'build.dart'; ...@@ -19,7 +19,7 @@ import 'build.dart';
// Files generated by the ahead-of-time snapshot builder. // Files generated by the ahead-of-time snapshot builder.
const List<String> kAotSnapshotFiles = const <String>[ const List<String> kAotSnapshotFiles = const <String>[
'snapshot_aot_instr', 'snapshot_aot_isolate', 'snapshot_aot_rodata', 'snapshot_aot_vmisolate', 'vm_snapshot_data', 'vm_snapshot_instr', 'isolate_snapshot_data', 'isolate_snapshot_instr',
]; ];
class BuildAotCommand extends BuildSubCommand { class BuildAotCommand extends BuildSubCommand {
...@@ -144,10 +144,10 @@ Future<String> _buildAotSnapshot( ...@@ -144,10 +144,10 @@ Future<String> _buildAotSnapshot(
Directory outputDir = fs.directory(outputPath); Directory outputDir = fs.directory(outputPath);
outputDir.createSync(recursive: true); outputDir.createSync(recursive: true);
String vmIsolateSnapshot = path.join(outputDir.path, 'snapshot_aot_vmisolate'); String vmSnapshotData = path.join(outputDir.path, 'vm_snapshot_data');
String isolateSnapshot = path.join(outputDir.path, 'snapshot_aot_isolate'); String vmSnapshotInstructions = path.join(outputDir.path, 'vm_snapshot_instr');
String instructionsBlob = path.join(outputDir.path, 'snapshot_aot_instr'); String isolateSnapshotData = path.join(outputDir.path, 'isolate_snapshot_data');
String rodataBlob = path.join(outputDir.path, 'snapshot_aot_rodata'); String isolateSnapshotInstructions = path.join(outputDir.path, 'isolate_snapshot_instr');
String vmEntryPoints = path.join(entryPointsDir, 'dart_vm_entry_points.txt'); String vmEntryPoints = path.join(entryPointsDir, 'dart_vm_entry_points.txt');
String ioEntryPoints = path.join(dartEntryPointsDir, 'dart_io_entries.txt'); String ioEntryPoints = path.join(dartEntryPointsDir, 'dart_io_entries.txt');
...@@ -209,8 +209,8 @@ Future<String> _buildAotSnapshot( ...@@ -209,8 +209,8 @@ Future<String> _buildAotSnapshot(
List<String> genSnapshotCmd = <String>[ List<String> genSnapshotCmd = <String>[
genSnapshot, genSnapshot,
'--vm_isolate_snapshot=$vmIsolateSnapshot', '--vm_snapshot_data=$vmSnapshotData',
'--isolate_snapshot=$isolateSnapshot', '--isolate_snapshot_data=$isolateSnapshotData',
'--packages=${packageMap.packagesPath}', '--packages=${packageMap.packagesPath}',
'--url_mapping=dart:ui,$uiPath', '--url_mapping=dart:ui,$uiPath',
'--url_mapping=dart:jni,$jniPath', '--url_mapping=dart:jni,$jniPath',
...@@ -227,8 +227,8 @@ Future<String> _buildAotSnapshot( ...@@ -227,8 +227,8 @@ Future<String> _buildAotSnapshot(
case TargetPlatform.android_x64: case TargetPlatform.android_x64:
case TargetPlatform.android_x86: case TargetPlatform.android_x86:
genSnapshotCmd.addAll(<String>[ genSnapshotCmd.addAll(<String>[
'--rodata_blob=$rodataBlob', '--vm_snapshot_instructions=$vmSnapshotInstructions',
'--instructions_blob=$instructionsBlob', '--isolate_snapshot_instructions=$isolateSnapshotInstructions',
'--embedder_entry_points_manifest=$vmEntryPointsAndroid', '--embedder_entry_points_manifest=$vmEntryPointsAndroid',
'--no-sim-use-hardfp', '--no-sim-use-hardfp',
'--no-use-integer-division', // Not supported by the Pixel in 32-bit mode. '--no-use-integer-division', // Not supported by the Pixel in 32-bit mode.
...@@ -264,34 +264,34 @@ Future<String> _buildAotSnapshot( ...@@ -264,34 +264,34 @@ 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.
String kVmIsolateSnapshot = 'kVmIsolateSnapshot'; String kVmSnapshotData = 'kDartVmSnapshotData';
String kIsolateSnapshot = 'kIsolateSnapshot'; String kIsolateSnapshotData = 'kDartIsolateSnapshotData';
String kVmIsolateSnapshotC = path.join(outputDir.path, '$kVmIsolateSnapshot.c'); String kVmSnapshotDataC = path.join(outputDir.path, '$kVmSnapshotData.c');
String kIsolateSnapshotC = path.join(outputDir.path, '$kIsolateSnapshot.c'); String kIsolateSnapshotDataC = path.join(outputDir.path, '$kIsolateSnapshotData.c');
String kVmSnapshotDataO = path.join(outputDir.path, '$kVmSnapshotData.o');
String kIsolateSnapshotDataO = path.join(outputDir.path, '$kIsolateSnapshotData.o');
String assemblyO = path.join(outputDir.path, 'snapshot_assembly.o'); 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']; List<String> commonBuildOptions = <String>['-arch', 'arm64', '-miphoneos-version-min=8.0'];
if (interpreter) { if (interpreter) {
runCheckedSync(<String>['mv', vmIsolateSnapshot, path.join(outputDir.path, kVmIsolateSnapshot)]); runCheckedSync(<String>['mv', vmSnapshotData, path.join(outputDir.path, kVmSnapshotData)]);
runCheckedSync(<String>['mv', isolateSnapshot, path.join(outputDir.path, kIsolateSnapshot)]); runCheckedSync(<String>['mv', isolateSnapshotData, path.join(outputDir.path, kIsolateSnapshotData)]);
runCheckedSync(<String>[ runCheckedSync(<String>[
'xxd', '--include', kVmIsolateSnapshot, path.basename(kVmIsolateSnapshotC) 'xxd', '--include', kVmSnapshotData, path.basename(kVmSnapshotDataC)
], workingDirectory: outputDir.path); ], workingDirectory: outputDir.path);
runCheckedSync(<String>[ runCheckedSync(<String>[
'xxd', '--include', kIsolateSnapshot, path.basename(kIsolateSnapshotC) 'xxd', '--include', kIsolateSnapshotData, path.basename(kIsolateSnapshotDataC)
], workingDirectory: outputDir.path); ], workingDirectory: outputDir.path);
runCheckedSync(<String>['xcrun', 'cc'] runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions) ..addAll(commonBuildOptions)
..addAll(<String>['-c', kVmIsolateSnapshotC, '-o', kVmIsolateSnapshotO])); ..addAll(<String>['-c', kVmSnapshotDataC, '-o', kVmSnapshotDataO]));
runCheckedSync(<String>['xcrun', 'cc'] runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions) ..addAll(commonBuildOptions)
..addAll(<String>['-c', kIsolateSnapshotC, '-o', kIsolateSnapshotO])); ..addAll(<String>['-c', kIsolateSnapshotDataC, '-o', kIsolateSnapshotDataO]));
} else { } else {
runCheckedSync(<String>['xcrun', 'cc'] runCheckedSync(<String>['xcrun', 'cc']
..addAll(commonBuildOptions) ..addAll(commonBuildOptions)
...@@ -310,8 +310,8 @@ Future<String> _buildAotSnapshot( ...@@ -310,8 +310,8 @@ Future<String> _buildAotSnapshot(
'-o', appSo, '-o', appSo,
]); ]);
if (interpreter) { if (interpreter) {
linkCommand.add(kVmIsolateSnapshotO); linkCommand.add(kVmSnapshotDataO);
linkCommand.add(kIsolateSnapshotO); linkCommand.add(kIsolateSnapshotDataO);
} else { } else {
linkCommand.add(assemblyO); linkCommand.add(assemblyO);
} }
......
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