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") 15 16snapshot_input_path = "//component_dist/aosp-x86_64/packages_to_install/ace_engine_full/ark_build/strip.native.min.abc" 17arkstdlib_abc_path = "//prebuilts/ark_tools/target/aex/arkstdlib.abc" 18snapshot_bin_output_path = "$target_gen_dir/snapshot" 19 20action("gen_snapshot_bin") { 21 visibility = [ ":*" ] 22 23 deps = [ 24 "//arkcompiler/ets_runtime/ecmascript/js_vm:ark_js_vm(${host_toolchain})", 25 ] 26 27 script = "$ark_root/tools/gen_snapshot.sh" 28 29 args = [ 30 "./clang_x64/arkcompiler/ets_runtime/ark_js_vm ", 31 "--boot-class-spaces=core:ecmascript", 32 "--boot-intrinsic-spaces=core:ecmascript", 33 "--compiler-enable-jit=false", 34 "--gc-type=epsilon", 35 "--runtime-type=ecmascript", 36 "--snapshot-serialize-enabled=true", 37 "--snapshot-file=" + rebase_path(snapshot_bin_output_path), 38 rebase_path(snapshot_input_path), 39 "_GLOBAL::func_main_0", 40 ] 41 42 inputs = [ 43 snapshot_input_path, 44 arkstdlib_abc_path, 45 ] 46 outputs = [ snapshot_bin_output_path ] 47} 48 49ohos_prebuilt_etc("gen_ark_snapshot_bin") { 50 deps = [ ":gen_snapshot_bin" ] 51 source = snapshot_bin_output_path 52 53 install_enable = true 54 part_name = "ets_runtime" 55 subsystem_name = "arkcompiler" 56} 57