mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 21:49:13 +00:00
[dartdev] Convert gen_kernel.dart.snapshot into an AOT snapshot
Convert gen_kernel to use an AOT snapshot in the dart compile exe command. TEST=ci Change-Id: I6e338525dabb4e84dc1edff8f0bbac803223e74d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/327520 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Siva Annamalai <asiva@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
parent
bc4235b94a
commit
0f8069d9d0
|
@ -13,7 +13,7 @@ final String executableSuffix = Platform.isWindows ? '.exe' : '';
|
|||
final String dartaotruntime =
|
||||
path.join(binDir.path, 'dartaotruntime$executableSuffix');
|
||||
final String genKernel =
|
||||
path.join(binDir.path, 'snapshots', 'gen_kernel.dart.snapshot');
|
||||
path.join(binDir.path, 'snapshots', 'gen_kernel_aot.dart.snapshot');
|
||||
final String genSnapshot =
|
||||
path.join(binDir.path, 'utils', 'gen_snapshot$executableSuffix');
|
||||
final String productPlatformDill = path.join(
|
||||
|
@ -63,7 +63,7 @@ Future<void> generateNative({
|
|||
|
||||
final String kernelFile = path.join(tempDir.path, 'kernel.dill');
|
||||
final kernelResult = await generateAotKernel(
|
||||
Platform.executable,
|
||||
dartaotruntime,
|
||||
genKernel,
|
||||
productPlatformDill,
|
||||
sourcePath,
|
||||
|
|
|
@ -49,7 +49,7 @@ declare_args() {
|
|||
# ........dds_aot.dart.snapshot (AOT snapshot) or dds.dart.snapshot (ia32)
|
||||
# ........frontend_server_aot.dart.snapshot (AOT snapshot, if not on ia32)
|
||||
# ........frontend_server.dart.snapshot
|
||||
# ........gen_kernel.dart.snapshot (if not on ia32)
|
||||
# ........gen_kernel_aot.dart.snapshot (if not on ia32)
|
||||
# ........kernel-service.dart.snapshot
|
||||
# ........kernel_worker.dart.snapshot
|
||||
# ......resources/
|
||||
|
@ -365,7 +365,7 @@ copy("copy_vm_platform_strong_product") {
|
|||
copy("copy_gen_kernel_snapshot") {
|
||||
visibility = [ ":group_dart2native" ]
|
||||
deps = [ "../utils/gen_kernel" ]
|
||||
sources = [ "$root_gen_dir/gen_kernel.dart.snapshot" ]
|
||||
sources = [ "$root_gen_dir/gen_kernel_aot.dart.snapshot" ]
|
||||
outputs =
|
||||
[ "$root_out_dir/$dart_sdk_output/bin/snapshots/{{source_file_part}}" ]
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("../build/dart/dart_action.gni")
|
||||
import("../runtime/runtime_args.gni")
|
||||
import("../sdk_args.gni")
|
||||
|
||||
_dart_root = get_path_info("..", "abspath")
|
||||
|
|
|
@ -39,21 +39,18 @@ prebuilt_dart_action("bootstrap_gen_kernel") {
|
|||
args = []
|
||||
}
|
||||
|
||||
import("../application_snapshot.gni")
|
||||
import("../aot_snapshot.gni")
|
||||
|
||||
application_snapshot("gen_kernel") {
|
||||
aot_snapshot("gen_kernel") {
|
||||
main_dart = "../../pkg/vm/bin/gen_kernel.dart"
|
||||
deps = [ "../../runtime/vm:vm_platform" ]
|
||||
output = "$root_gen_dir/gen_kernel_aot.dart.snapshot"
|
||||
|
||||
# NOTE: The output filename must be kept in sync with the output of the
|
||||
# vm_platform rule.
|
||||
vm_platform_out =
|
||||
get_label_info("../../runtime/vm:vm_platform", "root_out_dir")
|
||||
vm_platform = "$vm_platform_out/vm_platform_strong.dill"
|
||||
training_args = [
|
||||
"--platform",
|
||||
rebase_path(vm_platform, root_build_dir),
|
||||
rebase_path("../../pkg/vm/bin/gen_kernel.dart", root_build_dir),
|
||||
"-o -",
|
||||
]
|
||||
# dartaotruntime has dart_product_config applied to it,
|
||||
# so it is built in # product mode in both release and
|
||||
# product builds, and is only built in debug mode in debug
|
||||
# builds. The following line ensures that the dartaotruntime
|
||||
# and gen_kernel_aot snapshot in an SDK build are
|
||||
# always compatible with each other.
|
||||
force_product_mode = !dart_debug
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue