From ea41992c8a8a980601c8003eaf19d1944ce5732c Mon Sep 17 00:00:00 2001 From: Ilya Trubachev Date: Sun, 12 Mar 2023 19:55:10 +0300 Subject: [PATCH] clean runtime options Signed-off-by: Ilya Trubachev --- runtime/napi/jsnapi.cpp | 2 -- runtime_options.yaml | 6 +++--- tests/runtime/common/js_arrays/CMakeLists.txt | 2 +- tests/runtime/common/js_serializer_test.cpp | 4 +--- tests/runtime/common/js_typed_arrays/CMakeLists.txt | 2 +- tests/runtime/common/recursive_array/CMakeLists.txt | 2 +- tests/runtime/common/restargs/CMakeLists.txt | 2 +- tests/runtime/common/separate_jsvm_test.cpp | 4 ++-- tests/runtime/common/spread_primitives/CMakeLists.txt | 2 +- tests/runtime/mem/g1gc_barrier_test.cpp | 6 ++---- tests/runtime/mem/object_helpers_test.cpp | 3 +-- 11 files changed, 14 insertions(+), 21 deletions(-) diff --git a/runtime/napi/jsnapi.cpp b/runtime/napi/jsnapi.cpp index faef8f85f..b5612c644 100644 --- a/runtime/napi/jsnapi.cpp +++ b/runtime/napi/jsnapi.cpp @@ -114,7 +114,6 @@ LoadableAgentHandle S_DEBUGGER_AGENT; // NOLINT(fuchsia-statically-constructed- bool JSNApi::CreateRuntime(const RuntimeOption &option) { JSRuntimeOptions runtime_options; - runtime_options.SetRuntimeType("ecmascript"); // GC runtime_options.SetGcType(option.GetGcType()); @@ -131,7 +130,6 @@ bool JSNApi::CreateRuntime(const RuntimeOption &option) // Boot runtime_options.SetBootPandaFiles({}); runtime_options.SetLoadRuntimes({"ecmascript"}); - runtime_options.SetBootIntrinsicSpaces({"ecmascript"}); // Dfx base_options::Options base_options(""); diff --git a/runtime_options.yaml b/runtime_options.yaml index 8846157e9..4eddcae01 100644 --- a/runtime_options.yaml +++ b/runtime_options.yaml @@ -18,7 +18,7 @@ options: - ecmascript possible_values: - ecmascript - description: Load specified intrinsic spaces + description: Load specified intrinsic spaces. This option is for fine tuning. Use load-runtimes instead delimiter: ":" - name: boot-class-spaces @@ -28,7 +28,7 @@ options: possible_values: - core - ecmascript - description: Load specified class spaces + description: Load specified class spaces. This option is for fine tuning. Use load-runtimes instead delimiter: ":" - name: runtime-type @@ -37,7 +37,7 @@ options: possible_values: - core - ecmascript - description: Runtime type + description: Runtime type. This option is for fine tuning. Use load-runtimes instead - name: load-runtimes type: arg_list_t diff --git a/tests/runtime/common/js_arrays/CMakeLists.txt b/tests/runtime/common/js_arrays/CMakeLists.txt index 51168dc4d..4ebde375d 100644 --- a/tests/runtime/common/js_arrays/CMakeLists.txt +++ b/tests/runtime/common/js_arrays/CMakeLists.txt @@ -5,7 +5,7 @@ set(JS_ARRAYS_BIN ${CMAKE_CURRENT_BINARY_DIR}/js_arrays.abc) set(JS_ARRAYS_JS ${CMAKE_CURRENT_SOURCE_DIR}/js_arrays.js) set(JS_ARRAYS_VERIFY ${CMAKE_CURRENT_SOURCE_DIR}/verify.sh) -set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --boot-class-spaces=\"ecmascript\" --compiler-enable-jit=false --gc-type=stw --run-gc-in-place --runtime-type \"ecmascript\" ${JS_ARRAYS_BIN} _GLOBAL::func_main_0) +set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --compiler-enable-jit=false --gc-type=stw --run-gc-in-place --load-runtimes \"ecmascript\" ${JS_ARRAYS_BIN} _GLOBAL::func_main_0) add_custom_command( OUTPUT ${JS_ARRAYS_OUTPUT} diff --git a/tests/runtime/common/js_serializer_test.cpp b/tests/runtime/common/js_serializer_test.cpp index b9af24f5d..960613dd6 100644 --- a/tests/runtime/common/js_serializer_test.cpp +++ b/tests/runtime/common/js_serializer_test.cpp @@ -43,9 +43,7 @@ public: JSRuntimeOptions options; options.SetShouldLoadBootPandaFiles(false); options.SetShouldInitializeIntrinsics(false); - options.SetBootIntrinsicSpaces({"ecmascript"}); - options.SetBootClassSpaces({"ecmascript"}); - options.SetRuntimeType("ecmascript"); + options.SetLoadRuntimes({"ecmascript"}); ecmaVm = EcmaVM::Create(options); EXPECT_TRUE(ecmaVm != nullptr) << "Cannot create Runtime"; thread = ecmaVm->GetJSThread(); diff --git a/tests/runtime/common/js_typed_arrays/CMakeLists.txt b/tests/runtime/common/js_typed_arrays/CMakeLists.txt index 5528ad530..d95bcc6eb 100644 --- a/tests/runtime/common/js_typed_arrays/CMakeLists.txt +++ b/tests/runtime/common/js_typed_arrays/CMakeLists.txt @@ -5,7 +5,7 @@ set(JS_TYPED_ARRAYS_BIN ${CMAKE_CURRENT_BINARY_DIR}/js_typed_arrays.abc) set(JS_TYPED_ARRAYS_JS ${CMAKE_CURRENT_SOURCE_DIR}/js_typed_arrays.js) set(JS_TYPED_ARRAYS_VERIFY ${CMAKE_CURRENT_SOURCE_DIR}/verify.sh) -set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --boot-class-spaces=\"ecmascript\" --compiler-enable-jit=false --run-gc-in-place --runtime-type \"ecmascript\" ${JS_TYPED_ARRAYS_BIN} _GLOBAL::func_main_0) +set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --compiler-enable-jit=false --run-gc-in-place --load-runtimes \"ecmascript\" ${JS_TYPED_ARRAYS_BIN} _GLOBAL::func_main_0) add_custom_command( OUTPUT ${JS_TYPED_ARRAYS_OUTPUT} diff --git a/tests/runtime/common/recursive_array/CMakeLists.txt b/tests/runtime/common/recursive_array/CMakeLists.txt index 23407cfa2..684a7164a 100644 --- a/tests/runtime/common/recursive_array/CMakeLists.txt +++ b/tests/runtime/common/recursive_array/CMakeLists.txt @@ -5,7 +5,7 @@ set(RECURSIVE_ARRAY_BIN ${CMAKE_CURRENT_BINARY_DIR}/recursive_array.abc) set(RECURSIVE_ARRAY_JS ${CMAKE_CURRENT_SOURCE_DIR}/recursive_array.js) set(RECURSIVE_ARRAY_VERIFY ${CMAKE_CURRENT_SOURCE_DIR}/verify.sh) -set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --boot-class-spaces=\"ecmascript\" --compiler-enable-jit=false --run-gc-in-place --runtime-type \"ecmascript\" ${RECURSIVE_ARRAY_BIN} _GLOBAL::func_main_0) +set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --compiler-enable-jit=false --run-gc-in-place --load-runtimes \"ecmascript\" ${RECURSIVE_ARRAY_BIN} _GLOBAL::func_main_0) add_custom_command( OUTPUT ${RECURSIVE_ARRAY_OUTPUT} diff --git a/tests/runtime/common/restargs/CMakeLists.txt b/tests/runtime/common/restargs/CMakeLists.txt index 6a5b3ebb3..6fe8a39e8 100644 --- a/tests/runtime/common/restargs/CMakeLists.txt +++ b/tests/runtime/common/restargs/CMakeLists.txt @@ -5,7 +5,7 @@ set(RESTARGS_BIN ${CMAKE_CURRENT_BINARY_DIR}/restargs.abc) set(RESTARGS_JS ${CMAKE_CURRENT_SOURCE_DIR}/restargs.js) set(RESTARGS_VERIFY ${CMAKE_CURRENT_SOURCE_DIR}/verify.sh) -set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --boot-class-spaces=\"ecmascript\" --compiler-enable-jit=false --runtime-type \"ecmascript\" ${RESTARGS_BIN} _GLOBAL::func_main_0) +set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --compiler-enable-jit=false --load-runtimes \"ecmascript\" ${RESTARGS_BIN} _GLOBAL::func_main_0) add_custom_command( OUTPUT ${RESTARGS_OUTPUT} diff --git a/tests/runtime/common/separate_jsvm_test.cpp b/tests/runtime/common/separate_jsvm_test.cpp index 0b8aa369d..89b17215d 100644 --- a/tests/runtime/common/separate_jsvm_test.cpp +++ b/tests/runtime/common/separate_jsvm_test.cpp @@ -34,11 +34,11 @@ public: static void SetUpTestCase() { RuntimeOptions options; - options.SetLoadRuntimes({"core", "ecmascript"}); + options.SetBootClassSpaces({"core", "ecmascript"}); + options.SetBootIntrinsicSpaces({"ecmascript"}); options.SetRuntimeType("core"); options.SetBootPandaFiles({}); options.SetShouldLoadBootPandaFiles(false); - options.SetBootIntrinsicSpaces({"ecmascript"}); options.SetRunGcInPlace(true); options.SetGcType("g1-gc"); [[maybe_unused]] bool success = Runtime::Create(options); diff --git a/tests/runtime/common/spread_primitives/CMakeLists.txt b/tests/runtime/common/spread_primitives/CMakeLists.txt index a67082419..519d3c222 100644 --- a/tests/runtime/common/spread_primitives/CMakeLists.txt +++ b/tests/runtime/common/spread_primitives/CMakeLists.txt @@ -5,7 +5,7 @@ set(SPREAD_PRIMITIVES_BIN ${CMAKE_CURRENT_BINARY_DIR}/spread_primitives.abc) set(SPREAD_PRIMITIVES_JS ${CMAKE_CURRENT_SOURCE_DIR}/spread_primitives.js) set(SPREAD_PRIMITIVES_VERIFY ${CMAKE_CURRENT_SOURCE_DIR}/verify.sh) -set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --boot-class-spaces=\"ecmascript\" --compiler-enable-jit=false --run-gc-in-place --runtime-type \"ecmascript\" ${SPREAD_PRIMITIVES_BIN} _GLOBAL::func_main_0) +set(RUNTIME_ARGUMENTS --boot-panda-files=${CMAKE_BINARY_DIR}/pandastdlib/arkstdlib.abc --compiler-enable-jit=false --run-gc-in-place --load-runtimes \"ecmascript\" ${SPREAD_PRIMITIVES_BIN} _GLOBAL::func_main_0) add_custom_command( OUTPUT ${SPREAD_PRIMITIVES_OUTPUT} diff --git a/tests/runtime/mem/g1gc_barrier_test.cpp b/tests/runtime/mem/g1gc_barrier_test.cpp index 12c7d7271..af01683df 100644 --- a/tests/runtime/mem/g1gc_barrier_test.cpp +++ b/tests/runtime/mem/g1gc_barrier_test.cpp @@ -21,8 +21,7 @@ public: explicit G1GCBarrierTest(size_t promotion_region_alive_rate = 100) { RuntimeOptions options; - options.SetBootClassSpaces({"ecmascript"}); - options.SetRuntimeType("ecmascript"); + options.SetLoadRuntimes({"ecmascript"}); options.SetGcType("g1-gc"); options.SetRunGcInPlace(true); options.SetCompilerEnableJit(false); @@ -124,8 +123,7 @@ public: G1GCClassCollectionTest() { RuntimeOptions options; - options.SetBootClassSpaces({"ecmascript"}); - options.SetRuntimeType("ecmascript"); + options.SetLoadRuntimes({"ecmascript"}); options.SetGcType("g1-gc"); options.SetRunGcInPlace(true); options.SetG1TrackFreedObjects(GetParam() ? "true" : "false"); diff --git a/tests/runtime/mem/object_helpers_test.cpp b/tests/runtime/mem/object_helpers_test.cpp index a2a37d2d0..cc5c9227a 100644 --- a/tests/runtime/mem/object_helpers_test.cpp +++ b/tests/runtime/mem/object_helpers_test.cpp @@ -28,8 +28,7 @@ public: DynamicObjectHelpersTest() { RuntimeOptions options; - options.SetBootClassSpaces({"ecmascript"}); - options.SetRuntimeType("ecmascript"); + options.SetLoadRuntimes({"ecmascript"}); options.SetGcType("epsilon"); options.SetGcTriggerType("debug-never"); auto exec_path = panda::os::file::File::GetExecutablePath(); -- Gitee