diff --git a/runtime/oti/j9nonbuilder.h b/runtime/oti/j9nonbuilder.h index 756631ac329..ca5dfb4b3f7 100644 --- a/runtime/oti/j9nonbuilder.h +++ b/runtime/oti/j9nonbuilder.h @@ -1594,7 +1594,7 @@ typedef struct J9ROMFieldOffsetWalkResult { UDATA superTotalInstanceSize; UDATA index; IDATA backfillOffset; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) struct J9Class* flattenedClass; #endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ } J9ROMFieldOffsetWalkResult; @@ -1632,7 +1632,7 @@ typedef struct J9ROMFieldOffsetWalkState { struct J9HiddenInstanceField* hiddenInstanceFields[J9VM_MAX_HIDDEN_FIELDS_PER_CLASS]; UDATA hiddenInstanceFieldCount; UDATA hiddenInstanceFieldWalkIndex; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) struct J9FlattenedClassCache *flattenedClassCache; UDATA firstFlatSingleOffset; UDATA firstFlatObjectOffset; @@ -4832,7 +4832,7 @@ typedef struct J9InternalVMFunctions { UDATA ( *structuredSignalHandlerVM)(struct J9PortLibrary* portLibrary, U_32 gpType, void* gpInfo, void* userData) ; UDATA ( *addHiddenInstanceField)(struct J9JavaVM *vm, const char *className, const char *fieldName, const char *fieldSignature, UDATA *offsetReturn) ; void ( *reportHotField)(struct J9JavaVM *javaVM, int32_t reducedCpuUtil, J9Class* clazz, uint8_t fieldOffset, uint32_t reducedFrequency) ; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) struct J9ROMFieldOffsetWalkResult* ( *fieldOffsetsStartDo)(struct J9JavaVM *vm, struct J9ROMClass *romClass, struct J9Class *superClazz, struct J9ROMFieldOffsetWalkState *state, U_32 flags, J9FlattenedClassCache *flattenedClassCache) ; #else /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ struct J9ROMFieldOffsetWalkResult* ( *fieldOffsetsStartDo)(struct J9JavaVM *vm, struct J9ROMClass *romClass, struct J9Class *superClazz, struct J9ROMFieldOffsetWalkState *state, U_32 flags) ; @@ -5900,7 +5900,7 @@ typedef struct J9JavaVM { #endif /* WIN32 */ #endif /* J9VM_INTERP_ATOMIC_FREE_JNI_USES_FLUSH */ omrthread_monitor_t constantDynamicMutex; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) UDATA valueFlatteningThreshold; omrthread_monitor_t valueTypeVerificationMutex; struct J9Pool* valueTypeVerificationStackPool; diff --git a/runtime/oti/vm_api.h b/runtime/oti/vm_api.h index d4e4b0e6f03..d8f38d33a5a 100644 --- a/runtime/oti/vm_api.h +++ b/runtime/oti/vm_api.h @@ -2516,7 +2516,7 @@ instanceFieldOffsetWithSourceClass(J9VMThread *vmStruct, J9Class *clazz, U_8 *fi * @return J9ROMFieldOffsetWalkResult * */ J9ROMFieldOffsetWalkResult * -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9ROMFieldOffsetWalkState *state, U_32 flags, J9FlattenedClassCache *flattenedClassCache); #else /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9ROMFieldOffsetWalkState *state, U_32 flags); @@ -2667,7 +2667,7 @@ fullTraversalFieldOffsetsStartDo(J9JavaVM *vm, J9Class *clazz, J9ROMFullTraversa J9ROMFieldShape * fullTraversalFieldOffsetsNextDo(J9ROMFullTraversalFieldOffsetWalkState *state); -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) /** * @brief Search for ramClass in flattened class cache * diff --git a/runtime/vm/ObjectFieldInfo.cpp b/runtime/vm/ObjectFieldInfo.cpp index 63af43581c3..bebfcfd8c61 100644 --- a/runtime/vm/ObjectFieldInfo.cpp +++ b/runtime/vm/ObjectFieldInfo.cpp @@ -45,7 +45,7 @@ ObjectFieldInfo::countInstanceFields(void) const U_32 modifiers = field->modifiers; if (J9_ARE_NO_BITS_SET(modifiers, J9AccStatic) ) { if (modifiers & J9FieldFlagObject) { -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) J9UTF8 *fieldSig = J9ROMFIELDSHAPE_SIGNATURE(field); U_8 *fieldSigBytes = J9UTF8_DATA(J9ROMFIELDSHAPE_SIGNATURE(field)); if ('Q' == *fieldSigBytes) { @@ -152,7 +152,7 @@ ObjectFieldInfo::calculateTotalFieldsSizeAndBackfill() accumulator = ROUND_UP_TO_POWEROF2((UDATA)accumulator, (UDATA)_cacheLineSize) - _objectHeaderSize; /* Rounding takes care of the odd number of 4-byte fields. Remove the header */ } else { accumulator = _superclassFieldsSize + (_totalObjectCount * _referenceSize) + (_totalSingleCount * sizeof(U_32)) + (_totalDoubleCount * sizeof(U_64)); -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) accumulator += _totalFlatFieldDoubleBytes + _totalFlatFieldRefBytes + _totalFlatFieldSingleBytes; /* ValueTypes cannot be subtyped and their superClass contains no fields */ @@ -179,7 +179,7 @@ ObjectFieldInfo::calculateTotalFieldsSizeAndBackfill() } else { _subclassBackfillOffset = _superclassBackfillOffset; } -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) } else { /* If the first field does not start at zero, this means we added padding to satisfy * alignment requirements of double slot fields. We will use the J9ClassHasPrePadding flag diff --git a/runtime/vm/ObjectFieldInfo.hpp b/runtime/vm/ObjectFieldInfo.hpp index 681effd3309..d01282a384b 100644 --- a/runtime/vm/ObjectFieldInfo.hpp +++ b/runtime/vm/ObjectFieldInfo.hpp @@ -57,7 +57,7 @@ class ObjectFieldInfo { U_32 _contendedSingleCount; U_32 _contendedDoubleCount; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) bool _isValue; J9FlattenedClassCache *_flattenedClassCache; U_32 _totalFlatFieldDoubleBytes; @@ -99,7 +99,7 @@ class ObjectFieldInfo { OBJECT_SIZE_INCREMENT_IN_BYTES = 8 }; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) ObjectFieldInfo(J9JavaVM *vm, J9ROMClass *romClass, J9FlattenedClassCache *flattenedClassCache): #else ObjectFieldInfo(J9JavaVM *vm, J9ROMClass *romClass): @@ -120,7 +120,7 @@ class ObjectFieldInfo { _contendedObjectCount(0), _contendedSingleCount(0), _contendedDoubleCount(0), -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) _isValue(J9ROMCLASS_IS_VALUE(romClass)), _flattenedClassCache(flattenedClassCache), _totalFlatFieldDoubleBytes(0), @@ -498,7 +498,7 @@ class ObjectFieldInfo { return start + (isContendedClassLayout() ? _contendedObjectCount: getNonBackfilledObjectCount()) * _referenceSize; } -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) /** * @param start end of previous field area, which should be the first field area * @return offset to end of the flat doubles area diff --git a/runtime/vm/resolvefield.cpp b/runtime/vm/resolvefield.cpp index 4fb94a72540..078856890c5 100644 --- a/runtime/vm/resolvefield.cpp +++ b/runtime/vm/resolvefield.cpp @@ -748,7 +748,7 @@ addOrUpdateHotField(J9JavaVM *javaVM, J9Class* clazz, uint8_t fieldOffset, int32 } J9ROMFieldOffsetWalkResult * -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9ROMFieldOffsetWalkState *state, U_32 flags, J9FlattenedClassCache *flattenedClassCache) #else /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9ROMFieldOffsetWalkState *state, U_32 flags) @@ -767,7 +767,7 @@ fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9R state->romClass = romClass; state->hiddenInstanceFieldWalkIndex = (UDATA)-1; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) state->flattenedClassCache = flattenedClassCache; ObjectFieldInfo fieldInfo(vm, romClass, flattenedClassCache); @@ -865,7 +865,7 @@ fieldOffsetsStartDo(J9JavaVM *vm, J9ROMClass *romClass, J9Class *superClazz, J9R } state->result.totalInstanceSize = fieldInfo.calculateTotalFieldsSizeAndBackfill(); -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) state->flatBackFillSize = fieldInfo.getBackfillSize(); state->classRequiresPrePadding = fieldInfo.doesClassRequiresPrePadding(); state->firstFlatDoubleOffset = fieldInfo.calculateFieldDataStart(); @@ -1000,7 +1000,7 @@ fieldOffsetsNextDo(J9ROMFieldOffsetWalkState *state) BOOLEAN walkHiddenFields = FALSE; state->result.field = NULL; -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) state->result.flattenedClass = NULL; #endif /* J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES */ @@ -1102,7 +1102,7 @@ fieldOffsetsFindNext(J9ROMFieldOffsetWalkState *state, J9ROMFieldShape *field) if( state->walkFlags & J9VM_FIELD_OFFSET_WALK_INCLUDE_INSTANCE ) { { if( modifiers & J9FieldFlagObject ) { -#ifdef J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES +#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) J9UTF8 *fieldSig = J9ROMFIELDSHAPE_SIGNATURE(field); U_8 *fieldSigBytes = J9UTF8_DATA(fieldSig); if ('Q' == *fieldSigBytes) {