From 8e311c84194b658eff0b8c0a2b60b981e7f1df3a Mon Sep 17 00:00:00 2001 From: lhu Date: Thu, 31 Oct 2024 10:46:14 -0400 Subject: [PATCH] Cmake update for off-heap new define J9VM_GC_SPARSE_HEAP_ALLOCATION for cmake build Signed-off-by: lhu --- runtime/cmake/caches/aix_ppc-64.cmake | 9 +++++---- runtime/cmake/caches/linux_390-64.cmake | 1 + runtime/cmake/caches/linux_aarch64.cmake | 4 ++-- runtime/cmake/caches/linux_ppc-64_le.cmake | 1 + runtime/cmake/caches/linux_riscv64.cmake | 1 + runtime/cmake/caches/linux_x86-64.cmake | 1 + runtime/cmake/caches/osx_aarch64.cmake | 1 + runtime/cmake/caches/osx_x86-64.cmake | 3 ++- runtime/cmake/caches/win_x86-64.cmake | 9 +++++---- runtime/cmake/caches/win_x86.cmake | 1 + runtime/cmake/caches/zos_390-64.cmake | 1 + runtime/cmake/options.cmake | 1 + runtime/gc_modron_startup/mmhelpers.cpp | 6 +++--- runtime/include/j9cfg.h.in | 1 + 14 files changed, 26 insertions(+), 14 deletions(-) diff --git a/runtime/cmake/caches/aix_ppc-64.cmake b/runtime/cmake/caches/aix_ppc-64.cmake index 33b9c4f2ece..dd0caeb714d 100644 --- a/runtime/cmake/caches/aix_ppc-64.cmake +++ b/runtime/cmake/caches/aix_ppc-64.cmake @@ -21,6 +21,9 @@ ################################################################################ #TODO: Env vars should be auto detected by platform +# Prevent CMake from automatically creating export lists for shared libraries +set(CMAKE_XL_CreateExportList "" CACHE INTERNAL "") + set(J9VM_ARCH_POWER ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_DLPAR ON CACHE BOOL "") @@ -28,11 +31,9 @@ set(J9VM_ENV_HAS_FPU ON CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_CALLEE_GLOBAL_TABLE_SETUP OFF CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_USE_GLOBAL_TABLE ON CACHE BOOL "") -# Prevent CMake from automatically creating export lists for shared libraries -set(CMAKE_XL_CreateExportList "" CACHE INTERNAL "") - -set(J9VM_GC_TLH_PREFETCH_FTA OFF CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_GC_SUBPOOLS_ALIAS ON CACHE BOOL "") +set(J9VM_GC_TLH_PREFETCH_FTA OFF CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") set(J9VM_INTERP_TWO_PASS_EXCLUSIVE ON CACHE BOOL "") diff --git a/runtime/cmake/caches/linux_390-64.cmake b/runtime/cmake/caches/linux_390-64.cmake index 31f385b8e19..fcf501db0b9 100644 --- a/runtime/cmake/caches/linux_390-64.cmake +++ b/runtime/cmake/caches/linux_390-64.cmake @@ -26,6 +26,7 @@ set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN OFF CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_CALLEE_GLOBAL_TABLE_SETUP ON CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_USE_GLOBAL_TABLE ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_JIT_RUNTIME_INSTRUMENTATION ON CACHE BOOL "") set(J9VM_JIT_TRANSACTION_DIAGNOSTIC_THREAD_BLOCK ON CACHE BOOL "") diff --git a/runtime/cmake/caches/linux_aarch64.cmake b/runtime/cmake/caches/linux_aarch64.cmake index e63a1686db8..f6fd6c7427c 100644 --- a/runtime/cmake/caches/linux_aarch64.cmake +++ b/runtime/cmake/caches/linux_aarch64.cmake @@ -24,12 +24,12 @@ set(J9VM_ARCH_AARCH64 ON CACHE BOOL "") set(J9VM_ENV_HAS_FPU ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") +set(J9VM_GC_ENABLE_DOUBLE_MAP OFF CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") set(J9VM_INTERP_TWO_PASS_EXCLUSIVE ON CACHE BOOL "") - -set(J9VM_GC_ENABLE_DOUBLE_MAP OFF CACHE BOOL "") set(J9VM_INTERP_SIG_QUIT_THREAD_USES_SEMAPHORES OFF CACHE BOOL "") set(J9VM_JIT_NEW_DUAL_HELPERS OFF CACHE BOOL "") set(J9VM_OPT_ZERO ON CACHE BOOL "") diff --git a/runtime/cmake/caches/linux_ppc-64_le.cmake b/runtime/cmake/caches/linux_ppc-64_le.cmake index 940d6d63622..910c0da067b 100644 --- a/runtime/cmake/caches/linux_ppc-64_le.cmake +++ b/runtime/cmake/caches/linux_ppc-64_le.cmake @@ -28,6 +28,7 @@ set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_CALLEE_GLOBAL_TABLE_SETUP ON CACHE BOOL "") set(J9VM_ENV_SHARED_LIBS_USE_GLOBAL_TABLE ON CACHE BOOL "") set(J9VM_ENV_USE_GCC ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") diff --git a/runtime/cmake/caches/linux_riscv64.cmake b/runtime/cmake/caches/linux_riscv64.cmake index 135675c4537..dc139103f56 100644 --- a/runtime/cmake/caches/linux_riscv64.cmake +++ b/runtime/cmake/caches/linux_riscv64.cmake @@ -26,6 +26,7 @@ set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_GC_ENABLE_DOUBLE_MAP OFF CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_SIG_QUIT_THREAD_USES_SEMAPHORES OFF CACHE BOOL "") set(J9VM_MODULE_CODERT_VM OFF CACHE BOOL "") diff --git a/runtime/cmake/caches/linux_x86-64.cmake b/runtime/cmake/caches/linux_x86-64.cmake index 1570c4ea751..75cf80480a4 100644 --- a/runtime/cmake/caches/linux_x86-64.cmake +++ b/runtime/cmake/caches/linux_x86-64.cmake @@ -25,6 +25,7 @@ set(J9VM_ARCH_X86 ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_HAS_FPU ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") diff --git a/runtime/cmake/caches/osx_aarch64.cmake b/runtime/cmake/caches/osx_aarch64.cmake index db52447b7c1..d7ca1134eb4 100644 --- a/runtime/cmake/caches/osx_aarch64.cmake +++ b/runtime/cmake/caches/osx_aarch64.cmake @@ -26,6 +26,7 @@ set(J9VM_ENV_HAS_FPU ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") set(J9VM_GC_ENABLE_DOUBLE_MAP OFF CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH OFF CACHE BOOL "") diff --git a/runtime/cmake/caches/osx_x86-64.cmake b/runtime/cmake/caches/osx_x86-64.cmake index 7df011388a1..fae5f89b0a6 100644 --- a/runtime/cmake/caches/osx_x86-64.cmake +++ b/runtime/cmake/caches/osx_x86-64.cmake @@ -21,10 +21,11 @@ ################################################################################ set(J9VM_ARCH_X86 ON CACHE BOOL "") -set(J9VM_GC_ENABLE_DOUBLE_MAP ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_HAS_FPU ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") +set(J9VM_GC_ENABLE_DOUBLE_MAP ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") diff --git a/runtime/cmake/caches/win_x86-64.cmake b/runtime/cmake/caches/win_x86-64.cmake index 667466fa05b..39956d6546a 100644 --- a/runtime/cmake/caches/win_x86-64.cmake +++ b/runtime/cmake/caches/win_x86-64.cmake @@ -24,22 +24,23 @@ set(J9VM_ARCH_X86 ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_HAS_FPU OFF CACHE INTERNAL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") set(J9VM_INTERP_SIG_USR2 OFF CACHE BOOL "") set(J9VM_INTERP_TWO_PASS_EXCLUSIVE ON CACHE BOOL "") set(J9VM_INTERP_USE_UNSAFE_HELPER OFF CACHE BOOL "") -set(J9VM_MODULE_GDB OFF CACHE BOOL "") -set(J9VM_MODULE_GDB_PLUGIN OFF CACHE BOOL "") -set(J9VM_MODULE_WINDBG ON CACHE BOOL "") set(J9VM_MODULE_CODEGEN_IA32 ON CACHE BOOL "") set(J9VM_MODULE_CODERT_IA32 ON CACHE BOOL "") +set(J9VM_MODULE_GDB OFF CACHE BOOL "") +set(J9VM_MODULE_GDB_PLUGIN OFF CACHE BOOL "") set(J9VM_MODULE_JIT_IA32 ON CACHE BOOL "") set(J9VM_MODULE_JITRT_IA32 ON CACHE BOOL "") set(J9VM_MODULE_MASM2GAS ON CACHE BOOL "") -set(J9VM_OPT_SWITCH_STACKS_FOR_SIGNAL_HANDLER ON CACHE BOOL "") +set(J9VM_MODULE_WINDBG ON CACHE BOOL "") set(J9VM_OPT_NATIVE_CHARACTER_CONVERTER ON CACHE BOOL "") +set(J9VM_OPT_SWITCH_STACKS_FOR_SIGNAL_HANDLER ON CACHE BOOL "") set(J9VM_THR_ASYNC_NAME_UPDATE OFF CACHE BOOL "") set(OMR_GC_CONCURRENT_SCAVENGER ON CACHE BOOL "") diff --git a/runtime/cmake/caches/win_x86.cmake b/runtime/cmake/caches/win_x86.cmake index 778c21aa2fe..f21d7baabe4 100644 --- a/runtime/cmake/caches/win_x86.cmake +++ b/runtime/cmake/caches/win_x86.cmake @@ -24,6 +24,7 @@ set(J9VM_ARCH_X86 ON CACHE BOOL "") set(J9VM_ENV_DATA64 OFF CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN ON CACHE BOOL "") set(J9VM_ENV_SSE2_SUPPORT_DETECTION ON CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION OFF CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI ON CACHE BOOL "") set(J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH ON CACHE BOOL "") diff --git a/runtime/cmake/caches/zos_390-64.cmake b/runtime/cmake/caches/zos_390-64.cmake index 798c348f5ff..4f2268f4175 100644 --- a/runtime/cmake/caches/zos_390-64.cmake +++ b/runtime/cmake/caches/zos_390-64.cmake @@ -24,6 +24,7 @@ set(J9VM_ARCH_S390 ON CACHE BOOL "") set(J9VM_ENV_CALL_VIA_TABLE ON CACHE BOOL "") set(J9VM_ENV_DATA64 ON CACHE BOOL "") set(J9VM_ENV_LITTLE_ENDIAN OFF CACHE BOOL "") +set(J9VM_GC_SPARSE_HEAP_ALLOCATION ON CACHE BOOL "") # We need to modify the c/c++ compile rules to tweak the order of options for a2e. # Namely we need to make sure that the nosearch flag appears before our include paths. diff --git a/runtime/cmake/options.cmake b/runtime/cmake/options.cmake index d617c02836c..d5a8ac864f2 100644 --- a/runtime/cmake/options.cmake +++ b/runtime/cmake/options.cmake @@ -60,6 +60,7 @@ j9vm_shadowed_option(J9VM_GC_DEBUG_ASSERTS "Specialized GC assertions are used i # become discontiguous whenever this flag is enabled. Since there won't be any empty arraylet leaves, then arrayoid NULL pointers are no longer required since # all data is stored in a unique region. It additionaly reduces footprint, mainly for JNI primitive array critical. j9vm_shadowed_option(J9VM_GC_ENABLE_DOUBLE_MAP OMR_GC_DOUBLE_MAP_ARRAYLETS "Allows LINUX and OSX systems to double map arrays that are stored as arraylets.") +j9vm_shadowed_option(J9VM_GC_SPARSE_HEAP_ALLOCATION OMR_GC_SPARSE_HEAP_ALLOCATION "Allows large arrays to be allocated off-heap.") j9vm_shadowed_option(J9VM_GC_LARGE_OBJECT_AREA "Enable large object area (LOA) support") j9vm_shadowed_option(J9VM_GC_LEAF_BITS "Add leaf bit instance descriptions to classes") j9vm_shadowed_option(J9VM_GC_MINIMUM_OBJECT_SIZE "Guarantee a minimum size to all objects allocated") diff --git a/runtime/gc_modron_startup/mmhelpers.cpp b/runtime/gc_modron_startup/mmhelpers.cpp index 0b2ebe25530..558c2f2c7ec 100644 --- a/runtime/gc_modron_startup/mmhelpers.cpp +++ b/runtime/gc_modron_startup/mmhelpers.cpp @@ -182,11 +182,11 @@ j9gc_hot_reference_field_required(J9JavaVM *javaVM) BOOLEAN j9gc_off_heap_allocation_enabled(J9JavaVM *javaVM) { -#if defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION) +#if defined(J9VM_GC_SPARSE_HEAP_ALLOCATION) return MM_GCExtensions::getExtensions(javaVM)->isVirtualLargeObjectHeapEnabled; -#else /* defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION) */ +#else /* defined(J9VM_GC_SPARSE_HEAP_ALLOCATION) */ return FALSE; -#endif /* defined(J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION) */ +#endif /* defined(J9VM_GC_SPARSE_HEAP_ALLOCATION) */ } /** diff --git a/runtime/include/j9cfg.h.in b/runtime/include/j9cfg.h.in index 7a55c081640..18d4405ff9c 100644 --- a/runtime/include/j9cfg.h.in +++ b/runtime/include/j9cfg.h.in @@ -113,6 +113,7 @@ extern "C" { #cmakedefine J9VM_GC_DYNAMIC_CLASS_UNLOADING #cmakedefine J9VM_GC_DYNAMIC_NEW_SPACE_SIZING #cmakedefine J9VM_GC_ENABLE_DOUBLE_MAP +#cmakedefine J9VM_GC_SPARSE_HEAP_ALLOCATION #cmakedefine J9VM_GC_FINALIZATION #cmakedefine J9VM_GC_FRAGMENTED_HEAP #cmakedefine J9VM_GC_GENERATIONAL