diff --git a/runtime/bcutil/ComparingCursor.cpp b/runtime/bcutil/ComparingCursor.cpp index d11b5475f93..b9d63decb6e 100644 --- a/runtime/bcutil/ComparingCursor.cpp +++ b/runtime/bcutil/ComparingCursor.cpp @@ -428,29 +428,10 @@ ComparingCursor::shouldCheckForEquality(DataType dataType, U_32 u32Value) } switch (dataType) { - case SRP_TO_UTF8_CLASS_NAME: -#if JAVA_SPEC_VERSION < 21 - if (_context->isLambdaClass() && _romClassIsShared) { - /* - * If the class is a lambda class, don't compare the class names because lambda - * classes might have different index numbers from run to run. - */ - return false; - } -#endif /* JAVA_SPEC_VERSION < 21 */ - break; + case SRP_TO_UTF8_CLASS_NAME: /* fall through */ case BYTECODE: /* fall through */ case GENERIC: /* fall through */ case CLASS_FILE_SIZE: /* fall through */ -#if JAVA_SPEC_VERSION < 21 - if ((CLASS_FILE_SIZE == dataType) - && _context->isLambdaClass() - && _romClassIsShared - ) { - /* If comparing a lambda class from the shared cache, class file size comparison is already done in ROMClassBuilder::compareROMClassForEquality(). */ - return false; - } -#endif /* JAVA_SPEC_VERSION < 21 */ case SRP_TO_DEBUG_DATA: /* fall through */ case SRP_TO_GENERIC: /* fall through */ case SRP_TO_UTF8: /* fall through */ diff --git a/runtime/bcutil/ROMClassBuilder.cpp b/runtime/bcutil/ROMClassBuilder.cpp index 52b0e910eec..dfa75121909 100644 --- a/runtime/bcutil/ROMClassBuilder.cpp +++ b/runtime/bcutil/ROMClassBuilder.cpp @@ -277,16 +277,6 @@ ROMClassBuilder::handleAnonClassName(J9CfrClassFile *classfile, ROMClassCreation PORT_ACCESS_FROM_PORT(_portLibrary); #if defined(J9VM_OPT_OPENJDK_METHODHANDLE) - /* - * Prevent generated LambdaForm classes from MethodHandles to be stored to the shared cache. - * When there are a large number of such classes in the shared cache, they trigger a lot of class comparisons. - * Performance can be much worse (compared to shared cache turned off). - */ - if (isLambdaFormClassName(originalStringBytes, originalStringLength, NULL/*deterministicPrefixLength*/)) { - context->addFindClassFlags(J9_FINDCLASS_FLAG_DO_NOT_SHARE); - context->addFindClassFlags(J9_FINDCLASS_FLAG_LAMBDAFORM); - } - #if JAVA_SPEC_VERSION >= 15 /* InjectedInvoker is a hidden class without the strong attribute set. It * is created by MethodHandleImpl.makeInjectedInvoker on the OpenJDK side. @@ -417,22 +407,6 @@ ROMClassBuilder::handleAnonClassName(J9CfrClassFile *classfile, ROMClassCreation j9str_printf(PORTLIB, buf, ROM_ADDRESS_LENGTH + 1, ROM_ADDRESS_FORMAT, 0); memcpy(constantPool[newUtfCPEntry].bytes + newHostPackageLength + originalStringLength + 1, buf, ROM_ADDRESS_LENGTH + 1); - /* Mark if the class is a Lambda class. */ -#if defined(J9VM_OPT_OPENJDK_METHODHANDLE) - if (!context->isLambdaFormClass() - && isLambdaClassName(reinterpret_cast(_anonClassNameBuffer), - newAnonClassNameLength - 1, NULL/*deterministicPrefixLength*/) - ) { - context->addFindClassFlags(J9_FINDCLASS_FLAG_LAMBDA); - } -#else /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */ - if (isLambdaClassName(reinterpret_cast(_anonClassNameBuffer), - newAnonClassNameLength - 1, NULL/*deterministicPrefixLength*/) - ) { - context->addFindClassFlags(J9_FINDCLASS_FLAG_LAMBDA); - } -#endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */ - /* search constantpool for all other identical classRefs. We have not actually * tested this scenario as javac will not output more than one classRef or utfRef of the * same kind. @@ -590,18 +564,6 @@ ROMClassBuilder::prepareAndLaydown( BufferManager *bufferManager, ClassFileParse getSizeInfo(context, &romClassWriter, &srpOffsetTable, &countDebugDataOutOfLine, &sizeInformation); U_32 romSize = 0; -#if JAVA_SPEC_VERSION < 21 - U_32 sizeToCompareForLambda = 0; - if (context->isLambdaClass()) { - /* - * romSize calculated from getSizeInfo() does not involve StringInternManager. It is only accurate for string intern disabled classes. - * Lambda classes in java 15 and up are strong hidden classes (defined with Option.STONG), which has the same lifecycle as its - * defining class loader. It is string intern enabled. So pass classFileSize instead of romSize to sizeToCompareForLambda. - */ - sizeToCompareForLambda = classFileOracle.getClassFileSize(); - } -#endif /* JAVA_SPEC_VERSION < 21 */ - if (context->shouldCompareROMClassForEquality()) { ROMClassVerbosePhase v(context, CompareHashtableROMClass); @@ -624,9 +586,6 @@ ROMClassBuilder::prepareAndLaydown( BufferManager *bufferManager, ClassFileParse modifiers, extraModifiers, optionalFlags, -#if JAVA_SPEC_VERSION < 21 - sizeToCompareForLambda, -#endif /* JAVA_SPEC_VERSION < 21 */ context) ) { return OK; @@ -720,9 +679,6 @@ ROMClassBuilder::prepareAndLaydown( BufferManager *bufferManager, ClassFileParse modifiers, extraModifiers, optionalFlags, -#if JAVA_SPEC_VERSION < 21 - sizeToCompareForLambda, -#endif /* JAVA_SPEC_VERSION < 21 */ context) ) { @@ -1479,55 +1435,19 @@ ROMClassBuilder::compareROMClassForEquality( U_32 modifiers, U_32 extraModifiers, U_32 optionalFlags, -#if JAVA_SPEC_VERSION < 21 - U_32 sizeToCompareForLambda, -#endif /* JAVA_SPEC_VERSION < 21 */ ROMClassCreationContext *context) { bool ret = false; + ComparingCursor compareCursor(_javaVM, srpOffsetTable, srpKeyProducer, classFileOracle, romClass, romClassIsShared, context); + romClassWriter->writeROMClass(&compareCursor, + &compareCursor, + &compareCursor, + NULL, + NULL, + 0, modifiers, extraModifiers, optionalFlags, + ROMClassWriter::WRITE); -#if JAVA_SPEC_VERSION < 21 - if (context->isLambdaClass()) { - /* - * Lambda class names are in the format of HostClassName$$Lambda$/. - * When we reach this check, the host class names will be the same for both the classes because - * of the earlier hash-key check. So, the only difference in the size will be the difference - * between the number of digits of the index number. The same lambda class might have a - * different index number from run to run and when the number of digits of the index number - * increases by 1, classFileSize also increases by 1. The indexNumber is the counter for the number of - * lambda classes defined so far. It is an int in the JCL side. So the it cannot vary more than max - * integer vs 0, which is maxVariance (9 bytes). This check is different than the romSize check because - * when the number of digits of the index number increases by 1, classFileSize also increases by 1 but - * romSize increases by 2. - */ - int maxVariance = 9; - int variance = abs(static_cast((sizeToCompareForLambda - reinterpret_cast(romClass)->classFileSize))); - if (variance <= maxVariance) { - ComparingCursor compareCursor(_javaVM, srpOffsetTable, srpKeyProducer, classFileOracle, romClass, romClassIsShared, context); - romClassWriter->writeROMClass(&compareCursor, - &compareCursor, - &compareCursor, - NULL, - NULL, - 0, modifiers, extraModifiers, optionalFlags, - ROMClassWriter::WRITE); - - ret = compareCursor.isEqual(); - } - } else -#endif /* JAVA_SPEC_VERSION < 21 */ - { - ComparingCursor compareCursor(_javaVM, srpOffsetTable, srpKeyProducer, classFileOracle, romClass, romClassIsShared, context); - romClassWriter->writeROMClass(&compareCursor, - &compareCursor, - &compareCursor, - NULL, - NULL, - 0, modifiers, extraModifiers, optionalFlags, - ROMClassWriter::WRITE); - - ret = compareCursor.isEqual(); - } + ret = compareCursor.isEqual(); J9UTF8* name = J9ROMCLASS_CLASSNAME((J9ROMClass *)romClass); Trc_BCU_compareROMClassForEquality_event(ret, J9UTF8_LENGTH(name), J9UTF8_DATA(name)); return ret; diff --git a/runtime/bcutil/ROMClassBuilder.hpp b/runtime/bcutil/ROMClassBuilder.hpp index 2591cbf51dd..92ad2de1e72 100644 --- a/runtime/bcutil/ROMClassBuilder.hpp +++ b/runtime/bcutil/ROMClassBuilder.hpp @@ -169,9 +169,6 @@ class ROMClassBuilder U_32 modifiers, U_32 extraModifiers, U_32 optionalFlags, -#if JAVA_SPEC_VERSION < 21 - U_32 sizeToCompareForLambda, -#endif /* JAVA_SPEC_VERSION < 21 */ ROMClassCreationContext *context); SharedCacheRangeInfo getSharedCacheSRPRangeInfo(void *address); diff --git a/runtime/bcutil/ROMClassCreationContext.hpp b/runtime/bcutil/ROMClassCreationContext.hpp index ff9f83cc84e..87241000ae5 100644 --- a/runtime/bcutil/ROMClassCreationContext.hpp +++ b/runtime/bcutil/ROMClassCreationContext.hpp @@ -240,10 +240,6 @@ class ROMClassCreationContext bool isHiddenClassOptNestmateSet() const { return J9_ARE_ALL_BITS_SET(_findClassFlags, J9_FINDCLASS_FLAG_CLASS_OPTION_NESTMATE); } bool isHiddenClassOptStrongSet() const { return J9_ARE_ALL_BITS_SET(_findClassFlags, J9_FINDCLASS_FLAG_CLASS_OPTION_STRONG); } bool isDoNotShareClassFlagSet() const {return J9_ARE_ALL_BITS_SET(_findClassFlags, J9_FINDCLASS_FLAG_DO_NOT_SHARE);} - bool isLambdaClass() const { return J9_ARE_ALL_BITS_SET(_findClassFlags, J9_FINDCLASS_FLAG_LAMBDA); } -#if defined(J9VM_OPT_OPENJDK_METHODHANDLE) - bool isLambdaFormClass() const { return J9_ARE_ALL_BITS_SET(_findClassFlags, J9_FINDCLASS_FLAG_LAMBDAFORM); } -#endif /* defined(J9VM_OPT_OPENJDK_METHODHANDLE) */ bool isClassUnmodifiable() const { bool unmodifiable = false; @@ -406,33 +402,11 @@ class ROMClassCreationContext if (NULL != _className) { U_16 classNameLenToCompare0 = static_cast(_classNameLength); U_16 classNameLenToCompare1 = classNameLength; - BOOLEAN misMatch = FALSE; if (isClassHidden()) { /* For hidden classes, className has the ROM address appended, _className does not. */ classNameLenToCompare1 = static_cast(_classNameLength); -#if JAVA_SPEC_VERSION < 21 - if (isROMClassShareable()) { - /* - * Before JDK21, Lambda class names are in the format: - * HostClassName$$Lambda$/ - * Do not compare the IndexNumber as it can be different from run to run. - */ - U_8 *lambdaClass0 = reinterpret_cast(getLastDollarSignOfLambdaClassName( - reinterpret_cast(_className), _classNameLength)); - U_8 *lambdaClass1 = reinterpret_cast(getLastDollarSignOfLambdaClassName( - reinterpret_cast(className), classNameLength)); - if ((NULL != lambdaClass0) && (NULL != lambdaClass1)) { - classNameLenToCompare0 = static_cast(lambdaClass0 - _className + 1); - classNameLenToCompare1 = static_cast(lambdaClass1 - className + 1); - } else if ((NULL == lambdaClass0) != (NULL == lambdaClass1)) { - misMatch = TRUE; - } - } -#endif /* JAVA_SPEC_VERSION < 21 */ } - if (misMatch - || !J9UTF8_DATA_EQUALS(_className, classNameLenToCompare0, className, classNameLenToCompare1) - ) { + if (!J9UTF8_DATA_EQUALS(_className, classNameLenToCompare0, className, classNameLenToCompare1)) { #define J9WRONGNAME " (wrong name: " PORT_ACCESS_FROM_PORT(_portLibrary); UDATA errorStringSize = _classNameLength + sizeof(J9WRONGNAME) + 1 + classNameLength; diff --git a/runtime/jcl/CMakeLists.txt b/runtime/jcl/CMakeLists.txt index 39f7fcf9d4d..cfb694097d9 100644 --- a/runtime/jcl/CMakeLists.txt +++ b/runtime/jcl/CMakeLists.txt @@ -92,6 +92,9 @@ target_link_libraries(jclse j9vm_interface j9vm_gc_includes + j9shrcommon + j9shrutil + j9zip omrsig j9hookable j9zlib diff --git a/runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp b/runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp index ab72d64f40e..a31db03e717 100644 --- a/runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp +++ b/runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp @@ -32,10 +32,14 @@ #include "j9vmconstantpool.h" #include "ObjectAccessBarrierAPI.hpp" #include "objhelp.h" +#include "SCAbstractAPI.h" #include #include +#undef UT_MODULE_LOADED +#undef UT_MODULE_UNLOADED +#include "CacheMap.hpp" #include "VMHelpers.hpp" extern "C" { @@ -945,6 +949,121 @@ Java_java_lang_invoke_MethodHandleNatives_expand(JNIEnv *env, jclass clazz, jobj vmFuncs->internalExitVMToJNI(currentThread); } +/** + * Find a Lambda or customized LambdaForm class in the SCC. + * Requires non-null input arguments. + * If found, returns a pointer to a RAMClass of the SCC-cached class, otherwise nullptr. + * + * Throws OutOfMemoryError if lookup key memory allocation fails. + */ +jobject +findLambdaOrLambdaFormInSCC(JNIEnv *env, jclass clazz, jstring classnameObject, jclass lookupClass, UDATA options) +{ + jobject result = nullptr; + +#if defined(J9VM_OPT_SHARED_CLASSES) + J9VMThread *currentThread = reinterpret_cast(env); + J9JavaVM *vm = currentThread->javaVM; + const J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions; + PORT_ACCESS_FROM_JAVAVM(vm); + vmFuncs->internalEnterVMFromJNI(currentThread); + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Entry(env, classnameObject, lookupClass, options); + +#if defined(J9VM_ENV_DATA64) +#define J9_ROM_ADDRESS_SUFFIX "/0x0000000000000000" +#else /* defined(J9VM_ENV_DATA64) */ +#define J9_ROM_ADDRESS_SUFFIX "/0x00000000" +#endif /* defined(J9VM_ENV_DATA64) */ + j9object_t classname = J9_JNI_UNWRAP_REFERENCE(classnameObject); + IDATA classnameLength = vmFuncs->getStringUTF8Length(currentThread, classname); + UDATA romAddressSuffixLength = LITERAL_STRLEN(J9_ROM_ADDRESS_SUFFIX); + UDATA lookupKeyLength = classnameLength + romAddressSuffixLength + 1; /* +1 for null terminator. */ + char *lookupKey = static_cast(j9mem_allocate_memory(lookupKeyLength, OMRMEM_CATEGORY_VM)); + + if (nullptr == lookupKey) { + vmFuncs->setNativeOutOfMemoryError(currentThread, 0, 0); + } else { + vmFuncs->copyStringToUTF8Helper(currentThread, classname, J9_STR_NONE, 0, classnameLength, reinterpret_cast(lookupKey), classnameLength); + memcpy(lookupKey + classnameLength, J9_ROM_ADDRESS_SUFFIX, romAddressSuffixLength); + lookupKey[lookupKeyLength - 1] = '\0'; + + if (nullptr != vm->sharedClassConfig && nullptr != vm->sharedClassConfig->sharedAPIObject) { + SCAbstractAPI *sharedapi = static_cast(vm->sharedClassConfig->sharedAPIObject); + J9ROMClass *romClass = sharedapi->jclFindOrphanROMClassByUniqueID(currentThread, lookupKey, lookupKeyLength - 1); + if (nullptr != romClass) { + J9Class *hostClass = J9VM_J9CLASS_FROM_HEAPCLASS(currentThread, J9_JNI_UNWRAP_REFERENCE(lookupClass)); + J9ClassLoader *classloader = hostClass->classLoader; + if (nullptr != hostClass) { + omrthread_monitor_enter(vm->classTableMutex); + /* internalCreateRAMClassFromROMClass will release the classTableMutex. */ + J9Class *ramClass = vmFuncs->internalCreateRAMClassFromROMClass( + currentThread, + classloader, + romClass, + options, + nullptr /* elementClass */, + nullptr /* protectionDomain */, + nullptr /* methodRemapArray */, + J9_CP_INDEX_NONE, + LOAD_LOCATION_UNKNOWN, + nullptr /* classBeingRedefined */, + hostClass); + if (nullptr != ramClass && nullptr == currentThread->currentException) { + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Found(env, lookupKeyLength - 1, lookupKey, lookupClass, options); + result = vmFuncs->j9jni_createLocalRef(env, J9VM_J9CLASS_TO_HEAPCLASS(ramClass)); + } + } + } + } + } + + if (nullptr != lookupKey) { + j9mem_free_memory(lookupKey); + } + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Exit(env); + vmFuncs->internalExitVMToJNI(currentThread); +#undef J9_ROM_ADDRESS_SUFFIX +#endif /* J9VM_OPT_SHARED_CLASSES */ + return result; +} + +/** + * static native Class findLambdaInSCC(String classname, Class hostClass); + * + * Find a Lambda class in the SCC. + * Requires non-null input arguments. + * If found, returns a pointer to a RAMClass of the SCC-cached, otherwise nullptr. + */ +jobject JNICALL +Java_java_lang_invoke_MethodHandleNatives_findLambdaInSCC(JNIEnv *env, jclass clazz, jstring classnameObject, jclass lookupClass) +{ + UDATA options = J9_FINDCLASS_FLAG_NO_CHECK_FOR_EXISTING_CLASS + | J9_FINDCLASS_FLAG_THROW_ON_FAIL + | J9_FINDCLASS_FLAG_UNSAFE + | J9_FINDCLASS_FLAG_HIDDEN + | J9_FINDCLASS_FLAG_CLASS_OPTION_NESTMATE + | J9_FINDCLASS_FLAG_CLASS_OPTION_STRONG; + return findLambdaOrLambdaFormInSCC(env, clazz, classnameObject, lookupClass, options); +} + +/** + * static native Class findLambdaFormInSCC(String classname, Class hostClass); + * + * Find a customized LambdaForm class in the SCC. + * Requires non-null input arguments. + * If found, returns a pointer to a RAMClass of the SCC-cached class, otherwise nullptr. + */ +jobject JNICALL +Java_java_lang_invoke_MethodHandleNatives_findLambdaFormInSCC(JNIEnv *env, jclass clazz, jstring classnameObject, jclass lookupClass) +{ + UDATA options = J9_FINDCLASS_FLAG_NO_CHECK_FOR_EXISTING_CLASS + | J9_FINDCLASS_FLAG_THROW_ON_FAIL + | J9_FINDCLASS_FLAG_UNSAFE + | J9_FINDCLASS_FLAG_HIDDEN + | J9_FINDCLASS_FLAG_ANON; + return findLambdaOrLambdaFormInSCC(env, clazz, classnameObject, lookupClass, options); +} + /** * [JDK8] static native MemberName resolve(MemberName self, Class caller) * throws LinkageError, ClassNotFoundException; @@ -987,7 +1106,7 @@ Java_java_lang_invoke_MethodHandleNatives_resolve( char nameBuffer[256]; nameBuffer[0] = 0; J9UTF8 *signature = NULL; - char signatureBuffer[256]; + char signatureBuffer[512]; signatureBuffer[0] = 0; PORT_ACCESS_FROM_JAVAVM(vm); vmFuncs->internalEnterVMFromJNI(currentThread); @@ -1419,7 +1538,7 @@ Java_java_lang_invoke_MethodHandleNatives_getMembers( char nameBuffer[256]; nameBuffer[0] = 0; J9UTF8 *signature = NULL; - char signatureBuffer[256]; + char signatureBuffer[512]; signatureBuffer[0] = 0; j9object_t callerObject = ((NULL == caller) ? NULL : J9_JNI_UNWRAP_REFERENCE(caller)); diff --git a/runtime/jcl/exports.cmake b/runtime/jcl/exports.cmake index b08d170e278..85c22529944 100644 --- a/runtime/jcl/exports.cmake +++ b/runtime/jcl/exports.cmake @@ -636,6 +636,8 @@ if(J9VM_OPT_OPENJDK_METHODHANDLE) omr_add_exports(jclse Java_java_lang_invoke_MethodHandleNatives_init Java_java_lang_invoke_MethodHandleNatives_expand + Java_java_lang_invoke_MethodHandleNatives_findLambdaInSCC + Java_java_lang_invoke_MethodHandleNatives_findLambdaFormInSCC Java_java_lang_invoke_MethodHandleNatives_resolve Java_java_lang_invoke_MethodHandleNatives_getMembers Java_java_lang_invoke_MethodHandleNatives_objectFieldOffset diff --git a/runtime/jcl/j9jcl.tdf b/runtime/jcl/j9jcl.tdf index c64230a9bb3..350972d6ae3 100644 --- a/runtime/jcl/j9jcl.tdf +++ b/runtime/jcl/j9jcl.tdf @@ -713,3 +713,7 @@ TraceExit=Trc_JCL_com_ibm_oti_shared_getCpeTypeForProtocol_ExitFail2 Noenv Overh TraceExit=Trc_JCL_com_ibm_oti_shared_getCpeTypeForProtocol_ExitFail3 Noenv Overhead=1 Level=3 Template="JCL: com.ibm.oti.shared getCpeTypeForProtocol: Attempt to determine path type resulted in error code %d" TraceEntry=Trc_JCL_com_ibm_oti_shared_getCachedURL_Entry_1 Overhead=1 Level=2 Template="JCL: com.ibm.oti.shared getCachedURL: Entering for helperID=%d" + +TraceEntry=Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Entry Overhead=1 Level=3 Template="Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Enter: classnameObject = %p, lookupClass = %p, options = 0x%08X" +TraceEvent=Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Found Overhead=1 Level=3 Template="Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = %.*s, lookupClass = %p, options = 0x%08X" +TraceExit=Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC_Exit Overhead=1 Level=3 Template="MethodHandleNatives_findLambdaOrLambdaFormInSCC Exit" \ No newline at end of file diff --git a/runtime/jcl/uma/java_lang_invoke_MethodHandleNatives_exports.xml b/runtime/jcl/uma/java_lang_invoke_MethodHandleNatives_exports.xml index 2cb2a6ec15c..e13ce9a2ce9 100644 --- a/runtime/jcl/uma/java_lang_invoke_MethodHandleNatives_exports.xml +++ b/runtime/jcl/uma/java_lang_invoke_MethodHandleNatives_exports.xml @@ -21,6 +21,8 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex + + diff --git a/runtime/oti/j9consts.h b/runtime/oti/j9consts.h index 98cb718c50d..1d710ca5c90 100644 --- a/runtime/oti/j9consts.h +++ b/runtime/oti/j9consts.h @@ -447,8 +447,6 @@ extern "C" { #define J9_FINDCLASS_FLAG_CLASS_OPTION_NESTMATE 0x40000 #define J9_FINDCLASS_FLAG_CLASS_OPTION_STRONG 0x80000 #define J9_FINDCLASS_FLAG_DO_NOT_SHARE 0x100000 -#define J9_FINDCLASS_FLAG_LAMBDA 0x200000 -#define J9_FINDCLASS_FLAG_LAMBDAFORM 0x400000 #define J9_FINDKNOWNCLASS_FLAG_INITIALIZE 0x1 #define J9_FINDKNOWNCLASS_FLAG_EXISTING_ONLY 0x2 diff --git a/runtime/oti/jclprots.h b/runtime/oti/jclprots.h index db27b9e7644..3bd2cc4297e 100644 --- a/runtime/oti/jclprots.h +++ b/runtime/oti/jclprots.h @@ -981,6 +981,8 @@ jobject JNICALL Java_java_lang_invoke_MethodType_makeTenured(JNIEnv *env, jclass #if defined(J9VM_OPT_OPENJDK_METHODHANDLE) void JNICALL Java_java_lang_invoke_MethodHandleNatives_init(JNIEnv *env, jclass clazz, jobject self, jobject ref); void JNICALL Java_java_lang_invoke_MethodHandleNatives_expand(JNIEnv *env, jclass clazz, jobject self); +jobject JNICALL Java_java_lang_invoke_MethodHandleNatives_findLambdaInSCC(JNIEnv *env, jclass clazz, jstring classname, jclass lookupClass); +jobject JNICALL Java_java_lang_invoke_MethodHandleNatives_findLambdaFormInSCC(JNIEnv *env, jclass clazz, jstring classname, jclass lookupClass); jobject JNICALL Java_java_lang_invoke_MethodHandleNatives_resolve( #if JAVA_SPEC_VERSION == 8 JNIEnv *env, jclass clazz, jobject self, jclass caller); diff --git a/runtime/shared_common/Manager.cpp b/runtime/shared_common/Manager.cpp index 9d1e01415fb..bbe5e6e26a1 100644 --- a/runtime/shared_common/Manager.cpp +++ b/runtime/shared_common/Manager.cpp @@ -65,13 +65,6 @@ SH_Manager::HashLinkedListImpl::initialize(const J9UTF8* key_, const ShcItem* it _key = key_? (U_8*)J9UTF8_DATA(key_): NULL; _keySize = key_? (U_16)J9UTF8_LENGTH(key_): 0; -#if JAVA_SPEC_VERSION < 21 - char *end = getLastDollarSignOfLambdaClassName((const char *)_key, _keySize); - if (NULL != end) { - /* if it's a lambda class, we need the part of the class name before the index number so that classes that are the same but have different index numbers can get matched */ - _keySize = (U_16)(end - (char *)_key + 1); - } -#endif /* JAVA_SPEC_VERSION < 21 */ _item = item_; /* Create the required circular link during initialization so * it will be there when the entry is added to the hashtable under diff --git a/runtime/shared_common/SCImplementedAPI.cpp b/runtime/shared_common/SCImplementedAPI.cpp index 06abf835e05..168758aa3bf 100644 --- a/runtime/shared_common/SCImplementedAPI.cpp +++ b/runtime/shared_common/SCImplementedAPI.cpp @@ -853,13 +853,6 @@ j9shr_classStoreTransaction_nextSharedClassForCompare(void * tobj) const char *stringBytes = (const char*)obj->classnameData; U_16 stringLength = obj->classnameLength; -#if JAVA_SPEC_VERSION < 21 - char *end = getLastDollarSignOfLambdaClassName(stringBytes, obj->classnameLength); - if (NULL != end) { - stringLength = (U_16)(end - stringBytes + 1); - } -#endif /* JAVA_SPEC_VERSION < 21 */ - obj->findNextRomClass = (J9ROMClass *)cachemap->findNextROMClass(currentThread, obj->findNextIterator, obj->firstFound, stringLength, stringBytes); Trc_SHR_API_j9shr_nextSharedClassForCompare_Exit(currentThread); @@ -1173,3 +1166,34 @@ j9shr_jclUpdateROMClassMetaData(J9VMThread* currentThread, J9ClassLoader* classl } } +/** + * Called by JCL natives, this function tries to find an orphan ROMClass in the SCC using a unique ID as a lookup key. + * + * @param [in] currentThread thread calling this function + * @param [in] uniqueID lookup key for SCC + * @param [in] uniqueIDLength + * + * @return pointer to a J9ROMClass if present in the SCC, nullptr otherwise + */ +J9ROMClass * +j9shr_jclFindOrphanROMClassByUniqueID(J9VMThread *currentThread, const char *uniqueID, UDATA uniqueIDLength) +{ + Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID_Entry(currentThread, (UDATA)uniqueIDLength, uniqueID); + + J9JavaVM *vm = currentThread->javaVM; + J9SharedClassConfig *sconfig = currentThread->javaVM->sharedClassConfig; + if (nullptr == sconfig) { + return nullptr; + } + + SH_CacheMap *cachemap = reinterpret_cast(sconfig->sharedClassCache); + void *iterator = nullptr; + void *firstFound = nullptr; + omrthread_monitor_enter(vm->classMemorySegments->segmentMutex); + J9ROMClass *romClass = const_cast(cachemap->findNextROMClass(currentThread, iterator, firstFound, uniqueIDLength, uniqueID)); + omrthread_monitor_exit(vm->classMemorySegments->segmentMutex); + + Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID_Exit(currentThread, (UDATA)uniqueIDLength, uniqueID); + + return romClass; +} \ No newline at end of file diff --git a/runtime/shared_common/SCImplementedAPI.hpp b/runtime/shared_common/SCImplementedAPI.hpp index 965fd481fcb..d33d57c0878 100644 --- a/runtime/shared_common/SCImplementedAPI.hpp +++ b/runtime/shared_common/SCImplementedAPI.hpp @@ -43,7 +43,8 @@ BOOLEAN j9shr_classStoreTransaction_isOK(void * tobj); BOOLEAN j9shr_classStoreTransaction_hasSharedStringTableLock(void * tobj); void j9shr_classStoreTransaction_updateUnstoredBytes(U_32 romClassSizeFullSize, void * tobj); -J9ROMClass * j9shr_jclUpdateROMClassMetaData(J9VMThread* currentThread, J9ClassLoader* classloader, J9ClassPathEntry** classPathEntries, UDATA cpEntryCount, UDATA entryIndex, const J9UTF8* partition, const J9ROMClass * existingClass); +J9ROMClass *j9shr_jclUpdateROMClassMetaData(J9VMThread *currentThread, J9ClassLoader *classloader, J9ClassPathEntry **classPathEntries, UDATA cpEntryCount, UDATA entryIndex, const J9UTF8 *partition, const J9ROMClass *existingClass); +J9ROMClass *j9shr_jclFindOrphanROMClassByUniqueID(J9VMThread *currentThread, const char *uniqueID, UDATA uniqueIDLength); #ifdef __cplusplus }/*extern "C"*/ diff --git a/runtime/shared_common/include/SCAbstractAPI.h b/runtime/shared_common/include/SCAbstractAPI.h index 233de9004ef..922d478b8c8 100644 --- a/runtime/shared_common/include/SCAbstractAPI.h +++ b/runtime/shared_common/include/SCAbstractAPI.h @@ -59,7 +59,8 @@ typedef struct SCAbstractAPI void (*classStoreTransaction_updateUnstoredBytes) (U_32 romClassSizeFullSize, void * tobj); /*Function for JCL to update cache metadata for an existing shared class*/ - J9ROMClass * (*jclUpdateROMClassMetaData)(J9VMThread* currentThread, J9ClassLoader* classloader, J9ClassPathEntry** classPathEntries, UDATA cpEntryCount, UDATA entryIndex, const J9UTF8* partition, const J9ROMClass * existingClass); + J9ROMClass *(*jclUpdateROMClassMetaData)(J9VMThread *currentThread, J9ClassLoader *classloader, J9ClassPathEntry **classPathEntries, UDATA cpEntryCount, UDATA entryIndex, const J9UTF8 *partition, const J9ROMClass *existingClass); + J9ROMClass *(*jclFindOrphanROMClassByUniqueID)(J9VMThread *currentThread, const char *uniqueID, UDATA uniqueIDLength); /* Functions for finishing initialization of shared classes. Called between * AGENTS_STARTED & ABOUT_TO_BOOTSTRAP by jvminit.c diff --git a/runtime/shared_common/j9shr.tdf b/runtime/shared_common/j9shr.tdf index c2a7b7416e2..897e03dc886 100644 --- a/runtime/shared_common/j9shr.tdf +++ b/runtime/shared_common/j9shr.tdf @@ -3004,3 +3004,6 @@ TraceEvent=Trc_SHR_TMI_LocalCheckTimestamp_Timestamps Overhead=1 Level=6 Templat TraceEvent=Trc_SHR_VMInitStages_Event_UsingJITServerAOTCacheLayer Overhead=1 Level=1 Template="The shared cache is using a temporary top layer for the JITServer AOT cache" TraceEvent=Trc_SHR_OSC_Mmap_startup_jitserverlayergooddelete NoEnv Overhead=1 Level=1 Template="SH_OSCachemmap::startup: deleteCacheFile succeeded for cache path name = %s, file handle %zd" TraceException=Trc_SHR_OSC_Mmap_startup_jitserverlayerbaddelete NoEnv Overhead=1 Level=1 Template="SH_OSCachemmap::startup: deleteCacheFile failed for cache path name = %s, file handle %zd" + +TraceEntry=Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID_Entry Overhead=1 Level=3 Template="API Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID : enter uniqueID=%.*s" +TraceEntry=Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID_Exit Overhead=1 Level=3 Template="API Trc_SHR_API_j9shr_jclFindOrphanROMClassByUniqueID : exit uniqueID=%.*s" \ No newline at end of file diff --git a/runtime/shared_common/shrinit.cpp b/runtime/shared_common/shrinit.cpp index e523a0f2916..a0ebd50e1dd 100644 --- a/runtime/shared_common/shrinit.cpp +++ b/runtime/shared_common/shrinit.cpp @@ -3033,6 +3033,7 @@ initializeSharedAPI(J9JavaVM *vm) scapi->classStoreTransaction_updateUnstoredBytes = j9shr_classStoreTransaction_updateUnstoredBytes; /*Set JCL functions*/ scapi->jclUpdateROMClassMetaData = j9shr_jclUpdateROMClassMetaData; + scapi->jclFindOrphanROMClassByUniqueID = j9shr_jclFindOrphanROMClassByUniqueID; /*Set up functions for finishing share classes initialization*/ scapi->sharedClassesFinishInitialization = j9shr_sharedClassesFinishInitialization; /*Set up functions to query the state of shared classes*/ diff --git a/runtime/util/shchelp_j9.c b/runtime/util/shchelp_j9.c index 9015c9d613b..cb4c5b7413a 100644 --- a/runtime/util/shchelp_j9.c +++ b/runtime/util/shchelp_j9.c @@ -87,8 +87,7 @@ getOpenJ9Sha() return sha; } -#if JAVA_SPEC_VERSION < 21 -char* +char * getLastDollarSignOfLambdaClassName(const char *className, UDATA classNameLength) { char *end = NULL; @@ -110,56 +109,29 @@ getLastDollarSignOfLambdaClassName(const char *className, UDATA classNameLength) /* return NULL if it is not a lambda class */ return NULL; } -#endif /* JAVA_SPEC_VERSION < 21 */ BOOLEAN isLambdaClassName(const char *className, UDATA classNameLength, UDATA *deterministicPrefixLength) { BOOLEAN result = FALSE; - -#if JAVA_SPEC_VERSION < 21 /* - * Before JDK21, Lambda class names are in the format: - * HostClassName$$Lambda$/ + * Lambda class names are in the format: + * HostClassName$$Lambda$/ * getLastDollarSignOfLambdaClassName verifies this format and returns * a non-NULL pointer if successfully verified. */ const char *dollarSign = getLastDollarSignOfLambdaClassName(className, classNameLength); if (NULL != dollarSign) { - result = TRUE; - if (NULL != deterministicPrefixLength) { - /* - * To reliably identify lambda classes across JVM instances, JITServer AOT cache uses the - * deterministic class name prefix (up to and including the last '$') and the ROMClass hash. - */ - *deterministicPrefixLength = dollarSign + 1 - className; - } - } -#else /* JAVA_SPEC_VERSION < 21 */ - /* - * For JDK21 and later, Lambda class names are in the format: - * HostClassName$$Lambda/ - * Verifies format by identifiying last occurence of '$' and checking for the - * Lambda suffix. - */ -#if defined(J9VM_ENV_DATA64) -#define J9_LAMBDA_CLASS_SUFFIX "$$Lambda/0x0000000000000000" -#else /* defined(J9VM_ENV_DATA64) */ -#define J9_LAMBDA_CLASS_SUFFIX "$$Lambda/0x00000000" -#endif /* defined(J9VM_ENV_DATA64) */ - UDATA lambdaSuffixLength = LITERAL_STRLEN(J9_LAMBDA_CLASS_SUFFIX); - if (isStrSuffixHelper(className, classNameLength, J9_LAMBDA_CLASS_SUFFIX, lambdaSuffixLength)) { result = TRUE; if (NULL != deterministicPrefixLength) { /* * To reliably identify lambda classes across JVM instances, JITServer AOT cache uses the * deterministic class name prefix (up to and including the last '/') and the ROMClass hash. */ - *deterministicPrefixLength = classNameLength - lambdaSuffixLength + LITERAL_STRLEN("$$Lambda/"); + const char *slash = memchr(dollarSign, '/', classNameLength - (UDATA)(dollarSign - className)); + *deterministicPrefixLength = slash ? (slash + 1 - className) : 0; } } -#undef J9_LAMBDA_CLASSNAME_SUFFIX -#endif /* JAVA_SPEC_VERSION < 21 */ return result; } @@ -172,7 +144,7 @@ isLambdaFormClassName(const char *className, UDATA classNameLength, UDATA *deter /* * Lambda form class names are in the format: - * java/lang/invoke/LambdaForm$/ + * java/lang/invoke/LambdaForm$$/ * where is BMH, DMH, or MH. */ #define J9_LAMBDA_FORM_CLASSNAME "java/lang/invoke/LambdaForm$" diff --git a/test/functional/cmdLineTests/shareClassTests/SCCMLTests/ShareClassesCMLTests-1.xml b/test/functional/cmdLineTests/shareClassTests/SCCMLTests/ShareClassesCMLTests-1.xml index 23f2ca0d31e..65a7369a784 100644 --- a/test/functional/cmdLineTests/shareClassTests/SCCMLTests/ShareClassesCMLTests-1.xml +++ b/test/functional/cmdLineTests/shareClassTests/SCCMLTests/ShareClassesCMLTests-1.xml @@ -1054,17 +1054,11 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex Processing dump event - $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259} $CP_HANOI$ $PROGRAM_LAMBDA$ 0 - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Lambda test done! - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Unhandled Exception corrupt @@ -1073,10 +1067,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex $JAVA_EXE$ $currentMode$,printstats=orphan+romclass - ORPHAN: org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) at - ORPHAN: org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) at + ORPHAN: org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) at + ORPHAN: org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) at - ROMCLASS: org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) at + ROMCLASS: org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) at Unhandled Exception Exception: corrupt @@ -1084,63 +1078,24 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex - $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9bcu.270} $CP_HANOI$ $PROGRAM_LAMBDA$ 0 - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' + $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9jcl.541} $CP_HANOI$ $PROGRAM_LAMBDA$ 0 + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Lambda test done! - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' - - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) - Unhandled Exception - Exception: - corrupt - Processing dump event - + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) - - $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9bcu.270} $CP_HANOI$ $PROGRAM_LAMBDA$ 1 - Lambda test done! - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' - - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Unhandled Exception Exception: corrupt Processing dump event - - $JAVA_EXE$ $currentMode$,destroy - Cache does not exist - has been destroyed - is destroyed - - Unhandled Exception - Exception: - corrupt - Processing dump event - JVM requested Java dump - JVM requested Snap dump - - - + $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259} $CP_HANOI$ $PROGRAM_LAMBDA$ 2 - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) - Lambda test done! - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) - - Unhandled Exception - Exception: - corrupt - Processing dump event - - - - $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9bcu.270} $CP_HANOI$ $PROGRAM_LAMBDA$ 3 - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Lambda test done! - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) Unhandled Exception Exception: corrupt @@ -1163,10 +1118,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259} $CP_HANOI$ $PROGRAM_LAMBDA$ 4 - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Lambda test done! - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test2..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test2..Lambda.*/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Unhandled Exception Exception: @@ -1175,14 +1130,14 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex - $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9bcu.270} $CP_HANOI$ $PROGRAM_LAMBDA$ 4 - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' + $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259,j9jcl.541} $CP_HANOI$ $PROGRAM_LAMBDA$ 4 + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Lambda test done! - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test2..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' - compareROMClassForEquality returns 1 for class name 'org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000)' + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = org/openj9/test/lambdatests/Test2..Lambda.*/(0x00000000|0x0000000000000000) + Trc_JCL_java_lang_invoke_MethodHandleNatives_findLambdaOrLambdaFormInSCC Found: name = org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test2..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test2..Lambda.*/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Unhandled Exception Exception: corrupt @@ -1207,7 +1162,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex $JAVA_EXE$ $currentMode$ -Xtrace:print={j9shr.2259} -XX:-ShareAnonymousClasses $CP_HANOI$ $PROGRAM_LAMBDA$ 0 Lambda test done! - j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) + j9shr[\.]2259 > API j9shr_classStoreTransaction_createSharedClass : enter [\(]classname=org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) Unhandled Exception Exception: corrupt @@ -1218,7 +1173,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex $JAVA_EXE$ $currentMode$,printstats=orphan+romclass ORPHAN: org/openj9/test/lambdatests/Test1 at - org/openj9/test/lambdatests/Test1..Lambda(.[\d]+)?/(0x00000000|0x0000000000000000) at + org/openj9/test/lambdatests/Test1..Lambda.*/(0x00000000|0x0000000000000000) at Unhandled Exception Exception: corrupt