Skip to content

Commit 8a2ed5a

Browse files
authored
Merge pull request eclipse-openj9#20912 from keithc-ca/dead
Remove dead code for obsolete Java versions
2 parents 292a13b + c7075e6 commit 8a2ed5a

File tree

7 files changed

+13
-129
lines changed

7 files changed

+13
-129
lines changed

runtime/exelib/common/libargs.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ vmOptionsTableAddOptionWithCopy(void **vmOptionsTable, char *optionString, void
311311
#if defined(WIN32)
312312
/* On Windows, the subdirectory containing the redirector hasn't changed with Java versions. */
313313
#define J9JAVA_REDIRECTOR_SUBDIR "\\bin\\j9vm\\"
314-
#elif (JAVA_SPEC_VERSION >= 10) || ((JAVA_SPEC_VERSION == 9) && defined(OPENJ9_BUILD)) || defined(OSX)
314+
#elif (JAVA_SPEC_VERSION >= 10) || defined(OSX) /* defined(WIN32) */
315315
/* On other platforms, the subdirectory containing the redirector is common in recent Java versions. */
316316
#define J9JAVA_REDIRECTOR_SUBDIR "/lib/j9vm/"
317-
#else /* WIN32 */
317+
#else /* defined(WIN32) */
318318
/* In Java 8 and early versions of Java 9, the path depends on the platform architecture. */
319319
#if defined(J9HAMMER)
320320
#define JVM_ARCH_DIR "amd64"
@@ -337,12 +337,12 @@ vmOptionsTableAddOptionWithCopy(void **vmOptionsTable, char *optionString, void
337337
#define JVM_ARCH_DIR "ppc64"
338338
#endif /* PPC64 */
339339
#elif defined(RISCV64)
340-
#define JVM_ARCH_DIR "riscv64"
340+
#define JVM_ARCH_DIR "riscv64"
341341
#else
342342
#error "Must define an architecture"
343343
#endif
344344
#define J9JAVA_REDIRECTOR_SUBDIR "/lib/" JVM_ARCH_DIR "/j9vm/"
345-
#endif /* WIN32 */
345+
#endif /* defined(WIN32) */
346346

347347
#define JAVAHOMEDIR "-Djava.home="
348348
#define JAVAHOMEDIR_LEN (sizeof(JAVAHOMEDIR) - 1)

runtime/j9vm/exports.cmake

-8
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,6 @@ if(NOT JAVA_SPEC_VERSION LESS 19)
406406
JVM_LoadZipLibrary
407407
JVM_RegisterContinuationMethods
408408
)
409-
if(JAVA_SPEC_VERSION LESS 21)
410-
jvm_add_exports(jvm
411-
JVM_VirtualThreadMountBegin
412-
JVM_VirtualThreadMountEnd
413-
JVM_VirtualThreadUnmountBegin
414-
JVM_VirtualThreadUnmountEnd
415-
)
416-
endif()
417409
endif()
418410

419411
if(JAVA_SPEC_VERSION LESS 20)

runtime/j9vm/j9scar.tdf

+8-8
Original file line numberDiff line numberDiff line change
@@ -351,17 +351,17 @@ TraceEvent=Trc_SC_LoadLibrary_OpenShared_Decorate NoEnv Overhead=1 Level=3 Templ
351351

352352
TraceExit=Trc_SC_LoadLibrary_Exit NoEnv Overhead=1 Level=2 Template="JVM_LoadLibrary -- return 0x%zx"
353353

354-
TraceEntry=Trc_SC_VirtualThreadMountBegin_Entry Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
355-
TraceExit=Trc_SC_VirtualThreadMountBegin_Exit Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
354+
TraceEntry=Trc_SC_VirtualThreadMountBegin_Entry Obsolete Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
355+
TraceExit=Trc_SC_VirtualThreadMountBegin_Exit Obsolete Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
356356

357-
TraceEntry=Trc_SC_VirtualThreadMountEnd_Entry Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
358-
TraceExit=Trc_SC_VirtualThreadMountEnd_Exit Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
357+
TraceEntry=Trc_SC_VirtualThreadMountEnd_Entry Obsolete Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
358+
TraceExit=Trc_SC_VirtualThreadMountEnd_Exit Obsolete Overhead=1 Level=3 Template="thread = %p, firstMount = %d"
359359

360-
TraceEntry=Trc_SC_VirtualThreadUnmountBegin_Entry Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
361-
TraceExit=Trc_SC_VirtualThreadUnmountBegin_Exit Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
360+
TraceEntry=Trc_SC_VirtualThreadUnmountBegin_Entry Obsolete Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
361+
TraceExit=Trc_SC_VirtualThreadUnmountBegin_Exit Obsolete Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
362362

363-
TraceEntry=Trc_SC_VirtualThreadUnmountEnd_Entry Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
364-
TraceExit=Trc_SC_VirtualThreadUnmountEnd_Exit Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
363+
TraceEntry=Trc_SC_VirtualThreadUnmountEnd_Entry Obsolete Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
364+
TraceExit=Trc_SC_VirtualThreadUnmountEnd_Exit Obsolete Overhead=1 Level=3 Template="thread = %p, lastUnmount = %d"
365365

366366
TraceEvent=Trc_SC_VirtualThread_Info Overhead=1 Level=3 Test Template="virtualThreadObj = %p, virtualThreadState = %p, virtualThreadInspectorCount = %lld, carrierThreadObj = %p, continuationObj = %p, J9VMContinuation = %p"
367367

runtime/j9vm/j9vmnatives.xml

-13
Original file line numberDiff line numberDiff line change
@@ -440,19 +440,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
440440
<export name="JVM_IsContinuationsSupported"/>
441441
<export name="JVM_IsPreviewEnabled"/>
442442
<export name="JVM_RegisterContinuationMethods"/>
443-
<!-- Removed in Java 21. -->
444-
<export name="JVM_VirtualThreadMountBegin">
445-
<exclude-if condition="spec.java21"/>
446-
</export>
447-
<export name="JVM_VirtualThreadMountEnd">
448-
<exclude-if condition="spec.java21"/>
449-
</export>
450-
<export name="JVM_VirtualThreadUnmountBegin">
451-
<exclude-if condition="spec.java21"/>
452-
</export>
453-
<export name="JVM_VirtualThreadUnmountEnd">
454-
<exclude-if condition="spec.java21"/>
455-
</export>
456443
</exports>
457444

458445
<exports group="jdk20">

runtime/j9vm/java11vmi.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -1829,11 +1829,7 @@ JVM_RegisterLambdaProxyClassForArchiving(JNIEnv *env, jclass arg1, jstring arg2,
18291829
}
18301830

18311831
JNIEXPORT jclass JNICALL
1832-
JVM_LookupLambdaProxyClassFromArchive(JNIEnv *env, jclass arg1, jstring arg2, jobject arg3, jobject arg4, jobject arg5, jobject arg6
1833-
#if JAVA_SPEC_VERSION == 15
1834-
, jboolean arg7
1835-
#endif /* JAVA_SPEC_VERSION == 15 */
1836-
)
1832+
JVM_LookupLambdaProxyClassFromArchive(JNIEnv *env, jclass arg1, jstring arg2, jobject arg3, jobject arg4, jobject arg5, jobject arg6)
18371833
{
18381834
assert(!"JVM_LookupLambdaProxyClassFromArchive unimplemented");
18391835
return NULL;

runtime/j9vm/javanextvmi.cpp

-81
Original file line numberDiff line numberDiff line change
@@ -482,87 +482,6 @@ virtualThreadUnmountEnd(JNIEnv *env, jobject thread)
482482
}
483483
#endif /* JAVA_SPEC_VERSION >= 19 */
484484

485-
#if (19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21)
486-
JNIEXPORT void JNICALL
487-
JVM_VirtualThreadMountBegin(JNIEnv *env, jobject thread, jboolean firstMount)
488-
{
489-
J9VMThread *currentThread = (J9VMThread *)env;
490-
J9JavaVM *vm = currentThread->javaVM;
491-
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
492-
493-
Trc_SC_VirtualThreadMountBegin_Entry(currentThread, thread, firstMount);
494-
495-
vmFuncs->internalEnterVMFromJNI(currentThread);
496-
497-
virtualThreadMountBegin(env, thread);
498-
499-
vmFuncs->internalExitVMToJNI(currentThread);
500-
501-
Trc_SC_VirtualThreadMountBegin_Exit(currentThread, thread, firstMount);
502-
}
503-
504-
JNIEXPORT void JNICALL
505-
JVM_VirtualThreadMountEnd(JNIEnv *env, jobject thread, jboolean firstMount)
506-
{
507-
J9VMThread *currentThread = (J9VMThread *)env;
508-
J9JavaVM *vm = currentThread->javaVM;
509-
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
510-
511-
Trc_SC_VirtualThreadMountEnd_Entry(currentThread, thread, firstMount);
512-
513-
vmFuncs->internalEnterVMFromJNI(currentThread);
514-
515-
virtualThreadMountEnd(env, thread);
516-
if (firstMount) {
517-
TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_STARTED(vm->hookInterface, currentThread);
518-
}
519-
520-
vmFuncs->internalExitVMToJNI(currentThread);
521-
522-
Trc_SC_VirtualThreadMountEnd_Exit(currentThread, thread, firstMount);
523-
}
524-
525-
JNIEXPORT void JNICALL
526-
JVM_VirtualThreadUnmountBegin(JNIEnv *env, jobject thread, jboolean lastUnmount)
527-
{
528-
J9VMThread *currentThread = (J9VMThread *)env;
529-
J9JavaVM *vm = currentThread->javaVM;
530-
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
531-
532-
Trc_SC_VirtualThreadUnmountBegin_Entry(currentThread, thread, lastUnmount);
533-
534-
vmFuncs->internalEnterVMFromJNI(currentThread);
535-
536-
if (lastUnmount) {
537-
TRIGGER_J9HOOK_VM_VIRTUAL_THREAD_END(vm->hookInterface, currentThread);
538-
setContinuationStateToLastUnmount((J9VMThread *)env, thread);
539-
}
540-
virtualThreadUnmountBegin(env, thread);
541-
542-
vmFuncs->internalExitVMToJNI(currentThread);
543-
544-
Trc_SC_VirtualThreadUnmountBegin_Exit(currentThread, thread,lastUnmount);
545-
}
546-
547-
JNIEXPORT void JNICALL
548-
JVM_VirtualThreadUnmountEnd(JNIEnv *env, jobject thread, jboolean lastUnmount)
549-
{
550-
J9VMThread *currentThread = (J9VMThread *)env;
551-
J9JavaVM *vm = currentThread->javaVM;
552-
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
553-
554-
Trc_SC_VirtualThreadUnmountEnd_Entry(currentThread, thread, lastUnmount);
555-
556-
vmFuncs->internalEnterVMFromJNI(currentThread);
557-
558-
virtualThreadUnmountEnd(env, thread);
559-
560-
vmFuncs->internalExitVMToJNI(currentThread);
561-
562-
Trc_SC_VirtualThreadUnmountEnd_Exit(currentThread, thread, lastUnmount);
563-
}
564-
#endif /* (19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21) */
565-
566485
#if JAVA_SPEC_VERSION >= 20
567486
JNIEXPORT jint JNICALL
568487
JVM_GetClassFileVersion(JNIEnv *env, jclass cls)

runtime/redirector/forwarders.m4

-10
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ _IF([JAVA_SPEC_VERSION >= 16],
371371
[_X(JVM_GetRandomSeedForDumping, JNICALL, false, jlong)])
372372
_IF([JAVA_SPEC_VERSION >= 15],
373373
[_X(JVM_RegisterLambdaProxyClassForArchiving, JNICALL, false, void, JNIEnv *env, jclass arg1, jstring arg2, jobject arg3, jobject arg4, jobject arg5, jobject arg6, jclass arg7)])
374-
_IF([JAVA_SPEC_VERSION == 15],
375-
[_X(JVM_LookupLambdaProxyClassFromArchive, JNICALL, false, jclass, JNIEnv *env, jclass arg1, jstring arg2, jobject arg3, jobject arg4, jobject arg5, jobject arg6, jboolean arg7)])
376374
_IF([JAVA_SPEC_VERSION >= 16],
377375
[_X(JVM_LookupLambdaProxyClassFromArchive, JNICALL, false, jclass, JNIEnv *env, jclass arg1, jstring arg2, jobject arg3, jobject arg4, jobject arg5, jobject arg6)])
378376
_IF([(15 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 23)],
@@ -403,14 +401,6 @@ _IF([JAVA_SPEC_VERSION >= 19],
403401
[_X(JVM_IsContinuationsSupported, JNICALL, false, void, void)])
404402
_IF([JAVA_SPEC_VERSION >= 19],
405403
[_X(JVM_IsPreviewEnabled, JNICALL, false, void, void)])
406-
_IF([(19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21)],
407-
[_X(JVM_VirtualThreadMountBegin, JNICALL, false, void, JNIEnv *env, jobject thread, jboolean firstMount)])
408-
_IF([(19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21)],
409-
[_X(JVM_VirtualThreadMountEnd, JNICALL, false, void, JNIEnv *env, jobject thread, jboolean firstMount)])
410-
_IF([(19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21)],
411-
[_X(JVM_VirtualThreadUnmountBegin, JNICALL, false, void, JNIEnv *env, jobject thread, jboolean lastUnmount)])
412-
_IF([(19 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 21)],
413-
[_X(JVM_VirtualThreadUnmountEnd, JNICALL, false, void, JNIEnv *env, jobject thread, jboolean lastUnmount)])
414404
_IF([JAVA_SPEC_VERSION >= 20],
415405
[_X(JVM_GetClassFileVersion, JNICALL, false, jint, JNIEnv *env, jclass cls)])
416406
_IF([(20 <= JAVA_SPEC_VERSION) && (JAVA_SPEC_VERSION < 23)],

0 commit comments

Comments
 (0)