Skip to content

Commit bd36b1d

Browse files
authored
Merge pull request #20325 from theresa-m/fix_19611
Rename Preload attribute to LoadableDescriptors
2 parents 636d4a0 + 25469ba commit bd36b1d

26 files changed

+295
-245
lines changed

debugtools/DDR_VM/src/com/ibm/j9ddr/CompatibilityConstants29.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ J9JavaClassFlags.J9ClassRequiresPrePadding = 0
8484

8585
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_IMPLICITCREATION_ATTRIBUTE = 0
8686
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_INJECTED_INTERFACE_INFO = 0
87+
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE = 0
8788
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PERMITTEDSUBCLASSES_ATTRIBUTE = 0
88-
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE = 0
8989
J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_RECORD_ATTRIBUTE = 0
9090

9191
J9Object.OBJECT_HEADER_LOCK_LEARNING = 0

debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/OptInfo.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_ENCLOSING_METHOD;
2828
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_GENERIC_SIGNATURE;
2929
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_IMPLICITCREATION_ATTRIBUTE;
30+
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE;
3031
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PERMITTEDSUBCLASSES_ATTRIBUTE;
31-
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE;
3232
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_SIMPLE_NAME;
3333
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_SOURCE_DEBUG_EXTENSION;
3434
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_SOURCE_FILE_NAME;
@@ -268,28 +268,28 @@ public static J9UTF8Pointer getPermittedSubclassNameAtIndex(J9ROMClassPointer ro
268268
return J9UTF8Pointer.NULL;
269269
}
270270

271-
public static int getPreloadClassCount(J9ROMClassPointer romClass) throws CorruptDataException {
272-
U32Pointer preloadClassInfoPointer = getPreloadClassInfoPointer(romClass);
273-
if (preloadClassInfoPointer.notNull()) {
274-
return preloadClassInfoPointer.at(0).intValue();
271+
public static int getLoadableDescriptorsCount(J9ROMClassPointer romClass) throws CorruptDataException {
272+
U32Pointer loadableDescriptorsInfoPointer = getLoadableDescriptorsInfoPointer(romClass);
273+
if (loadableDescriptorsInfoPointer.notNull()) {
274+
return loadableDescriptorsInfoPointer.at(0).intValue();
275275
}
276276
return 0;
277277
}
278278

279-
private static U32Pointer getPreloadClassInfoPointer(J9ROMClassPointer romClass) throws CorruptDataException {
279+
private static U32Pointer getLoadableDescriptorsInfoPointer(J9ROMClassPointer romClass) throws CorruptDataException {
280280
SelfRelativePointer srpPtr = getSRPPtr(J9ROMClassHelper.optionalInfo(romClass), romClass.optionalFlags(),
281-
J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE);
281+
J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE);
282282
if (srpPtr.notNull()) {
283283
return U32Pointer.cast(srpPtr.get());
284284
}
285285
return U32Pointer.NULL;
286286
}
287287

288-
public static J9UTF8Pointer getPreloadClassNameAtIndex(J9ROMClassPointer romClass, int index) throws CorruptDataException {
289-
U32Pointer preloadClassInfoPointer = getPreloadClassInfoPointer(romClass);
290-
if (preloadClassInfoPointer.notNull()) {
291-
/* extra 1 is to move past the preload class count */
292-
SelfRelativePointer nameSrp = SelfRelativePointer.cast(preloadClassInfoPointer.add(index + 1));
288+
public static J9UTF8Pointer getLoadableDescriptorAtIndex(J9ROMClassPointer romClass, int index) throws CorruptDataException {
289+
U32Pointer loadableDescriptorsInfoPointer = getLoadableDescriptorsInfoPointer(romClass);
290+
if (loadableDescriptorsInfoPointer.notNull()) {
291+
/* extra 1 is to move past the descriptors count */
292+
SelfRelativePointer nameSrp = SelfRelativePointer.cast(loadableDescriptorsInfoPointer.add(index + 1));
293293
return J9UTF8Pointer.cast(nameSrp.get());
294294
}
295295
return J9UTF8Pointer.NULL;

debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/pointer/helper/J9ROMClassHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import static com.ibm.j9ddr.vm29.structure.J9JavaAccessFlags.*;
2525
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_IMPLICITCREATION_ATTRIBUTE;
26-
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE;
26+
import static com.ibm.j9ddr.vm29.structure.J9NonbuilderConstants.J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE;
2727

2828
import com.ibm.j9ddr.CorruptDataException;
2929
import com.ibm.j9ddr.vm29.pointer.U32Pointer;
@@ -135,8 +135,8 @@ public static boolean isSealed(J9ROMClassPointer romclass) throws CorruptDataExc
135135
return romclass.extraModifiers().allBitsIn(J9AccSealed);
136136
}
137137

138-
public static boolean hasPreloadAttribute(J9ROMClassPointer romclass) throws CorruptDataException {
139-
return romclass.optionalFlags().allBitsIn(J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE);
138+
public static boolean hasLoadableDescriptorsAttribute(J9ROMClassPointer romclass) throws CorruptDataException {
139+
return romclass.optionalFlags().allBitsIn(J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE);
140140
}
141141

142142
public static boolean hasImplicitCreationAttribute(J9ROMClassPointer romclass) throws CorruptDataException {

debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/tools/ddrinteractive/RomClassWalker.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,9 @@ void allSlotsInOptionalInfoDo() throws CorruptDataException
750750
cursor = cursor.add(1);
751751
}
752752

753-
if (J9ROMClassHelper.hasPreloadAttribute(romClass)) {
754-
classWalkerCallback.addSlot(clazz, SlotType.J9_SRP, cursor, "preloadAttributeSRP");
755-
preloadAttributeDo(U32Pointer.cast(cursor.get()));
753+
if (J9ROMClassHelper.hasLoadableDescriptorsAttribute(romClass)) {
754+
classWalkerCallback.addSlot(clazz, SlotType.J9_SRP, cursor, "loadableDescriptorsAttributeSRP");
755+
loadableDescriptorsAttributeDo(U32Pointer.cast(cursor.get()));
756756
cursor = cursor.add(1);
757757
}
758758
}
@@ -1018,19 +1018,21 @@ void permittedSubclassAttributeDo(U32Pointer attribute) throws CorruptDataExcept
10181018
classWalkerCallback.addSection(clazz, attributeStart, attribute.getAddress() - attributeStart.getAddress(), "permittedSubclass", true);
10191019
}
10201020

1021-
void preloadAttributeDo(U32Pointer attribute) throws CorruptDataException
1021+
void loadableDescriptorsAttributeDo(U32Pointer attribute) throws CorruptDataException
10221022
{
10231023
if (attribute.isNull()) {
10241024
return;
10251025
}
10261026
U32Pointer attributeStart = attribute;
1027-
classWalkerCallback.addSlot(clazz, SlotType.J9_U32, attribute, "numberPreloadClasses");
1028-
for (int i = 0, numPreloadClasses = attribute.at(0).intValue(); i < numPreloadClasses; i++) {
1027+
classWalkerCallback.addSlot(clazz, SlotType.J9_U32, attribute, "numberLoadableDescriptors");
1028+
for (int i = 0, numLoadableDescriptors = attribute.at(0).intValue(); i < numLoadableDescriptors; i++) {
10291029
attribute = attribute.add(1);
1030-
classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, attribute, "preloadClassName");
1030+
classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, attribute, "loadableDescriptorName");
10311031
}
10321032
attribute = attribute.add(1);
1033-
classWalkerCallback.addSection(clazz, attributeStart, attribute.getAddress() - attributeStart.getAddress(), "preloadAttribute", true);
1033+
classWalkerCallback.addSection(clazz, attributeStart,
1034+
attribute.getAddress() - attributeStart.getAddress(),
1035+
"loadableDescriptorsAttribute", true);
10341036
}
10351037

10361038
void implicitCreationAttributeDo(U32Pointer attribute) throws CorruptDataException

debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/tools/ddrinteractive/commands/J9BCUtil.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,13 @@ public static void j9bcutil_dumpRomClass(PrintStream out, J9ROMClassPointer romC
639639
}
640640
}
641641

642-
if (J9ROMClassHelper.hasPreloadAttribute(romClass)) {
643-
int preloadClassCount = OptInfo.getPreloadClassCount(romClass);
644-
out.format("Preload classes (%d):%n", preloadClassCount);
642+
if (J9ROMClassHelper.hasLoadableDescriptorsAttribute(romClass)) {
643+
int loadableDescriptorsCount = OptInfo.getLoadableDescriptorsCount(romClass);
644+
out.format("Loadable Descriptors (%d):%n", loadableDescriptorsCount);
645645

646-
for (int i = 0; i < preloadClassCount; i++) {
647-
J9UTF8Pointer preloadClassName = OptInfo.getPreloadClassNameAtIndex(romClass, i);
648-
out.format(" %s%n", J9UTF8Helper.stringValue(preloadClassName));
646+
for (int i = 0; i < loadableDescriptorsCount; i++) {
647+
J9UTF8Pointer loadableDescriptor = OptInfo.getLoadableDescriptorAtIndex(romClass, i);
648+
out.format(" %s%n", J9UTF8Helper.stringValue(loadableDescriptor));
649649
}
650650
}
651651

runtime/bcutil/ClassFileOracle.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ ClassFileOracle::ClassFileOracle(BufferManager *bufferManager, J9CfrClassFile *c
231231
_isRecord(false),
232232
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
233233
_hasNonStaticSynchronizedMethod(false),
234-
_preloadAttribute(NULL),
234+
_loadableDescriptorsAttribute(NULL),
235235
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
236236
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
237237
_hasImplicitCreationAttribute(false),
@@ -632,11 +632,11 @@ ClassFileOracle::walkAttributes()
632632
break;
633633
}
634634
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
635-
case CFR_ATTRIBUTE_Preload: {
636-
_preloadAttribute = (J9CfrAttributePreload *)attrib;
637-
for (U_16 numberOfClasses = 0; numberOfClasses < _preloadAttribute->numberOfClasses; numberOfClasses++) {
638-
U_16 classCpIndex = _preloadAttribute->classes[numberOfClasses];
639-
markClassAsReferenced(classCpIndex);
635+
case CFR_ATTRIBUTE_LoadableDescriptors: {
636+
_loadableDescriptorsAttribute = (J9CfrAttributeLoadableDescriptors *)attrib;
637+
for (U_16 numberOfDescriptors = 0; numberOfDescriptors < _loadableDescriptorsAttribute->numberOfDescriptors; numberOfDescriptors++) {
638+
U_16 descriptorCpIndex = _loadableDescriptorsAttribute->descriptors[numberOfDescriptors];
639+
markConstantUTF8AsReferenced(descriptorCpIndex);
640640
}
641641
break;
642642
}

runtime/bcutil/ClassFileOracle.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,14 +1018,13 @@ class RecordComponentIterator
10181018
U_16 getPermittedSubclassesClassCount() const { return _isSealed ? _permittedSubclassesAttribute->numberOfClasses : 0; }
10191019
bool isValueBased() const { return _isClassValueBased; }
10201020
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
1021-
bool hasPreloadClasses() const { return NULL != _preloadAttribute; }
1022-
U_16 getPreloadClassCount() const { return hasPreloadClasses() ? _preloadAttribute->numberOfClasses : 0; }
1021+
bool hasLoadableDescriptors() const { return NULL != _loadableDescriptorsAttribute; }
1022+
U_16 getLoadableDescriptorsCount() const { return hasLoadableDescriptors() ? _loadableDescriptorsAttribute->numberOfDescriptors : 0; }
10231023

1024-
U_16 getPreloadClassNameAtIndex(U_16 index) const {
1024+
U_16 getLoadableDescriptorAtIndex(U_16 index) const {
10251025
U_16 result = 0;
1026-
if (hasPreloadClasses()) {
1027-
U_16 classCpIndex = _preloadAttribute->classes[index];
1028-
result = _classFile->constantPool[classCpIndex].slot1;
1026+
if (hasLoadableDescriptors()) {
1027+
result = _loadableDescriptorsAttribute->descriptors[index];
10291028
}
10301029
return result;
10311030
}
@@ -1163,7 +1162,7 @@ class RecordComponentIterator
11631162
J9CfrAttributeBootstrapMethods *_bootstrapMethodsAttribute;
11641163
J9CfrAttributePermittedSubclasses *_permittedSubclassesAttribute;
11651164
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
1166-
J9CfrAttributePreload *_preloadAttribute;
1165+
J9CfrAttributeLoadableDescriptors *_loadableDescriptorsAttribute;
11671166
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
11681167
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
11691168
bool _hasImplicitCreationAttribute;

runtime/bcutil/ClassFileWriter.cpp

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ DECLARE_UTF8_ATTRIBUTE_NAME(BOOTSTRAP_METHODS, "BootstrapMethods");
6565
DECLARE_UTF8_ATTRIBUTE_NAME(RECORD, "Record");
6666
DECLARE_UTF8_ATTRIBUTE_NAME(PERMITTED_SUBCLASSES, "PermittedSubclasses");
6767
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
68-
DECLARE_UTF8_ATTRIBUTE_NAME(PRELOAD, "Preload");
68+
DECLARE_UTF8_ATTRIBUTE_NAME(LOADABLEDESCRIPTORS, "LoadableDescriptors");
6969
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
7070
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
7171
DECLARE_UTF8_ATTRIBUTE_NAME(IMPLICITCREATION, "ImplicitCreation");
@@ -118,14 +118,14 @@ ClassFileWriter::analyzeROMClass()
118118
}
119119

120120
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
121-
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE)) {
122-
addEntry((void*) &PRELOAD, 0, CFR_CONSTANT_Utf8);
121+
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE)) {
122+
addEntry((void *) &LOADABLEDESCRIPTORS, 0, CFR_CONSTANT_Utf8);
123123

124-
U_32 *preloadInfoPtr = getPreloadInfoPtr(_romClass);
125-
U_32 numberOfPreloadClasses = *preloadInfoPtr;
126-
for (U_32 i = 0; i < numberOfPreloadClasses; i++) {
127-
J9UTF8* preloadClassNameUtf8 = preloadClassNameAtIndex(preloadInfoPtr, i);
128-
addEntry(preloadClassNameUtf8, 0, CFR_CONSTANT_Utf8);
124+
U_32 *loadableDescriptorsInfoPtr = getLoadableDescriptorsInfoPtr(_romClass);
125+
U_32 numberOfLoadableDescriptors = *loadableDescriptorsInfoPtr;
126+
for (U_32 i = 0; i < numberOfLoadableDescriptors; i++) {
127+
J9UTF8 *loadableDescriptorUtf8 = loadableDescriptorAtIndex(loadableDescriptorsInfoPtr, i);
128+
addEntry(loadableDescriptorUtf8, 0, CFR_CONSTANT_Utf8);
129129
}
130130
}
131131
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
@@ -1044,7 +1044,7 @@ ClassFileWriter::writeAttributes()
10441044
}
10451045
#endif /* JAVA_SPEC_VERSION >= 11 */
10461046
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
1047-
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE)) {
1047+
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE)) {
10481048
attributesCount += 1;
10491049
}
10501050
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
@@ -1222,29 +1222,17 @@ ClassFileWriter::writeAttributes()
12221222
}
12231223

12241224
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
1225-
/* write Preload attribute */
1226-
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE)) {
1227-
U_32 *preloadInfoPtr = getPreloadInfoPtr(_romClass);
1228-
/* The first 32 bits of preloadInfoPtr contain the number of preload classes */
1229-
U_32 numberPreloadClasses = *preloadInfoPtr;
1230-
writeAttributeHeader((J9UTF8 *) &PRELOAD, sizeof(U_16) + (numberPreloadClasses * sizeof(U_16)));
1231-
writeU16(numberPreloadClasses);
1232-
1233-
for (U_32 i = 0; i < numberPreloadClasses; i++) {
1234-
J9UTF8* preloadClassNameUtf8 = preloadClassNameAtIndex(preloadInfoPtr, i);
1235-
/* CONSTANT_Class_info index should be written. Find class entry that references the preload class name in constant pool. */
1236-
J9HashTableState hashTableState;
1237-
HashTableEntry * entry = (HashTableEntry *) hashTableStartDo(_cpHashTable, &hashTableState);
1238-
while (NULL != entry) {
1239-
if (CFR_CONSTANT_Class == entry->cpType) {
1240-
J9UTF8* classNameCandidate = (J9UTF8*)entry->address;
1241-
if (J9UTF8_EQUALS(classNameCandidate, preloadClassNameUtf8)) {
1242-
writeU16(entry->cpIndex);
1243-
break;
1244-
}
1245-
}
1246-
entry = (HashTableEntry *) hashTableNextDo(&hashTableState);
1247-
}
1225+
/* write LoadableDescriptors attribute */
1226+
if (J9_ARE_ALL_BITS_SET(_romClass->optionalFlags, J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE)) {
1227+
U_32 *loadableDescriptorsInfoPtr = getLoadableDescriptorsInfoPtr(_romClass);
1228+
/* The first 32 bits of loadableDescriptorsInfoPtr contain the number of descriptors */
1229+
U_32 numberLoadableDescriptors = *loadableDescriptorsInfoPtr;
1230+
writeAttributeHeader((J9UTF8 *) &LOADABLEDESCRIPTORS, sizeof(U_16) + (numberLoadableDescriptors * sizeof(U_16)));
1231+
writeU16(numberLoadableDescriptors);
1232+
1233+
for (U_32 i = 0; i < numberLoadableDescriptors; i++) {
1234+
J9UTF8 *loadableDescriptorUtf8 = loadableDescriptorAtIndex(loadableDescriptorsInfoPtr, i);
1235+
writeU16(indexForUTF8(loadableDescriptorUtf8));
12481236
}
12491237
}
12501238
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */

runtime/bcutil/ROMClassBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,8 +1429,8 @@ ROMClassBuilder::computeOptionalFlags(ClassFileOracle *classFileOracle, ROMClass
14291429
if (_interfaceInjectionInfo.numOfInterfaces > 0) {
14301430
optionalFlags |= J9_ROMCLASS_OPTINFO_INJECTED_INTERFACE_INFO;
14311431
}
1432-
if (classFileOracle->hasPreloadClasses()) {
1433-
optionalFlags |= J9_ROMCLASS_OPTINFO_PRELOAD_ATTRIBUTE;
1432+
if (classFileOracle->hasLoadableDescriptors()) {
1433+
optionalFlags |= J9_ROMCLASS_OPTINFO_LOADABLEDESCRIPTORS_ATTRIBUTE;
14341434
}
14351435
#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */
14361436
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)

runtime/bcutil/ROMClassWriter.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ ROMClassWriter::ROMClassWriter(BufferManager *bufferManager, ClassFileOracle *cl
321321
#endif /* defined(J9VM_OPT_METHOD_HANDLE) */
322322
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
323323
_injectedInterfaceInfoSRPKey(srpKeyProducer->generateKey()),
324-
_preloadInfoSRPKey(srpKeyProducer->generateKey()),
324+
_loadableDescriptorsInfoSRPKey(srpKeyProducer->generateKey()),
325325
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
326326
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
327327
_implicitCreationSRPKey(srpKeyProducer->generateKey()),
@@ -460,7 +460,7 @@ ROMClassWriter::writeROMClass(Cursor *cursor,
460460
writePermittedSubclasses(cursor, markAndCountOnly);
461461
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
462462
writeInjectedInterfaces(cursor, markAndCountOnly);
463-
writePreload(cursor, markAndCountOnly);
463+
writeloadableDescriptors(cursor, markAndCountOnly);
464464
#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */
465465
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
466466
writeImplicitCreation(cursor, markAndCountOnly);
@@ -1913,30 +1913,30 @@ ROMClassWriter::writeImplicitCreation(Cursor *cursor, bool markAndCountOnly)
19131913

19141914
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
19151915
/*
1916-
* Preload ROM class layout:
1917-
* 4 bytes for number of classes (actually takes up two, but use 4 for alignment)
1918-
* for number of classes:
1919-
* 4 byte SRP to class name
1916+
* LoadableDescriptors ROM class layout:
1917+
* 4 bytes for number of descriptors (actually takes up two, but use 4 for alignment)
1918+
* for number of descriptors:
1919+
* 4 byte SRP to descriptor
19201920
*/
19211921
void
1922-
ROMClassWriter::writePreload(Cursor *cursor, bool markAndCountOnly)
1922+
ROMClassWriter::writeloadableDescriptors(Cursor *cursor, bool markAndCountOnly)
19231923
{
1924-
if (_classFileOracle->hasPreloadClasses()) {
1925-
cursor->mark(_preloadInfoSRPKey);
1924+
if (_classFileOracle->hasLoadableDescriptors()) {
1925+
cursor->mark(_loadableDescriptorsInfoSRPKey);
19261926

1927-
U_16 classCount = _classFileOracle->getPreloadClassCount();
1927+
U_16 descriptorCount = _classFileOracle->getLoadableDescriptorsCount();
19281928
if (markAndCountOnly) {
19291929
cursor->skip(sizeof(U_32));
19301930
} else {
1931-
cursor->writeU32(classCount, Cursor::GENERIC);
1931+
cursor->writeU32(descriptorCount, Cursor::GENERIC);
19321932
}
19331933

1934-
for (U_16 index = 0; index < classCount; index++) {
1934+
for (U_16 index = 0; index < descriptorCount; index++) {
19351935
if (markAndCountOnly) {
19361936
cursor->skip(sizeof(J9SRP));
19371937
} else {
1938-
U_16 classNameCpIndex = _classFileOracle->getPreloadClassNameAtIndex(index);
1939-
cursor->writeSRP(_srpKeyProducer->mapCfrConstantPoolIndexToKey(classNameCpIndex), Cursor::SRP_TO_UTF8);
1938+
U_16 descriptorCpIndex = _classFileOracle->getLoadableDescriptorAtIndex(index);
1939+
cursor->writeSRP(_srpKeyProducer->mapCfrConstantPoolIndexToKey(descriptorCpIndex), Cursor::SRP_TO_UTF8);
19401940
}
19411941
}
19421942
}
@@ -1993,7 +1993,7 @@ ROMClassWriter::writeOptionalInfo(Cursor *cursor)
19931993
* SRP to record class component attributes
19941994
* SRP to PermittedSubclasses attribute
19951995
* SRP to injected interfaces info
1996-
* SRP to Preload attribute
1996+
* SRP to LoadableDescriptors attribute
19971997
* SRP to ImplicitCreation attribute
19981998
*/
19991999
cursor->mark(_optionalInfoSRPKey);
@@ -2040,8 +2040,8 @@ ROMClassWriter::writeOptionalInfo(Cursor *cursor)
20402040
if (_interfaceInjectionInfo->numOfInterfaces > 0) {
20412041
cursor->writeSRP(_injectedInterfaceInfoSRPKey, Cursor::SRP_TO_GENERIC);
20422042
}
2043-
if (_classFileOracle->hasPreloadClasses()) {
2044-
cursor->writeSRP(_preloadInfoSRPKey, Cursor::SRP_TO_GENERIC);
2043+
if (_classFileOracle->hasLoadableDescriptors()) {
2044+
cursor->writeSRP(_loadableDescriptorsInfoSRPKey, Cursor::SRP_TO_GENERIC);
20452045
}
20462046
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
20472047
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)

runtime/bcutil/ROMClassWriter.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class ROMClassWriter
154154
void writePermittedSubclasses(Cursor *cursor, bool markAndCountOnly);
155155
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
156156
void writeInjectedInterfaces(Cursor *cursor, bool markAndCountOnly);
157-
void writePreload(Cursor *cursor, bool markAndCountOnly);
157+
void writeloadableDescriptors(Cursor *cursor, bool markAndCountOnly);
158158
#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */
159159
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
160160
void writeImplicitCreation(Cursor *cursor, bool markAndCountOnly);
@@ -197,7 +197,7 @@ class ROMClassWriter
197197
UDATA _permittedSubclassesInfoSRPKey;
198198
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
199199
UDATA _injectedInterfaceInfoSRPKey;
200-
UDATA _preloadInfoSRPKey;
200+
UDATA _loadableDescriptorsInfoSRPKey;
201201
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
202202
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
203203
UDATA _implicitCreationSRPKey;

0 commit comments

Comments
 (0)