Skip to content

Commit

Permalink
Add areFlattenableValueTypesEnabled() for JIT
Browse files Browse the repository at this point in the history
eclipse-openj9#17394 has added new flag
J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES for flattenable value types.
The value object code is under the existing
J9VM_OPT_VALHALLA_VALUE_TYPES.
Add new API areFlattenableValueTypesEnabled() for JIT.

issue eclipse-openj9#17235

Signed-off-by: Hang Shao <[email protected]>
  • Loading branch information
hangshao0 authored and midronij committed May 24, 2023
1 parent 263e125 commit 7cd4e2d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/oti/j9nonbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4957,6 +4957,7 @@ typedef struct J9InternalVMFunctions {
void ( *setNestmatesError)(struct J9VMThread *vmThread, struct J9Class *nestMember, struct J9Class *nestHost, IDATA errorCode);
#endif /* JAVA_SPEC_VERSION >= 11 */
BOOLEAN ( *areValueTypesEnabled)(struct J9JavaVM *vm);
BOOLEAN ( *areFlattenableValueTypesEnabled)(struct J9JavaVM *vm);
J9Class* ( *peekClassHashTable)(struct J9VMThread* currentThread, J9ClassLoader* classLoader, U_8* className, UDATA classNameLength);
#if defined(J9VM_OPT_JITSERVER)
BOOLEAN ( *isJITServerEnabled )(struct J9JavaVM *vm);
Expand Down
8 changes: 8 additions & 0 deletions runtime/oti/vm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,14 @@ printBytecodePairs(J9JavaVM *vm);
BOOLEAN
areValueTypesEnabled(J9JavaVM *vm);

/**
* @brief Queries whether flattenable valueTypes are enable on the JVM
* @param vm A handle to the J9JavaVM
* @return TRUE if flattenable valueTypes are enabled, FALSE otherwise
*/
BOOLEAN
areFlattenableValueTypesEnabled(J9JavaVM *vm);

/**
* Checks if args in specified args array have been consumed by the JVM, if not it outputs a warning message
* and returns FALSE. This function consults the -XXvm:ignoreUnrecognized, -XX:[+|-]IgnoreUnrecognizedVMOptions
Expand Down
10 changes: 10 additions & 0 deletions runtime/vm/ValueTypeHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ areValueTypesEnabled(J9JavaVM *vm)
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
}

BOOLEAN
areFlattenableValueTypesEnabled(J9JavaVM *vm)
{
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
return TRUE;
#else /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
return FALSE;
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
}

j9object_t*
getDefaultValueSlotAddress(J9Class* clazz)
{
Expand Down
1 change: 1 addition & 0 deletions runtime/vm/intfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ J9InternalVMFunctions J9InternalFunctions = {
setNestmatesError,
#endif /* JAVA_SPEC_VERSION >= 11 */
areValueTypesEnabled,
areFlattenableValueTypesEnabled,
peekClassHashTable,
#if defined(J9VM_OPT_JITSERVER)
isJITServerEnabled,
Expand Down

0 comments on commit 7cd4e2d

Please sign in to comment.