Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 29 additions & 17 deletions engine/src/flutter/shell/platform/fuchsia/dart_runner/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,29 @@ template("aot_runner_package") {
product_suffix = "_product"
}
fuchsia_archive(target_name) {
deps = [ ":dart_aot${product_suffix}_runner_bin" ]
if (!invoker.product) {
deps += [
"vmservice:vmservice_snapshot",
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
]
}
deps = [
":dart_aot${product_suffix}_runner_bin",
"kernel:ffi_callback_stub${product_suffix}",
]

binary = "dart_aot${product_suffix}_runner"

libraries = common_libs

resources = []
resources = [
{
path = rebase_path(
"$target_gen_dir/kernel/ffi_callback_stub${product_suffix}.bin")
dest = "lib/ffi_callback_stub.bin"
},
]

if (!invoker.product) {
deps += [
"vmservice:vmservice_snapshot",
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_aot_runner",
]

vmservice_snapshot = rebase_path(
get_label_info("vmservice:vmservice_snapshot", "target_gen_dir") +
"/vmservice_snapshot.so")
Expand All @@ -189,11 +198,11 @@ template("aot_runner_package") {
resources += [
{
path = vmservice_snapshot
dest = "vmservice_snapshot.so"
dest = "data/vmservice_snapshot.so"
},
{
path = dart_profiler_symbols
dest = "dart_aot_runner.dartprofilersymbols"
dest = "data/dart_aot_runner.dartprofilersymbols"
},
]
}
Expand All @@ -210,13 +219,10 @@ template("jit_runner_package") {
fuchsia_archive(target_name) {
deps = [
":dart_jit${product_suffix}_runner_bin",
"kernel:ffi_callback_stub${product_suffix}",
"kernel:kernel_core_snapshot${product_suffix}",
]

if (!invoker.product) {
deps += [ "//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner" ]
}

binary = "dart_jit${product_suffix}_runner"

libraries = common_libs
Expand All @@ -225,23 +231,29 @@ template("jit_runner_package") {
{
path =
rebase_path("$target_gen_dir/kernel/vm_data${product_suffix}.bin")
dest = "vm_snapshot_data.bin"
dest = "data/vm_snapshot_data.bin"
},
{
path = rebase_path(
"$target_gen_dir/kernel/isolate_data${product_suffix}.bin")
dest = "isolate_core_snapshot_data.bin"
dest = "data/isolate_core_snapshot_data.bin"
},
{
path = rebase_path(
"$target_gen_dir/kernel/ffi_callback_stub${product_suffix}.bin")
dest = "lib/ffi_callback_stub.bin"
},
]

if (!invoker.product) {
deps += [ "//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner" ]
resources += [
{
path = rebase_path(
get_label_info(
"//flutter/shell/platform/fuchsia/runtime/dart/profiler_symbols:dart_jit_runner",
"target_gen_dir") + "/dart_jit_runner.dartprofilersymbols")
dest = "dart_jit_runner.dartprofilersymbols"
dest = "data/dart_jit_runner.dartprofilersymbols"
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,51 @@ create_kernel_core_snapshot("kernel_core_snapshot") {
create_kernel_core_snapshot("kernel_core_snapshot_product") {
product = true
}

template("create_ffi_callback_stub") {
assert(defined(invoker.product), "The parameter 'product' must be defined")
product_suffix = ""
if (invoker.product) {
product_suffix = "_product"
}

compiled_action(target_name) {
deps = [ ":kernel_platform_files" ]

platform_dill = "$root_out_dir/dart_runner_patched_sdk/platform_strong.dill"
inputs = [ platform_dill ]

ffi_callback_stub = "$target_gen_dir/ffi_callback_stub${product_suffix}.bin"
outputs = [ ffi_callback_stub ]

gen_snapshot_to_use = gen_snapshot
if (invoker.product) {
gen_snapshot_to_use = gen_snapshot_product
}

tool = gen_snapshot_to_use

args = [
"--enable_mirrors=false",
"--deterministic",
"--snapshot_kind=ffi-callback-stub",
"--ffi_callback_stub=" + rebase_path(ffi_callback_stub, root_build_dir),
]

# No asserts in debug or release product.
# No asserts in release with flutter_profile=true (non-product)
# Yes asserts in non-product debug.
if (!invoker.product && (is_debug || flutter_runtime_mode == "debug")) {
args += [ "--enable_asserts" ]
}
args += [ rebase_path(platform_dill) ]
}
}

create_ffi_callback_stub("ffi_callback_stub") {
product = false
}

create_ffi_callback_stub("ffi_callback_stub_product") {
product = true
}
Loading
Loading