Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake build update for off-heap #20461

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions runtime/cmake/caches/aix_ppc-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@
################################################################################

#TODO: Env vars should be auto detected by platform

# Prevent CMake from automatically creating export lists for shared libraries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps leave extra space after the TODO line, which I don't know what it really refers, but like this it looks like it refers to the next 'set' line only
perhaps we can even remove the TODO line!?

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 "")
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 "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to change all the references in JIT code from J9VM_GC_ENABLE_SPARSE_HEAP_ALLOCATION to J9VM_GC_SPARSE_HEAP_ALLOCATION?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. @rmnattas, apologies for the inconvenience, but please update the JIT references.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it also in the plan to update UMA builds to support this flag?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, about to merge that PR.

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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/linux_390-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
4 changes: 2 additions & 2 deletions runtime/cmake/caches/linux_aarch64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/linux_ppc-64_le.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/linux_riscv64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/linux_x86-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/osx_aarch64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
3 changes: 2 additions & 1 deletion runtime/cmake/caches/osx_x86-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
9 changes: 5 additions & 4 deletions runtime/cmake/caches/win_x86-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/caches/zos_390-64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions runtime/cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions runtime/gc_modron_startup/mmhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
}

/**
Expand Down
1 change: 1 addition & 0 deletions runtime/include/j9cfg.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down