Skip to content

Commit 13dd5b8

Browse files
committed
[GR-49858] Change type of DynamicHub.hubType to byte.
1 parent f40dbb3 commit 13dd5b8

File tree

2 files changed

+5
-5
lines changed
  • substratevm/src

2 files changed

+5
-5
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/DynamicHub.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public final class DynamicHub implements AnnotatedElement, java.lang.reflect.Typ
184184
* The returned category does not necessarily match the {@link LayoutEncoding}, see
185185
* {@link Hybrid} objects for more details.
186186
*/
187-
private final int hubType;
187+
private final byte hubType;
188188

189189
/**
190190
* Used to quickly determine if this class is a subclass of {@link Reference}.
@@ -455,7 +455,7 @@ public final class DynamicHub implements AnnotatedElement, java.lang.reflect.Typ
455455
private ReflectionMetadata reflectionMetadata;
456456

457457
@Platforms(Platform.HOSTED_ONLY.class)
458-
public DynamicHub(Class<?> hostedJavaClass, String name, int hubType, ReferenceType referenceType, DynamicHub superType,
458+
public DynamicHub(Class<?> hostedJavaClass, String name, byte hubType, ReferenceType referenceType, DynamicHub superType,
459459
DynamicHub componentHub, String sourceFileName, int modifiers, short flags, ClassLoader classLoader,
460460
Class<?> nestHost, String simpleBinaryName, Object declaringClass, String signature, int layerId) {
461461
this.hostedJavaClass = hostedJavaClass;
@@ -503,7 +503,7 @@ public static DynamicHub allocate(String name, DynamicHub superHub, DynamicHub c
503503

504504
ReferenceType referenceType = ReferenceType.computeReferenceType(DynamicHub.toClass(superHub));
505505
// GR-59683: HubType.OBJECT_ARRAY?
506-
int hubTybe = referenceType == ReferenceType.None ? HubType.INSTANCE : HubType.REFERENCE_INSTANCE;
506+
byte hubType = (byte) ((referenceType == ReferenceType.None) ? HubType.INSTANCE : HubType.REFERENCE_INSTANCE);
507507

508508
DynamicHubCompanion companion = new DynamicHubCompanion(classLoader);
509509
/* Always allow unsafe allocation for classes that were loaded at run-time. */
@@ -555,7 +555,7 @@ public static DynamicHub allocate(String name, DynamicHub superHub, DynamicHub c
555555
DynamicHubOffsets dynamicHubOffsets = DynamicHubOffsets.singleton();
556556
/* Write fields in defining order. */
557557
writeObject(hub, dynamicHubOffsets.getNameOffset(), name);
558-
writeInt(hub, dynamicHubOffsets.getHubTypeOffset(), hubTybe);
558+
writeByte(hub, dynamicHubOffsets.getHubTypeOffset(), hubType);
559559
writeByte(hub, dynamicHubOffsets.getReferenceTypeOffset(), referenceType.getValue());
560560

561561
writeInt(hub, dynamicHubOffsets.getLayoutEncodingOffset(), layoutEncoding);

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/SVMHost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ public ClassInitializationSupport getClassInitializationSupport() {
610610
return classInitializationSupport;
611611
}
612612

613-
private static int computeHubType(AnalysisType type) {
613+
private static byte computeHubType(AnalysisType type) {
614614
if (type.isArray()) {
615615
if (type.getComponentType().isPrimitive() || type.getComponentType().isWordType()) {
616616
return HubType.PRIMITIVE_ARRAY;

0 commit comments

Comments
 (0)