Skip to content

Commit

Permalink
Allowing JFR to get J9Class of hidden and anonymous classes
Browse files Browse the repository at this point in the history
Signed-off-by: Gengchen Tuo <[email protected]>
  • Loading branch information
thallium committed Jan 20, 2025
1 parent a61d849 commit bfed016
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 51 deletions.
2 changes: 1 addition & 1 deletion runtime/bcutil/ROMClassCreationContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ class ROMClassCreationContext
}
} else { /* classname is null */
/* If a name was not provided with the load data, now is our first chance to check for a duplicate definition */
if ((NULL != _javaVM) && (NULL != J9_VM_FUNCTION_VIA_JAVAVM(_javaVM, hashClassTableAt)(_classLoader, className, classNameLength))) {
if ((NULL != _javaVM) && (NULL != J9_VM_FUNCTION_VIA_JAVAVM(_javaVM, hashClassTableAt)(_classLoader, className, classNameLength, TRUE))) {
PORT_ACCESS_FROM_PORT(_portLibrary);
U_8 *errorUTF = (U_8 *) j9mem_allocate_memory(classNameLength + 1, J9MEM_CATEGORY_CLASSES);
if (NULL != errorUTF) {
Expand Down
3 changes: 2 additions & 1 deletion runtime/bcutil/defineclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ checkForExistingClass(J9VMThread* vmThread, J9LoadROMClassData * loadData)
existingClass = J9_VM_FUNCTION(vmThread, hashClassTableAt)(
loadData->classLoader,
loadData->className,
loadData->classNameLength);
loadData->classNameLength,
TRUE);

if (existingClass != NULL) {
/* error! a class with this name is already loaded in this class loader */
Expand Down
2 changes: 1 addition & 1 deletion runtime/bcverify/classrelationships.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ j9bcv_validateClassRelationships(J9VMThread *vmThread, J9ClassLoader *classLoade

while (NULL != parentNode) {
/* Find the parent class in the loaded classes table */
parentClass = J9_VM_FUNCTION(vmThread, hashClassTableAt)(classLoader, parentNode->className, parentNode->classNameLength);
parentClass = J9_VM_FUNCTION(vmThread, hashClassTableAt)(classLoader, parentNode->className, parentNode->classNameLength, TRUE);

/* If the parent class has not been loaded, then it has to be an interface since the child is already loaded */
if (NULL == parentClass) {
Expand Down
4 changes: 2 additions & 2 deletions runtime/bcverify/clconstraints.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ j9bcv_checkClassLoadingConstraintForName (J9VMThread *vmThread, J9ClassLoader *l
Assert_RTV_validateClassLoadingConstraints(vmThread, loader1, loader2, name1, name2, length);

/* peek at the class tables to see if the class has been loaded yet */
class1 = vmFuncs->hashClassTableAt (loader1, name1, length);
class2 = vmFuncs->hashClassTableAt (loader2, name2, length);
class1 = vmFuncs->hashClassTableAt(loader1, name1, length, TRUE);
class2 = vmFuncs->hashClassTableAt(loader2, name2, length, TRUE);

if (class1 && class2) {
if (class1 != class2) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/bcverify/rtverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ j9rtv_verifierGetRAMClass( J9BytecodeVerificationData *verifyData, J9ClassLoader

/* Sniff the class table to see if already loaded */
Trc_RTV_j9rtv_verifierGetRAMClass_Entry(verifyData->vmStruct, classLoader, nameLength, className);
found = vm->internalVMFunctions->hashClassTableAt (classLoader, className, nameLength);
found = vm->internalVMFunctions->hashClassTableAt(classLoader, className, nameLength, TRUE);

#ifdef J9VM_THR_PREEMPTIVE
threadEnv->monitor_exit(vm->classTableMutex);
Expand Down
2 changes: 1 addition & 1 deletion runtime/j9vm/j7vmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,7 @@ jvmDefineClassHelper(JNIEnv *env, jobject classLoaderObject,

threadEnv->monitor_enter(vm->classTableMutex);

if (vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length) != NULL) {
if (vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length, TRUE) != NULL) {
/* Bad, we have already defined this class - fail */
threadEnv->monitor_exit(vm->classTableMutex);
vmFuncs->setCurrentExceptionNLSWithArgs(currentThread, J9NLS_JCL_DUPLICATE_CLASS_DEFINITION, J9VMCONSTANTPOOL_JAVALANGLINKAGEERROR, utf8Length, utf8Name);
Expand Down
4 changes: 2 additions & 2 deletions runtime/jcl/common/jcldefine.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ defineClassCommon(JNIEnv *env, jobject classLoaderObject,
omrthread_monitor_enter(vm->classTableMutex);
/* Hidden class is never added into the hash table */
if ((NULL != utf8Name) && J9_ARE_NO_BITS_SET(*options, J9_FINDCLASS_FLAG_HIDDEN)) {
if (NULL != vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length)) {
if (NULL != vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length, TRUE)) {
/* Bad, we have already defined this class - fail */
omrthread_monitor_exit(vm->classTableMutex);
if (J9_ARE_NO_BITS_SET(*options, J9_FINDCLASS_FLAG_NAME_IS_INVALID)) {
Expand All @@ -165,7 +165,7 @@ defineClassCommon(JNIEnv *env, jobject classLoaderObject,
*/
#if defined(J9VM_OPT_SNAPSHOTS)
if (IS_RESTORE_RUN(vm)) {
clazz = vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length);
clazz = vmFuncs->hashClassTableAt(classLoader, utf8Name, utf8Length, TRUE);

if (!vmFuncs->loadWarmClassFromSnapshot(currentThread, classLoader, clazz)) {
clazz = NULL;
Expand Down
2 changes: 1 addition & 1 deletion runtime/oti/j9nonbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -4873,7 +4873,7 @@ typedef struct J9InternalVMFunctions {
struct J9Class* ( *internalFindClassUTF8)(struct J9VMThread *currentThread, U_8 *className, UDATA classNameLength, struct J9ClassLoader *classLoader, UDATA options) ;
struct J9Class* ( *internalFindClassInModule)(struct J9VMThread *currentThread, struct J9Module *j9module, U_8 *className, UDATA classNameLength, struct J9ClassLoader *classLoader, UDATA options) ;
struct J9Class* ( *internalFindClassString)(struct J9VMThread* currentThread, j9object_t moduleName, j9object_t className, struct J9ClassLoader* classLoader, UDATA options, UDATA allowedBitsForClassName) ;
struct J9Class* ( *hashClassTableAt)(struct J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength) ;
struct J9Class * (*hashClassTableAt)(struct J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength, BOOLEAN ignoreHiddenClass);
UDATA ( *hashClassTableAtPut)(struct J9VMThread *vmThread, struct J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength, struct J9Class *value) ;
UDATA ( *hashClassTableDelete)(struct J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength) ;
void ( *hashClassTableReplace)(struct J9VMThread* vmThread, struct J9ClassLoader *classLoader, struct J9Class *originalClass, struct J9Class *replacementClass) ;
Expand Down
6 changes: 4 additions & 2 deletions runtime/oti/vm_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,11 @@ iterateStackTrace(J9VMThread * vmThread, j9object_t* exception, UDATA (*callba
* @param skipHiddenFrames
* @param sizeOfWalkstateCache
* @param exceptionIsJavaObject
* @param revealAnonAndHiddenClass
* @return UDATA
*/
UDATA
iterateStackTraceImpl(J9VMThread * vmThread, j9object_t* exception, UDATA (*callback) (J9VMThread * vmThread, void * userData, UDATA bytecodeOffset, J9ROMClass * romClass, J9ROMMethod * romMethod, J9UTF8 * fileName, UDATA lineNumber, J9ClassLoader* classLoader, J9Class* ramClass, UDATA frameType), void * userData, UDATA pruneConstructors, UDATA skipHiddenFrames, UDATA sizeOfWalkstateCache, BOOLEAN exceptionIsJavaObject);
iterateStackTraceImpl(J9VMThread * vmThread, j9object_t* exception, UDATA (*callback) (J9VMThread * vmThread, void * userData, UDATA bytecodeOffset, J9ROMClass * romClass, J9ROMMethod * romMethod, J9UTF8 * fileName, UDATA lineNumber, J9ClassLoader* classLoader, J9Class* ramClass, UDATA frameType), void * userData, UDATA pruneConstructors, UDATA skipHiddenFrames, UDATA sizeOfWalkstateCache, BOOLEAN exceptionIsJavaObject, BOOLEAN revealAnonAndHiddenClass);


/* ---------------- exceptionsupport.c ---------------- */
Expand Down Expand Up @@ -2086,10 +2087,11 @@ hashClassTableFree(J9ClassLoader* classLoader);
* @param *classLoader
* @param *className
* @param classNameLength
* @param ignoreHiddenClass
* @return J9Class *
*/
J9Class *
hashClassTableAt(J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength);
hashClassTableAt(J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength, BOOLEAN ignoreHiddenClass);


/**
Expand Down
2 changes: 1 addition & 1 deletion runtime/sunvmi/sunvmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ JVM_GetSystemPackage_Impl(JNIEnv* env, jstring pkgName)
if (NULL != idEntry) {
J9ROMClass *resultROMClass = (J9ROMClass *)(idEntry->taggedROMClass & ~(UDATA)(J9PACKAGE_ID_TAG | J9PACKAGE_ID_GENERATED));
J9UTF8* className = J9ROMCLASS_CLASSNAME(resultROMClass);
clazz = funcs->hashClassTableAt(vm->systemClassLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className));
clazz = funcs->hashClassTableAt(vm->systemClassLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), TRUE);
}
VM.monitorExit(vm->classTableMutex);

Expand Down
2 changes: 1 addition & 1 deletion runtime/util/hshelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2527,7 +2527,7 @@ fixNestMembers(J9VMThread * currentThread, J9HashTable * classPairs)

for (i = 0; i < nestMemberCount; i++) {
J9UTF8 *nestMemberName = NNSRP_GET(nestMembers[i], J9UTF8*);
J9Class *nestMember = vmFuncs->hashClassTableAt(classLoader, J9UTF8_DATA(nestMemberName), J9UTF8_LENGTH(nestMemberName));
J9Class *nestMember = vmFuncs->hashClassTableAt(classLoader, J9UTF8_DATA(nestMemberName), J9UTF8_LENGTH(nestMemberName), TRUE);
if (NULL != nestMember) {
if (nestMember->nestHost == originalRAMClass) {
nestMember->nestHost = replacementRAMClass;
Expand Down
2 changes: 1 addition & 1 deletion runtime/util/resolvehelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ isDirectSuperInterface(J9VMThread *vmStruct, J9Class *resolvedClass, J9Class *cu
J9Class *interfaceClass = NULL;
J9UTF8 *interfaceName = NNSRP_GET(interfaceNames[i], J9UTF8*);
omrthread_monitor_enter(vm->classTableMutex);
interfaceClass = vm->internalVMFunctions->hashClassTableAt(resolvedClass->classLoader, J9UTF8_DATA(interfaceName), J9UTF8_LENGTH(interfaceName));
interfaceClass = vm->internalVMFunctions->hashClassTableAt(resolvedClass->classLoader, J9UTF8_DATA(interfaceName), J9UTF8_LENGTH(interfaceName), TRUE);
omrthread_monitor_exit(vm->classTableMutex);
if (interfaceClass == resolvedClass) {
/* Found resolvedClass in the currentClass ROMClass interface list */
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/JFRConstantPoolTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ class VM_JFRConstantPoolTypes {
goto done;
}

expandedStackTraceCount = iterateStackTraceImpl(_currentThread, (j9object_t*)walkStateCache, NULL, NULL, FALSE, FALSE, numberOfFrames, FALSE);
expandedStackTraceCount = iterateStackTraceImpl(_currentThread, (j9object_t*)walkStateCache, NULL, NULL, FALSE, FALSE, numberOfFrames, FALSE, TRUE);

_currentStackFrameBuffer = (StackFrame*) j9mem_allocate_memory(sizeof(StackFrame) * expandedStackTraceCount, J9MEM_CATEGORY_CLASSES);
_currentFrameCount = 0;
Expand All @@ -915,7 +915,7 @@ class VM_JFRConstantPoolTypes {
goto done;
}

iterateStackTraceImpl(_currentThread, (j9object_t*)walkStateCache, &stackTraceCallback, this, FALSE, FALSE, numberOfFrames, FALSE);
iterateStackTraceImpl(_currentThread, (j9object_t*)walkStateCache, &stackTraceCallback, this, FALSE, FALSE, numberOfFrames, FALSE, TRUE);

index = addStackTraceEntry(walkThread, j9time_nano_time(), _currentFrameCount);
_stackFrameCount += expandedStackTraceCount;
Expand Down
31 changes: 20 additions & 11 deletions runtime/vm/KeyHashTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ classHashEqualFn(void *tableNode, void *queryNode, void *userData)
UDATA tableNodeType = classHashGetName(tableNode, &tableNodeName, &tableNodeLength);
UDATA queryNodeType = classHashGetName(queryNode, &queryNodeName, &queryNodeLength);
UDATA tableNodeTag = ((KeyHashTableClassEntry *)tableNode)->tag;
BOOLEAN isTableNodeHiddenClass = (TYPE_CLASS == tableNodeType)
BOOLEAN isTableNodeAnonOrHiddenClass = (TYPE_CLASS == tableNodeType)
&& (TAG_RAM_CLASS == (tableNodeTag & MASK_RAM_CLASS))
&& J9ROMCLASS_IS_HIDDEN(((KeyHashTableClassEntry *)tableNode)->ramClass->romClass);
&& J9ROMCLASS_IS_ANON_OR_HIDDEN(((KeyHashTableClassEntry *)tableNode)->ramClass->romClass);

if (isTableNodeHiddenClass) {
/* Hidden class is keyed on its rom address, not on its name. */
BOOLEAN isLambda = 0;
if (strstr((char *)queryNodeName, "0x00") == (char *)queryNodeName) {
isLambda = 1;
printf("Table node name (before): %.*s\n", (int)tableNodeLength, tableNodeName);
}

if (isTableNodeAnonOrHiddenClass) {
/* Anon and Hidden class is keyed on its rom address, not on its name. */
PORT_ACCESS_FROM_JAVAVM(javaVM);
j9str_printf(PORTLIB, buf, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, (UDATA)((KeyHashTableClassEntry *)tableNode)->ramClass->romClass);
tableNodeName = (const U_8 *)buf;
Expand Down Expand Up @@ -212,6 +218,9 @@ classHashEqualFn(void *tableNode, void *queryNode, void *userData)
}
return FALSE;
}
if (isLambda) {
printf("Table node name (after) %.*s\n", (int)tableNodeLength, tableNodeName);
}
return J9UTF8_DATA_EQUALS(tableNodeName, tableNodeLength, queryNodeName, queryNodeLength);
}

Expand All @@ -225,12 +234,12 @@ classHashFn(void *key, void *userData)
UDATA type = classHashGetName(key, &name, &length);
UDATA keyTag = ((KeyHashTableClassEntry *)key)->tag;
char buf[ROM_ADDRESS_LENGTH + 1] = {0};
BOOLEAN isTableNodeHiddenClass = (TYPE_CLASS == type)
BOOLEAN isTableNodeHiddenOrAnonClass = (TYPE_CLASS == type)
&& (TAG_RAM_CLASS == (keyTag & MASK_RAM_CLASS))
&& J9ROMCLASS_IS_HIDDEN(((KeyHashTableClassEntry *)key)->ramClass->romClass);
&& J9ROMCLASS_IS_ANON_OR_HIDDEN(((KeyHashTableClassEntry *)key)->ramClass->romClass);

if (isTableNodeHiddenClass) {
/* for hidden class, do not key on its name, key on its rom address */
if (isTableNodeHiddenOrAnonClass) {
/* For anon or hidden class, do not key on its name, key on its rom address */
PORT_ACCESS_FROM_JAVAVM(javaVM);
j9str_printf(PORTLIB, buf, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, (UDATA)((KeyHashTableClassEntry *)key)->ramClass->romClass);
name = (const U_8 *)buf;
Expand Down Expand Up @@ -333,7 +342,7 @@ hashClassTableNew(J9JavaVM *javaVM, U_32 initialSize)
}

J9Class *
hashClassTableAt(J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength)
hashClassTableAt(J9ClassLoader *classLoader, U_8 *className, UDATA classNameLength, BOOLEAN ignoreHiddenClass)
{
J9HashTable *table = classLoader->classHashTable;
KeyHashTableClassQueryEntry key;
Expand All @@ -346,7 +355,7 @@ hashClassTableAt(J9ClassLoader *classLoader, U_8 *className, UDATA classNameLeng
if (NULL != result) {
J9Class *clazz = result->ramClass;
checkClassAlignment(clazz, "hashClassTableAt");
if (J9ROMCLASS_IS_HIDDEN(clazz->romClass)) {
if ((TRUE == ignoreHiddenClass) && J9ROMCLASS_IS_ANON_OR_HIDDEN(clazz->romClass)) {
return NULL;
}
return clazz;
Expand Down Expand Up @@ -794,7 +803,7 @@ addLocationGeneratedClass(J9VMThread *vmThread, J9ClassLoader *classLoader, KeyH
J9UTF8 *className = J9ROMCLASS_CLASSNAME(resultROMClass);
J9Class *clazz = NULL;

clazz = funcs->hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className));
clazz = funcs->hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), TRUE);
if (NULL != clazz) {
J9ClassLocation *classLocation = NULL;
J9ClassLocation newLocation = {0};
Expand Down
12 changes: 6 additions & 6 deletions runtime/vm/classsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ peekClassHashTable(J9VMThread* currentThread, J9ClassLoader* classLoader, U_8* c
if (!fastMode) {
omrthread_monitor_enter(vm->classTableMutex);
}
ramClass = hashClassTableAt(classLoader, className, classNameLength);
ramClass = hashClassTableAt(classLoader, className, classNameLength, TRUE);
if (!fastMode) {
omrthread_monitor_exit(vm->classTableMutex);
}
Expand Down Expand Up @@ -804,7 +804,7 @@ callLoadClass(J9VMThread* vmThread, U_8* className, UDATA classNameLength, J9Cla
} else {
/* See if a class of this name is already in the table - if not, add it */

ramClass = hashClassTableAt(classLoader, className, classNameLength);
ramClass = hashClassTableAt(classLoader, className, classNameLength, TRUE);
if (NULL == ramClass) {
/* Ensure loading constraints have not been violated */

Expand All @@ -830,7 +830,7 @@ callLoadClass(J9VMThread* vmThread, U_8* className, UDATA classNameLength, J9Cla

/* See if a class of this name is already in the table - if not, try the add again */

ramClass = hashClassTableAt(classLoader, className, classNameLength);
ramClass = hashClassTableAt(classLoader, className, classNameLength, TRUE);
if (NULL == ramClass) {
if (hashClassTableAtPut(vmThread, classLoader, className, classNameLength, foundClass)) {
/* Add failed again, throw native OOM */
Expand Down Expand Up @@ -909,7 +909,7 @@ waitForContendedLoadClass(J9VMThread* vmThread, J9ContendedLoadTableEntry *table
} while ((status = tableEntry->status) == CLASSLOADING_LOAD_IN_PROGRESS);
/* still have classTableMutex here */
Trc_VM_waitForContendedLoadClass_waited(vmThread, vmThread, tableEntry->classLoader, classNameLength, className, status);
foundClass = hashClassTableAt(tableEntry->classLoader, className, classNameLength);
foundClass = hashClassTableAt(tableEntry->classLoader, className, classNameLength, TRUE);
#if defined(J9VM_OPT_SNAPSHOTS)
if ((NULL != foundClass) && IS_RESTORE_RUN(vm)) {
if (!loadWarmClassFromSnapshot(vmThread, tableEntry->classLoader, foundClass)) {
Expand Down Expand Up @@ -1149,7 +1149,7 @@ loadNonArrayClass(J9VMThread* vmThread, J9Module *j9module, U_8* className, UDAT
omrthread_monitor_enter(vm->classTableMutex);
}

foundClass = hashClassTableAt(classLoader, className, classNameLength);
foundClass = hashClassTableAt(classLoader, className, classNameLength, TRUE);
if (NULL != foundClass) {
#if defined(J9VM_OPT_SNAPSHOTS)
if (IS_RESTORE_RUN(vm)) {
Expand Down Expand Up @@ -1180,7 +1180,7 @@ loadNonArrayClass(J9VMThread* vmThread, J9Module *j9module, U_8* className, UDAT
omrthread_monitor_enter(vm->classTableMutex);

/* check again if somebody else already loaded the class */
foundClass = hashClassTableAt(classLoader, className, classNameLength);
foundClass = hashClassTableAt(classLoader, className, classNameLength, TRUE);
if (NULL != foundClass) {
#if defined(J9VM_OPT_SNAPSHOTS)
if (IS_RESTORE_RUN(vm)
Expand Down
9 changes: 4 additions & 5 deletions runtime/vm/createramclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ markInterfaces(J9ROMClass *romClass, J9Class *superclass, J9ClassLoader *classLo
J9ITable *iTable;
J9UTF8 *interfaceName = NNSRP_GET(interfaceNames[i], J9UTF8*);
/* peek the table, do not load */
J9Class *interfaceClass = hashClassTableAt(classLoader, J9UTF8_DATA(interfaceName), J9UTF8_LENGTH(interfaceName));
J9Class *interfaceClass = hashClassTableAt(classLoader, J9UTF8_DATA(interfaceName), J9UTF8_LENGTH(interfaceName), TRUE);
/* the interface classes are not NULL, as this was checked by the caller */
if ((foundCloneable != NULL) && (J9AccClassCloneable == (J9CLASS_FLAGS(interfaceClass) & J9AccClassCloneable))) {
*foundCloneable = TRUE;
Expand Down Expand Up @@ -2206,7 +2206,7 @@ internalCreateRAMClassDone(J9VMThread *vmThread, J9ClassLoader *classLoader, J9C

/* If the class was successfully loaded while we were GCing, use that one. */
if (elementClass == NULL) {
alreadyLoadedClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className));
alreadyLoadedClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), TRUE);
} else {
alreadyLoadedClass = getArrayClass(elementClass, options);
}
Expand Down Expand Up @@ -2392,7 +2392,6 @@ internalCreateRAMClassDone(J9VMThread *vmThread, J9ClassLoader *classLoader, J9C
/* Put the new class in the table or arrayClass field. */
if ((!fastHCR)
&& (0 == J9ROMCLASS_IS_PRIMITIVE_OR_ARRAY(romClass))
&& J9_ARE_NO_BITS_SET(options, J9_FINDCLASS_FLAG_ANON)
) {
if (hashClassTableAtPut(vmThread, classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), state->ramClass)) {
if (hotswapping) {
Expand All @@ -2411,7 +2410,7 @@ internalCreateRAMClassDone(J9VMThread *vmThread, J9ClassLoader *classLoader, J9C
if (J9_ARE_NO_BITS_SET(options, J9_FINDCLASS_FLAG_HIDDEN)) {
/* If the class was successfully loaded while we were GCing, use that one */
if (elementClass == NULL) {
alreadyLoadedClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className));
alreadyLoadedClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), TRUE);
} else {
alreadyLoadedClass = getArrayClass(elementClass, options);
}
Expand Down Expand Up @@ -2883,7 +2882,7 @@ internalCreateRAMClassFromROMClassImpl(J9VMThread *vmThread, J9ClassLoader *clas

if (!hotswapping) {
if (elementClass == NULL) {
ramClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className));
ramClass = hashClassTableAt(classLoader, J9UTF8_DATA(className), J9UTF8_LENGTH(className), TRUE);
} else {
ramClass = getArrayClass(elementClass, options);
}
Expand Down
Loading

0 comments on commit bfed016

Please sign in to comment.