Skip to content

Commit

Permalink
Remove some value type primitive uses
Browse files Browse the repository at this point in the history
- remove J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE
- remove J9AccPrimitiveValueType
- remove J9ClassIsPrimitiveValueType from ddr

Signed-off-by: Theresa Mammarella <[email protected]>
  • Loading branch information
theresa-m committed Jul 5, 2024
1 parent dd01de1 commit 9200a69
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ J9JavaAccessFlags.J9StaticFieldRefTypeObject = 0
J9JavaAccessFlags.J9StaticFieldRefTypeShort = 0

J9JavaClassFlags.J9ClassIsFlattened = 0
J9JavaClassFlags.J9ClassIsPrimitiveValueType = 0
J9JavaClassFlags.J9ClassIsValueType = 0
J9JavaClassFlags.J9ClassLargestAlignmentConstraintDouble = 0
J9JavaClassFlags.J9ClassLargestAlignmentConstraintReference = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ public boolean isJ9ClassAValueType(J9ClassPointer clazz) throws CorruptDataExcep
return clazz.classFlags().allBitsIn(J9JavaClassFlags.J9ClassIsValueType);
}

@Override
public boolean isJ9ClassAPrimitiveValueType(J9ClassPointer clazz) throws CorruptDataException {
return clazz.classFlags().allBitsIn(J9JavaClassFlags.J9ClassIsPrimitiveValueType);
}

@Override
public boolean isFieldInClassFlattened(J9ClassPointer clazz, J9ROMFieldShapePointer fieldShape) throws CorruptDataException {
boolean result = false;
Expand Down Expand Up @@ -403,17 +398,6 @@ public boolean isJ9ClassAValueType(J9ClassPointer clazz) throws CorruptDataExcep
return false;
}

/**
* Queries if J9Class is a primitive value type
*
* @param clazz clazz to query
* @return true if class is a primitive value type, false otherwise
* @throws CorruptDataException
*/
public boolean isJ9ClassAPrimitiveValueType(J9ClassPointer clazz) throws CorruptDataException {
return false;
}

/**
* Queries whether field is flattened of not.
*
Expand Down
1 change: 0 additions & 1 deletion runtime/oti/j9javaaccessflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#define J9AccInterface 0x00000200 /* class */
#define J9AccGetterMethod 0x00000200 /* method */
#define J9AccAbstract 0x00000400 /* class method */
#define J9AccPrimitiveValueType 0x00000800 /* class(Valhalla) */
#define J9AccStrict 0x00000800 /* method */
#define J9AccSynthetic 0x00001000 /* class method field */
#define J9AccAnnotation 0x00002000 /* class */
Expand Down
6 changes: 0 additions & 6 deletions runtime/oti/j9modifiers_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@
#define J9ROMCLASS_IS_VALUE(romClass) FALSE
#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */

#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
#define J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE(romClass) _J9ROMCLASS_SUNMODIFIER_IS_SET((romClass), J9AccPrimitiveValueType)
#else /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
#define J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE(romClass) FALSE
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */

#define J9ROMMETHOD_IS_GETTER(romMethod) _J9ROMMETHOD_J9MODIFIER_IS_SET((romMethod), J9AccGetterMethod)
#define J9ROMMETHOD_IS_FORWARDER(romMethod) _J9ROMMETHOD_J9MODIFIER_IS_SET((romMethod), J9AccForwarderMethod)
#define J9ROMMETHOD_IS_EMPTY(romMethod) _J9ROMMETHOD_J9MODIFIER_IS_SET((romMethod), J9AccEmptyMethod)
Expand Down
7 changes: 1 addition & 6 deletions runtime/vm/createramclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2312,13 +2312,8 @@ internalCreateRAMClassDone(J9VMThread *vmThread, J9ClassLoader *classLoader, J9C
}
}
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
if (J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE(romClass)
|| J9_ARE_ALL_BITS_SET(classFlags, J9ClassAllowsInitialDefaultValue)
) {
if (J9_ARE_ALL_BITS_SET(classFlags, J9ClassAllowsInitialDefaultValue)) {
UDATA instanceSize = state->ramClass->totalInstanceSize;
if (J9ROMCLASS_IS_PRIMITIVE_VALUE_TYPE(romClass)) {
classFlags |= J9ClassIsPrimitiveValueType;
}
if ((instanceSize <= javaVM->valueFlatteningThreshold)
&& !J9ROMCLASS_IS_CONTENDED(romClass)
) {
Expand Down

0 comments on commit 9200a69

Please sign in to comment.