Skip to content

Commit 4310e73

Browse files
authored
Merge pull request #21518 from tajila/vtbackport
(0.51) Disable fast JNI wait if wait can unmount continuations.
2 parents 5a018cd + 9544f28 commit 4310e73

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

runtime/vm/FastJNI.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ removePrefixes(J9JVMTIData *jvmtiData, U_8 **methodNameData, UDATA *methodNameLe
7979
if ((j9env->flags & J9JVMTIENV_FLAG_RETRANSFORM_CAPABLE) == retransformFlag) {
8080
jint prefixCount = j9env->prefixCount;
8181
char *prefix = j9env->prefixes;
82-
82+
8383
/* Remove the prefixes */
8484
while (0 != prefixCount) {
8585
size_t prefixLength = strlen(prefix);
@@ -145,6 +145,17 @@ jniNativeMethodProperties(J9VMThread *currentThread, J9Method *jniNativeMethod,
145145
UDATA entryLength = methodDescriptor->methodNameLength;
146146
if (J9UTF8_DATA_EQUALS(methodNameData, methodNameLength, entryData, entryLength)) {
147147
found:
148+
#if JAVA_SPEC_VERSION >= 24
149+
/* Fast implementation located - if wait can unmount the continuation, check to see if this
150+
* native is the wait implememnation and reject it if so.
151+
*/
152+
if (J9_ARE_ANY_BITS_SET(currentThread->javaVM->extendedRuntimeFlags3, J9_EXTENDED_RUNTIME3_YIELD_PINNED_CONTINUATION)
153+
&& J9UTF8_LITERAL_EQUALS(methodName, methodNameLength, "waitImpl")
154+
&& J9UTF8_LITERAL_EQUALS(methodSignature, methodSignatureLength, "(JI)V")
155+
) {
156+
goto done;
157+
}
158+
#endif /* JAVA_SPEC_VERSION >= 24 */
148159
address = methodDescriptor->function;
149160
flags = methodDescriptor->flags;
150161
Trc_VM_fastJNINativeFound(

0 commit comments

Comments
 (0)