mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[gen_snapshot] Restore support for --snapshot_kind=vm-aot-assembly; update docs.
Disable broken analyzer training runs. Bug: https://github.com/dart-lang/sdk/issues/34616 Change-Id: Ib2bb022f5b095bcd29451741aa4ed557d2f78c17 Reviewed-on: https://dart-review.googlesource.com/77228 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
8a919426f0
commit
4a51268890
|
@ -114,7 +114,6 @@ static const char* kSnapshotKindNames[] = {
|
||||||
V(shared_instructions, shared_instructions_filename) \
|
V(shared_instructions, shared_instructions_filename) \
|
||||||
V(reused_instructions, reused_instructions_filename) \
|
V(reused_instructions, reused_instructions_filename) \
|
||||||
V(assembly, assembly_filename) \
|
V(assembly, assembly_filename) \
|
||||||
V(script_snapshot, script_snapshot_filename) \
|
|
||||||
V(dependencies, dependencies_filename) \
|
V(dependencies, dependencies_filename) \
|
||||||
V(load_compilation_trace, load_compilation_trace_filename) \
|
V(load_compilation_trace, load_compilation_trace_filename) \
|
||||||
V(package_root, commandline_package_root) \
|
V(package_root, commandline_package_root) \
|
||||||
|
@ -159,7 +158,7 @@ static bool IsSnapshottingForPrecompilation() {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static void PrintUsage() {
|
static void PrintUsage() {
|
||||||
Log::PrintErr(
|
Log::PrintErr(
|
||||||
"Usage: gen_snapshot [<vm-flags>] [<options>] [<dart-script-file>] \n"
|
"Usage: gen_snapshot [<vm-flags>] [<options>] <dart-kernel-file> \n"
|
||||||
" \n"
|
" \n"
|
||||||
"Common options: \n"
|
"Common options: \n"
|
||||||
"--package_root=<path> \n"
|
"--package_root=<path> \n"
|
||||||
|
@ -181,21 +180,14 @@ static void PrintUsage() {
|
||||||
"--snapshot_kind=core \n"
|
"--snapshot_kind=core \n"
|
||||||
"--vm_snapshot_data=<output-file> \n"
|
"--vm_snapshot_data=<output-file> \n"
|
||||||
"--isolate_snapshot_data=<output-file> \n"
|
"--isolate_snapshot_data=<output-file> \n"
|
||||||
"[<dart-script-file>] \n"
|
"[<dart-kernel-file>] \n"
|
||||||
" \n"
|
" \n"
|
||||||
"Writes a snapshot of <dart-script-file> to the specified snapshot files. \n"
|
"Writes a snapshot of <dart-kernel-file> to the specified snapshot files. \n"
|
||||||
"If no <dart-script-file> is passed, a generic snapshot of all the corelibs \n"
|
"If no <dart-kernel-file> is passed, a generic snapshot of all the corelibs \n"
|
||||||
"is created. \n"
|
"is created. \n"
|
||||||
" \n"
|
" \n"
|
||||||
"To create a script snapshot with respect to a given core snapshot: \n"
|
"Writes a snapshot of <dart-kernel-file> to the specified snapshot files. \n"
|
||||||
"--snapshot_kind=script \n"
|
"If no <dart-kernel-file> is passed, a generic snapshot of all the corelibs \n"
|
||||||
"--vm_snapshot_data=<input-file> \n"
|
|
||||||
"--isolate_snapshot_data=<input-file> \n"
|
|
||||||
"--script_snapshot=<output-file> \n"
|
|
||||||
"<dart-script-file> \n"
|
|
||||||
" \n"
|
|
||||||
"Writes a snapshot of <dart-script-file> to the specified snapshot files. \n"
|
|
||||||
"If no <dart-script-file> is passed, a generic snapshot of all the corelibs \n"
|
|
||||||
"is created. \n"
|
"is created. \n"
|
||||||
" \n"
|
" \n"
|
||||||
"To create an AOT application snapshot as blobs suitable for loading with \n"
|
"To create an AOT application snapshot as blobs suitable for loading with \n"
|
||||||
|
@ -207,7 +199,7 @@ static void PrintUsage() {
|
||||||
"--isolate_snapshot_instructions=<output-file> \n"
|
"--isolate_snapshot_instructions=<output-file> \n"
|
||||||
"[--obfuscate] \n"
|
"[--obfuscate] \n"
|
||||||
"[--save-obfuscation-map=<map-filename>] \n"
|
"[--save-obfuscation-map=<map-filename>] \n"
|
||||||
" <dart-script-file> \n"
|
" <dart-kernel-file> \n"
|
||||||
" \n"
|
" \n"
|
||||||
"To create an AOT application snapshot as assembly suitable for compilation \n"
|
"To create an AOT application snapshot as assembly suitable for compilation \n"
|
||||||
"as a static or dynamic library: \n"
|
"as a static or dynamic library: \n"
|
||||||
|
@ -215,7 +207,7 @@ static void PrintUsage() {
|
||||||
"--assembly=<output-file> \n"
|
"--assembly=<output-file> \n"
|
||||||
"[--obfuscate] \n"
|
"[--obfuscate] \n"
|
||||||
"[--save-obfuscation-map=<map-filename>] \n"
|
"[--save-obfuscation-map=<map-filename>] \n"
|
||||||
"<dart-script-file> \n"
|
"<dart-kernel-file> \n"
|
||||||
" \n"
|
" \n"
|
||||||
"AOT snapshots can be obfuscated: that is all identifiers will be renamed \n"
|
"AOT snapshots can be obfuscated: that is all identifiers will be renamed \n"
|
||||||
"during compilation. This mode is enabled with --obfuscate flag. Mapping \n"
|
"during compilation. This mode is enabled with --obfuscate flag. Mapping \n"
|
||||||
|
@ -332,7 +324,7 @@ static int ParseArguments(int argc,
|
||||||
"Building an AOT snapshot as blobs requires specifying output "
|
"Building an AOT snapshot as blobs requires specifying output "
|
||||||
"files for --vm_snapshot_data, --vm_snapshot_instructions, "
|
"files for --vm_snapshot_data, --vm_snapshot_instructions, "
|
||||||
"--isolate_snapshot_data and --isolate_snapshot_instructions and a "
|
"--isolate_snapshot_data and --isolate_snapshot_instructions and a "
|
||||||
"Dart script.\n\n");
|
"kernel file.\n\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -341,16 +333,16 @@ static int ParseArguments(int argc,
|
||||||
if ((assembly_filename == NULL) || (*script_name == NULL)) {
|
if ((assembly_filename == NULL) || (*script_name == NULL)) {
|
||||||
Log::PrintErr(
|
Log::PrintErr(
|
||||||
"Building an AOT snapshot as assembly requires specifying "
|
"Building an AOT snapshot as assembly requires specifying "
|
||||||
"an output file for --assembly and a Dart script.\n\n");
|
"an output file for --assembly and a kernel file.\n\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kVMAOTAssembly: {
|
case kVMAOTAssembly: {
|
||||||
if ((assembly_filename == NULL) || (*script_name != NULL)) {
|
if ((assembly_filename == NULL) || (*script_name == NULL)) {
|
||||||
Log::PrintErr(
|
Log::PrintErr(
|
||||||
"Building an AOT snapshot as assembly requires specifying "
|
"Building an AOT snapshot as assembly requires specifying "
|
||||||
"an output file for --assembly and a Dart script.\n\n");
|
"an output file for --assembly and a kernel file.\n\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -884,6 +876,13 @@ static int GenerateSnapshotFromKernel(const uint8_t* kernel_buffer,
|
||||||
LoadCompilationTrace();
|
LoadCompilationTrace();
|
||||||
CreateAndWriteAppJITSnapshot();
|
CreateAndWriteAppJITSnapshot();
|
||||||
break;
|
break;
|
||||||
|
case kVMAOTAssembly: {
|
||||||
|
File* file = OpenFile(assembly_filename);
|
||||||
|
RefCntReleaseScope<File> rs(file);
|
||||||
|
result = Dart_CreateVMAOTSnapshotAsAssembly(StreamingWriteCallback, file);
|
||||||
|
CHECK_RESULT(result);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@ import("../application_snapshot.gni")
|
||||||
application_snapshot("analysis_server") {
|
application_snapshot("analysis_server") {
|
||||||
main_dart = "../../pkg/analysis_server/bin/server.dart"
|
main_dart = "../../pkg/analysis_server/bin/server.dart"
|
||||||
training_args = [
|
training_args = [
|
||||||
"--sdk=" + rebase_path("../../sdk/"),
|
"--help"
|
||||||
"--train-using=" + rebase_path("../../pkg/analyzer_cli")
|
# TODO(34616): This is broken on Fuchsia.
|
||||||
|
# "--sdk=" + rebase_path("../../sdk/"),
|
||||||
|
# "--train-using=" + rebase_path("../../pkg/analyzer_cli")
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,11 @@ analyzer_files = exec_script("../../tools/list_dart_files.py",
|
||||||
application_snapshot("generate_dartanalyzer_snapshot") {
|
application_snapshot("generate_dartanalyzer_snapshot") {
|
||||||
main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
|
main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
|
||||||
training_args = [
|
training_args = [
|
||||||
"--dart-sdk=" + rebase_path("../../sdk/"),
|
"--help",
|
||||||
"--train-snapshot",
|
# TODO(34616): This is broken on Fuchsia.
|
||||||
rebase_path("../../tests/language/first_test.dart")
|
# "--dart-sdk=" + rebase_path("../../sdk/"),
|
||||||
|
# "--train-snapshot",
|
||||||
|
# rebase_path("../../tests/language/first_test.dart")
|
||||||
]
|
]
|
||||||
name = "dartanalyzer"
|
name = "dartanalyzer"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue