diff --git a/BUILD.gn b/BUILD.gn index 028602e91f2fcda1104887f523f0e094f4b54a51..7dca88e02cbef8df6e74574ba38b7f9883ed5466 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -11,11 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") +import("//arkcompiler/runtime_core/static_core/ark_config.gni") import("//build/ohos.gni") group("ark_packages") { - deps = ["$ark_root/plugins/ecmascript/es2panda/aot:es2panda"] + deps = ["$ark_es2panda_root/aot:es2panda"] } group("ark_host_linux_tools_packages") { @@ -63,7 +63,7 @@ config("runtime") { "$ark_root_gen_dir", ] configs = [ - "es2panda:libes2panda_public_config", + "$ark_es2panda_root:libes2panda_public_config", "$ark_root/assembler:arkassembler_public_config", "$ark_root/libpandafile:arkfile_public_config", ] diff --git a/CMakeLists.txt b/CMakeLists.txt index 7154af07aa0eda1f0b5c35a781c1cbf39957b7d6..95d78f49b0797fab0fcf5fbf0a53ea5577851e3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,10 @@ panda_target_compile_definitions(arkbytecodeopt PUBLIC -DENABLE_BYTECODE_OPT -DA add_custom_target(ecmascript_tests COMMENT "Running ecmascript test suites") +if(TARGET es2panda_tests) + add_dependencies(ecmascript_tests es2panda_tests) +endif() + # NB! ADDING THIS PROPERTY IS ALLOWED ONLY IN SPECIAL CASES. DO NOT COPY-PASTE IT. set_target_properties(ecmascript_tests PROPERTIES first-level-tests-dependency TRUE) add_dependencies(tests ecmascript_tests) @@ -36,8 +40,6 @@ if(PANDA_WITH_TOOLCHAIN) add_subdirectory(assembler) add_subdirectory(isa) add_subdirectory(irtoc_scripts) - add_subdirectory(es2panda) - add_dependencies(panda_bins es2panda) endif() add_subdirectory(bytecode_optimizer) diff --git a/HostTools.cmake b/HostTools.cmake index c775085f006fd0e97d4b002137ffc725e20381d3..e03d655778fe8964255a8a7001e283a738dc798e 100644 --- a/HostTools.cmake +++ b/HostTools.cmake @@ -1,4 +1,3 @@ -list(APPEND HOST_TOOLS_TARGETS es2panda) list(APPEND HOST_TOOLS_TARGETS irtoc_ecmascript_fastpath) list(APPEND HOST_TOOLS_BYPRODUCTS "${host_tools_build_dir}/irtoc/irtoc_ecmascript/irtoc_ecmascript_fastpath/irtoc_ecmascript_fastpath.o" diff --git a/plugin.gn b/plugin.gn index b9b78d9073bc71827ac0fff47552ca288796eb90..38f8a3e3c4cb0c22eb361e7bedc249e55d1d0c3b 100644 --- a/plugin.gn +++ b/plugin.gn @@ -1,2 +1,2 @@ -import("//ark/runtime_core/ark_root.gni") +import("//arkcompiler/runtime_core/static_core/ark_root.gni") import("$ark_root/plugins/ecmascript/subproject_sources.gn") diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 44e62a1c96273e17bcc363a0e1b6feeecff9e5f6..e3f0a6ab3916d36eaee6b7f8bfa89ec890be9534 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -224,6 +224,7 @@ panda_target_include_directories(arkruntime_obj PUBLIC ${PANDA_ECMASCRIPT_PLUGIN_SOURCE}/runtime ${PANDA_BINARY_ROOT}/compiler/generated ${PANDA_BINARY_ROOT}/plugins/ecmascript/ecmastdlib + ${ES2PANDA_PATH} ${ECMA_GEN_DIR} ) diff --git a/runtime/base/json_parser.h b/runtime/base/json_parser.h index 5d35d4df7d2115b9841c9ba543ff05611863f1bb..713da40f79d401f7422c4bf061cb85679b816539 100644 --- a/runtime/base/json_parser.h +++ b/runtime/base/json_parser.h @@ -29,7 +29,6 @@ #include "plugins/ecmascript/runtime/js_handle.h" #include "plugins/ecmascript/runtime/js_tagged_value.h" #include "plugins/ecmascript/runtime/object_factory.h" -#include "plugins/ecmascript/es2panda/util/helpers.h" #include "libpandabase/utils/utf.h" namespace panda::ecmascript::base { @@ -135,7 +134,7 @@ private: std::string str_num(current_, end_ + 1); current_ = end_; auto d = std::stod(str_num); - if (es2panda::util::Helpers::IsInteger(d)) { + if (static_cast(d) == d) { return JSTaggedValue(static_cast(d)); } return JSTaggedValue(d); diff --git a/runtime/js_eval.cpp b/runtime/js_eval.cpp index ebbee0d5ddf4479bb203d93f60ad345714c6b7d8..9519011e3252f2205836366ddc018bf823bbec4c 100644 --- a/runtime/js_eval.cpp +++ b/runtime/js_eval.cpp @@ -19,7 +19,7 @@ #include "plugins/ecmascript/runtime/base/builtins_base.h" #include "plugins/ecmascript/runtime/internal_call_params.h" #include "plugins/ecmascript/runtime/interpreter/interpreter-inl.h" -#include "plugins/ecmascript/es2panda/es2panda.h" +#include "plugins/ecmascript/es2panda/es2panda.h" // TODO(vpukhov): adjust es2panda path #include "assembler/assembly-emitter.h" namespace panda::ecmascript { diff --git a/subproject_sources.gn b/subproject_sources.gn index c2424dd465611a77dd10aa278f968b96b223e4ba..4e4bcaf2aeabd95a041f82f4a6cd1b69b6cac3b2 100644 --- a/subproject_sources.gn +++ b/subproject_sources.gn @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_root.gni") +import("//arkcompiler/runtime_core/static_core/ark_root.gni") _plugin_dir = get_path_info(".", "abspath") assert(string_replace(_plugin_dir, "//", "") != _plugin_dir) @@ -60,9 +60,9 @@ arkbytecodeopt_deps = [ "$_plugin_dir:isa_gen_ecma_bytecodeopt_ecmascript_codegen_intrinsics_gen_inc", ] arkruntime_deps = [ - "$ark_root/assembler:libarkassembler_frontend_static", - "$ark_root/libpandafile:libarkfile_frontend_static", - "$_plugin_dir/es2panda:libes2panda_frontend_static", + "$ark_root/assembler:libarktsassembler_frontend_static", + "$ark_root/libpandafile:libarktsfile_frontend_static", + "$ark_es2panda_root:libes2panda_frontend_static", ] runtime_yamls = [ "runtime/ecma_runtime.yaml" ] @@ -219,10 +219,10 @@ srcs_runtime = [ # Should be files deleted??? #srcs_arm = [ "bridge/arch/arm/builtin_bridge_arm.S" ] -if (current_cpu == "arm64") { +if (current_cpu == "arm") { + srcs_runtime += [ "runtime/bridge/arch/arm/builtin_bridge_arm.S" ] +} else if (current_cpu == "arm64") { srcs_runtime += [ "runtime/bridge/arch/aarch64/builtin_bridge_aarch64.S" ] -} - -if (current_cpu == "amd64" || current_cpu == "x64" || current_cpu == "x86_64") { +} else if (current_cpu == "amd64" || current_cpu == "x64" || current_cpu == "x86_64") { srcs_runtime += [ "runtime/bridge/arch/amd64/builtin_bridge_amd64.S" ] } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e63dc22b7bab6cc3151784c186317320d2997eae..3238f0455bf6b58acdb3e9b4039f5b23f8c0cfa8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -250,7 +250,8 @@ endfunction() if(CMAKE_CROSSCOMPILING) ExternalProject_Get_Property(panda_host_tools binary_dir) set(es2panda_target panda_host_tools-build) - set(es2panda_bin "${binary_dir}/plugins/ecmascript/es2panda/aot/es2panda") + # TODO(vpukhov): adjust es2panda path + set(es2panda_bin "${binary_dir}/plugins/ets/es2panda/aot/es2panda") else() set(es2panda_target es2panda) set(es2panda_bin $)