mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 20:01:19 +00:00
a681867054
* Introduce --tfa option in gen_kernel and 'useGlobalTypeFlowAnalysis' parameter in compileToKernel(), which is used in Flutter's frontend server. * Split entry_points_extra.json into 2 parts: common to all embedders and specific to a standalone VM (entry_points_extra_standalone.json). * Extract generation of entry points JSON files into a separate .gni file, introduce action to generate entry points JSON using gen_snapshot instead of dart_bootstrap (required for Flutter), and action to copy checked-in extra entry points file. Issue: https://github.com/dart-lang/sdk/issues/30480 Change-Id: Ie0af9d7128d7fc0e3a9d623fd3c1589e87c83f5c Reviewed-on: https://dart-review.googlesource.com/43884 Commit-Queue: Alexander Markov <alexmarkov@google.com> Reviewed-by: Zach Anderson <zra@google.com>
110 lines
3.8 KiB
Plaintext
110 lines
3.8 KiB
Plaintext
# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
|
|
# for details. All rights reserved. Use of this source code is governed by a
|
|
# BSD-style license that can be found in the LICENSE file.
|
|
|
|
import("../build/compiled_action.gni")
|
|
import("../build/dart_host_sdk_toolchain.gni")
|
|
|
|
_dart_root = get_path_info("..", "abspath")
|
|
|
|
# Template to generate entry points JSON file using dart_bootstrap tool.
|
|
# List of entry points is generated as a by-product while doing precompilation.
|
|
#
|
|
# This template expects the following arguments:
|
|
# - input: Name of the input dart script for precompilation.
|
|
# - output: Name of the output entry points JSON file.
|
|
# - extra_args: Extra arguments to pass to dart_bootstrap (optional).
|
|
#
|
|
template("generate_entry_points_json_with_dart_bootstrap") {
|
|
assert(defined(invoker.input), "Must define input dart script")
|
|
assert(defined(invoker.output), "Must define output json file")
|
|
extra_args = []
|
|
if (defined(invoker.extra_args)) {
|
|
extra_args += invoker.extra_args
|
|
}
|
|
compiled_action(target_name) {
|
|
# Printing precompiler entry points is folded into precompilation, so dart_bootstrap is invoked
|
|
# with correct arguments to generate app-aot snapshot.
|
|
|
|
input = invoker.input
|
|
output = invoker.output
|
|
|
|
tool = "$_dart_root/runtime/bin:dart_bootstrap"
|
|
inputs = [
|
|
input,
|
|
]
|
|
outputs = [
|
|
output,
|
|
]
|
|
args = [
|
|
"--print-precompiler-entry-points=" + rebase_path(output),
|
|
"--snapshot=" + rebase_path("$target_gen_dir/dummy.snapshot"),
|
|
"--snapshot-kind=app-aot",
|
|
"--use-blobs",
|
|
"--snapshot-kind=app-aot",
|
|
] + extra_args + [
|
|
rebase_path(input),
|
|
]
|
|
}
|
|
}
|
|
|
|
# Template to generate entry points JSON file using gen_snapshot tool.
|
|
# List of entry points is generated as a by-product while doing precompilation.
|
|
#
|
|
# This template expects the following arguments:
|
|
# - input: Name of the input dart script for precompilation.
|
|
# - output: Name of the output entry points JSON file.
|
|
# - extra_args: Extra arguments to pass to dart_bootstrap (optional).
|
|
# - extra_inputs: Extra input dependencies (optional).
|
|
#
|
|
template("generate_entry_points_json_with_gen_snapshot") {
|
|
assert(defined(invoker.input), "Must define input dart script")
|
|
assert(defined(invoker.output), "Must define output json file")
|
|
extra_args = []
|
|
if (defined(invoker.extra_args)) {
|
|
extra_args += invoker.extra_args
|
|
}
|
|
extra_inputs = []
|
|
if (defined(invoker.extra_inputs)) {
|
|
extra_inputs += invoker.extra_inputs
|
|
}
|
|
compiled_action(target_name) {
|
|
# Printing precompiler entry points is folded into precompilation, so gen_snapshot is invoked
|
|
# with correct arguments to generate app-aot snapshot.
|
|
|
|
input = invoker.input
|
|
output = invoker.output
|
|
|
|
tool = "$_dart_root/runtime/bin:gen_snapshot"
|
|
inputs = [
|
|
input,
|
|
] + extra_inputs
|
|
outputs = [
|
|
output,
|
|
]
|
|
args = [
|
|
"--print-precompiler-entry-points=" + rebase_path(output),
|
|
"--snapshot-kind=app-aot-blobs",
|
|
"--vm_snapshot_data=" + rebase_path("$target_gen_dir/dummy.vm_data.snapshot"),
|
|
"--vm_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.vm_instr.snapshot"),
|
|
"--isolate_snapshot_data=" + rebase_path("$target_gen_dir/dummy.isolate_data.snapshot"),
|
|
"--isolate_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.isolate_instr.snapshot"),
|
|
] + extra_args + [
|
|
rebase_path(input),
|
|
]
|
|
}
|
|
}
|
|
|
|
# Template to copy checked-in extra entry points JSON file.
|
|
#
|
|
# This template expects the following argument:
|
|
# - output: Target destination for the extra entry points JSON file.
|
|
#
|
|
template("copy_entry_points_extra_json") {
|
|
assert(defined(invoker.output), "Must define output json file")
|
|
copy(target_name) {
|
|
sources = [ "$_dart_root/pkg/vm/lib/transformations/type_flow/entry_points_extra.json" ]
|
|
outputs = [ invoker.output ]
|
|
}
|
|
}
|