From e6191ca3d2f8e6ee791afe8406946e6eda8d7d1c Mon Sep 17 00:00:00 2001 From: Rokashevich Svetlana Date: Wed, 21 May 2025 00:46:32 +0800 Subject: [PATCH] Create hybrid VM Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IC7W1T Signed-off-by: Rokashevich Svetlana Change-Id: Ie0c5605b4a871942e753a4f2938603a6b5142e35 --- BUILD.gn | 67 +++++++++++++++++----- bundle.json | 3 + ecmascript/compiler/BUILD.gn | 6 -- ecmascript/pgo_profiler/prof_dump/BUILD.gn | 3 - js_runtime_config.gni | 4 -- 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index c1f2b92402..4a8c15602e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -265,15 +265,6 @@ config("ark_jsruntime_public_config") { defines += [ "PANDA_JS_ETS_HYBRID_MODE" ] configs += [ "$ark_root/arkplatform:arkplatform_public_config" ] } - - if (ark_hybrid) { - defines += [ "ARK_HYBRID" ] - - if (current_cpu == "amd64" || current_cpu == "x64" || - current_cpu == "x86_64") { - ldflags += [ "-latomic" ] - } - } } intl_sources = [] @@ -1417,9 +1408,6 @@ ohos_source_set("libark_jsruntime_test_set") { if (ets_runtime_enable_cmc_gc) { deps += [ ":libcommon_components_set" ] - if (ark_hybrid) { - deps += [ "$ark_root/static_core/runtime:libarkruntime_set_static" ] - } } public_configs = [ "$js_root:ark_jsruntime_public_config" ] @@ -1466,9 +1454,6 @@ ohos_source_set("libark_jsruntime_static") { if (ets_runtime_enable_cmc_gc) { deps += [ ":libcommon_components_set" ] - if (ark_hybrid) { - deps += [ "$ark_root/static_core/runtime:libarkruntime_set_static" ] - } } external_deps = [] @@ -1515,6 +1500,58 @@ config("arkjs_runtime_lto_link_config") { } } +ohos_static_library("libark_jsruntime_static_lib") { + stack_protector_ret = false + if (enable_sanitize) { + sanitize = { + ubsan = true + } + } + + deps = [ ":libark_jsruntime_static" ] + + external_deps = [] + if (is_arkui_x && target_os == "ios") { + deps += [ "$ark_third_party_root/bounds_checking_function:libsec_static" ] + } else { + external_deps += [ "bounds_checking_function:libsec_shared" ] + } + + if (!is_arkui_x) { + external_deps += [ "runtime_core:libarkfile_runtime_static" ] + } else { + deps += [ "$ark_root/libpandafile:libarkfile_runtime_static" ] + } + + # hiviewdfx libraries + external_deps += hiviewdfx_ext_deps + deps += hiviewdfx_deps + + if (!enable_ark_intl) { + external_deps += [ "i18n:intl_util" ] + } + + if (ark_standalone_build || (defined(is_arkui_x) && is_arkui_x)) { + deps += [ + "$ark_third_party_root/icu/icu4c:static_icui18n", + "$ark_third_party_root/icu/icu4c:static_icuuc", + ] + } else { + public_external_deps = [ + "icu:shared_icui18n", + "icu:shared_icuuc", + ] + } + + part_name = "ets_runtime" + subsystem_name = "arkcompiler" + + configs = [ + ":ark_jsruntime_common_config", + ":arkjs_runtime_lto_link_config", + ] +} + ohos_shared_library("libark_jsruntime") { stack_protector_ret = false if (enable_sanitize) { diff --git a/bundle.json b/bundle.json index 074ebe5125..a1a52cc050 100644 --- a/bundle.json +++ b/bundle.json @@ -80,6 +80,9 @@ "header_base": "//arkcompiler/ets_runtime/ecmascript/napi/include" } }, + { + "name": "//arkcompiler/ets_runtime:libark_jsruntime_static_lib" + }, { "name": "//arkcompiler/ets_runtime:libark_jsruntime_static", "header": { diff --git a/ecmascript/compiler/BUILD.gn b/ecmascript/compiler/BUILD.gn index 7b996a74d8..165dd6c097 100644 --- a/ecmascript/compiler/BUILD.gn +++ b/ecmascript/compiler/BUILD.gn @@ -411,9 +411,6 @@ ohos_executable("ark_stub_compiler") { if (ets_runtime_enable_cmc_gc) { deps += [ "$js_root:libcommon_components_set" ] - if (ark_hybrid) { - deps += [ "$ark_root/static_core/runtime:libarkruntime_set_static" ] - } } external_deps = [ "zlib:libz" ] @@ -480,9 +477,6 @@ ohos_executable("ark_aot_compiler") { if (ets_runtime_enable_cmc_gc) { deps += [ "$js_root:libcommon_components_set" ] - if (ark_hybrid) { - deps += [ "$ark_root/static_core/runtime:libarkruntime_set_static" ] - } } external_deps = [ "zlib:libz" ] diff --git a/ecmascript/pgo_profiler/prof_dump/BUILD.gn b/ecmascript/pgo_profiler/prof_dump/BUILD.gn index 635849e05b..b09660826c 100644 --- a/ecmascript/pgo_profiler/prof_dump/BUILD.gn +++ b/ecmascript/pgo_profiler/prof_dump/BUILD.gn @@ -55,9 +55,6 @@ ohos_executable("profdump") { if (ets_runtime_enable_cmc_gc) { deps += [ "$js_root:libcommon_components_set" ] - if (ark_hybrid) { - deps += [ "$ark_root/static_core/runtime:libarkruntime_set_static" ] - } } # hiviewdfx libraries diff --git a/js_runtime_config.gni b/js_runtime_config.gni index 3490be6498..81b8604443 100644 --- a/js_runtime_config.gni +++ b/js_runtime_config.gni @@ -15,10 +15,6 @@ if (!defined(ark_standalone_build)) { ark_standalone_build = false } -if (!defined(ark_hybrid)) { - ark_hybrid = false -} - declare_args() { # If true, use icu to implement Intl APIs. # If false, use @ohos.intl APIs to implement Intl APIs. -- Gitee