• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//arkcompiler/ets_runtime/js_runtime_config.gni")
15import("//build/ohos.gni")
16
17snapshot_input_path = "//component_dist/aosp-x86_64/packages_to_install/ace_engine_full/ark_build/strip.native.min.abc"
18arkstdlib_abc_path = "//prebuilts/ark_tools/target/aex/arkstdlib.abc"
19snapshot_bin_output_path = "$target_gen_dir/snapshot"
20
21action("gen_snapshot_bin") {
22  visibility = [ ":*" ]
23
24  deps = [
25    "//arkcompiler/ets_runtime/ecmascript/js_vm:ark_js_vm(${host_toolchain})",
26  ]
27
28  script = "$ark_root/tools/gen_snapshot.sh"
29
30  args = [
31    "./clang_x64/arkcompiler/ets_runtime/ark_js_vm ",
32    "--boot-class-spaces=core:ecmascript",
33    "--boot-intrinsic-spaces=core:ecmascript",
34    "--compiler-enable-jit=false",
35    "--gc-type=epsilon",
36    "--runtime-type=ecmascript",
37    "--snapshot-serialize-enabled=true",
38    "--snapshot-file=" + rebase_path(snapshot_bin_output_path),
39    rebase_path(snapshot_input_path),
40    "_GLOBAL::func_main_0",
41  ]
42
43  inputs = [
44    snapshot_input_path,
45    arkstdlib_abc_path,
46  ]
47  outputs = [ snapshot_bin_output_path ]
48}
49
50ohos_prebuilt_etc("gen_ark_snapshot_bin") {
51  deps = [ ":gen_snapshot_bin" ]
52  source = snapshot_bin_output_path
53
54  install_enable = true
55  part_name = "ets_runtime"
56  subsystem_name = "arkcompiler"
57}
58