From 3625eb5ba8fd2a8a5bc50e197da6522c5c896813 Mon Sep 17 00:00:00 2001 From: "yingguofeng@huawei.com" Date: Fri, 6 Jun 2025 18:45:12 +0800 Subject: [PATCH] Refactor(CMC-GC): Support cmcgc switch by option Issue: #ICCQIP Signed-off-by: yingguofeng@huawei.com Change-Id: I80caf8f94e9f7e414e52bd327fb8426b61ffc666 --- BUILD.gn | 5 ----- tooling/test/client_utils/test_list.cpp | 23 ++++++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index ad5f83eb..120bf836 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -189,11 +189,6 @@ config("ark_toolchain_common_config") { } else { defines += [ "NDEBUG" ] } - - if (toolchain_enable_cmc_gc) { - defines += [ "USE_CMC_GC" ] - defines += [ "USE_READ_BARRIER" ] - } } config("ark_toolchain_public_config") { diff --git a/tooling/test/client_utils/test_list.cpp b/tooling/test/client_utils/test_list.cpp index 8df36cce..ad742ab9 100644 --- a/tooling/test/client_utils/test_list.cpp +++ b/tooling/test/client_utils/test_list.cpp @@ -15,6 +15,7 @@ #include "tooling/test/client_utils/test_list.h" +#include "ecmascript/base/config.h" #include "tooling/test/client_utils/test_util.h" // testcase list @@ -92,11 +93,11 @@ static void RegisterTests() TestUtil::RegisterTest("JsSourceTest", GetJsSourceTest()); TestUtil::RegisterTest("JsTracingTest", GetJsTracingTest()); TestUtil::RegisterTest("JsWatchTest", GetJsWatchTest()); -#ifndef USE_CMC_GC - // Need support heapdump - TestUtil::RegisterTest("JsHeapdumpTest", GetJsHeapdumpTest()); - TestUtil::RegisterTest("JsHeapdumpLoopTest", GetJsHeapdumpLoopTest()); -#endif + if (!g_isEnableCMCGC) { + // Need support heapdump + TestUtil::RegisterTest("JsHeapdumpTest", GetJsHeapdumpTest()); + TestUtil::RegisterTest("JsHeapdumpLoopTest", GetJsHeapdumpLoopTest()); + } TestUtil::RegisterTest("JsStepintoTest", GetJsStepintoTest()); TestUtil::RegisterTest("JsStepoutTest", GetJsStepoutTest()); TestUtil::RegisterTest("JsStepoverTest", GetJsStepoverTest()); @@ -115,12 +116,12 @@ static void RegisterTests() TestUtil::RegisterTest("JsHeapusageTest", GetJsHeapusageTest()); TestUtil::RegisterTest("JsHeapusageAsyncTest", GetJsHeapusageAsyncTest()); TestUtil::RegisterTest("JsHeapusageStepTest", GetJsHeapusageStepTest()); -#ifndef USE_CMC_GC - // Need support allocation tracker - TestUtil::RegisterTest("JsAllocationtrackTest", GetJsAllocationtrackTest()); - TestUtil::RegisterTest("JsAllocationTrackLoopTest", GetJsAllocationTrackLoopTest()); - TestUtil::RegisterTest("JsAllocationTrackRecursionTest", GetJsAllocationTrackRecursionTest()); -#endif + if (!g_isEnableCMCGC) { + // Need support allocation tracker + TestUtil::RegisterTest("JsAllocationtrackTest", GetJsAllocationtrackTest()); + TestUtil::RegisterTest("JsAllocationTrackLoopTest", GetJsAllocationTrackLoopTest()); + TestUtil::RegisterTest("JsAllocationTrackRecursionTest", GetJsAllocationTrackRecursionTest()); + } TestUtil::RegisterTest("JsJsWatchBasicTypeTest", GetJsWatchBasicTypeTest()); TestUtil::RegisterTest("JsJsWatchSetTypeTest", GetJsWatchSetTypeTest()); TestUtil::RegisterTest("JsJsWatchOtherTypeTest", GetJsWatchOtherTypeTest()); -- Gitee