Skip to content

Commit

Permalink
Move non-critical DynamicHub fields to companion object.
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-hofer committed Jan 14, 2025
1 parent 8388724 commit c9cfe19
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 335 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,54 +75,20 @@ public class DynamicHubOffsets {

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int flagsOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int additionalFlagsOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int modifiersOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int superHubOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int componentTypeOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int arrayHubOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int declaringClassOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int interfacesEncodingOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int enumConstantsReferenceOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int referenceMapIndexOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int layerIdOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int metaTypeOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int sourceFileNameOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int classInitializationInfoOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int moduleOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int nestHostOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int simpleBinaryNameOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int companionOffset;

@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int signatureOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int classRedefinedCountOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int hubMetadataOffset;
@UnknownPrimitiveField(availability = BuildPhaseProvider.ReadyForCompilation.class) //
private int reflectionMetadataOffset;

@Fold
public static DynamicHubOffsets singleton() {
Expand Down Expand Up @@ -205,38 +171,10 @@ public int getFlagsOffset() {
return flagsOffset;
}

public int getAdditionalFlagsOffset() {
return additionalFlagsOffset;
}

public int getModifiersOffset() {
return modifiersOffset;
}

public int getSuperHubOffset() {
return superHubOffset;
}

public int getComponentTypeOffset() {
return componentTypeOffset;
}

public int getArrayHubOffset() {
return arrayHubOffset;
}

public int getDeclaringClassOffset() {
return declaringClassOffset;
}

public int getInterfacesEncodingOffset() {
return interfacesEncodingOffset;
}

public int getEnumConstantsReferenceOffset() {
return enumConstantsReferenceOffset;
}

public int getReferenceMapIndexOffset() {
return referenceMapIndexOffset;
}
Expand All @@ -245,30 +183,6 @@ public int getLayerIdOffset() {
return layerIdOffset;
}

public int getMetaTypeOffset() {
return metaTypeOffset;
}

public int getSourceFileNameOffset() {
return sourceFileNameOffset;
}

public int getClassInitializationInfoOffset() {
return classInitializationInfoOffset;
}

public int getModuleOffset() {
return moduleOffset;
}

public int getNestHostOffset() {
return nestHostOffset;
}

public int getSimpleBinaryNameOffset() {
return simpleBinaryNameOffset;
}

public int getCompanionOffset() {
return companionOffset;
}
Expand All @@ -277,18 +191,6 @@ public int getSignatureOffset() {
return signatureOffset;
}

public int getClassRedefinedCountOffset() {
return classRedefinedCountOffset;
}

public int getHubMetadataOffset() {
return hubMetadataOffset;
}

public int getReflectionMetadataOffset() {
return reflectionMetadataOffset;
}

public static void writeObject(DynamicHub hub, int offset, Object value) {
if (offset < 0) {
/* field removed by analysis */
Expand Down
Loading

0 comments on commit c9cfe19

Please sign in to comment.