Skip to content

Commit 8f727c5

Browse files
committed
hotspot: Fix WhiteBox JNI method names mismatch with classlib 8
This fixes a number of UnsatisfiedLinkErrors in hotspot8 test
1 parent 49ac059 commit 8f727c5

3 files changed

Lines changed: 45 additions & 69 deletions

File tree

cvm/conf/jtreg_hotspot8_excludes_aarch64.list

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
compiler/6859338/Test6859338.java
22
compiler/7196199/Test7196199.java
33
compiler/8004741/Test8004741.java
4-
compiler/8009761/Test8009761.java
5-
compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
6-
compiler/classUnloading/methodUnloading/TestMethodUnloading.java
74
compiler/EscapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
8-
compiler/floatingpoint/TestPow2.java
9-
compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
10-
compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
11-
compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
12-
compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
13-
compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
14-
compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
15-
compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
16-
compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
17-
compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
18-
compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
19-
compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
20-
compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
215
compiler/intrinsics/muladd/TestMulAdd.java
226
compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
237
compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
@@ -29,7 +13,6 @@ compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
2913
compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
3014
compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
3115
compiler/profiling/spectrapredefineclass/Launcher.java
32-
compiler/rangechecks/TestRangeCheckSmearing.java
3316
compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
3417
compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
3518
compiler/rtm/cli/TestRTMAbortThresholdOption.java
@@ -56,19 +39,9 @@ compiler/tiered/ConstantGettersTransitionsTest.java
5639
compiler/tiered/NonTieredLevelsTest.java
5740
compiler/tiered/TieredLevelsTest.java
5841
compiler/tiered/LevelTransitionTest.java
59-
compiler/types/correctness/CorrectnessTest.java
60-
compiler/types/correctness/OffTest.java
61-
compiler/types/TestMeetIncompatibleInterfaceArrays.java
62-
compiler/whitebox/DeoptimizeAllTest.java
63-
compiler/whitebox/ClearMethodStateTest.java
64-
compiler/whitebox/DeoptimizeMultipleOSRTest.java
6542
compiler/whitebox/EnqueueMethodForCompilationTest.java
66-
compiler/whitebox/DeoptimizeMethodTest.java
6743
compiler/whitebox/GetNMethodTest.java
6844
compiler/whitebox/MakeMethodNotCompilableTest.java
69-
compiler/whitebox/IsMethodCompilableTest.java
70-
compiler/whitebox/SetDontInlineMethodTest.java
71-
compiler/whitebox/SetForceInlineMethodTest.java
7245
gc/6941923/Test6941923.java
7346
gc/arguments/TestAggressiveHeap.java
7447
gc/arguments/TestG1ConcRefinementThreads.java
@@ -82,7 +55,6 @@ gc/arguments/TestUseCompressedOopsErgo.java
8255
gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
8356
gc/class_unloading/TestG1ClassUnloadingHWM.java
8457
gc/ergonomics/TestDynamicNumberOfGCThreads.java
85-
gc/g1/mixedgc/TestOldGenCollectionUsage.java
8658
gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
8759
gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
8860
gc/g1/TestGCLogMessages.java
@@ -111,7 +83,6 @@ gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
11183
gc/survivorAlignment/TestPromotionFromEdenToTenured.java
11284
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
11385
gc/survivorAlignment/TestPromotionToSurvivor.java
114-
gc/whitebox/TestWBGC.java
11586
gc/TestGCLogRotationViaJcmd.java
11687
gc/TestMemoryMXBeansAndPoolsPresence.java
11788
gc/TestVerifyDuringStartup.java
@@ -169,10 +140,6 @@ runtime/SharedArchiveFile/SharedBaseAddress.java
169140
runtime/SharedArchiveFile/SpaceUtilizationCheck.java
170141
serviceability/dcmd/ClassLoaderStatsTest.java
171142
serviceability/ParserTest.java
172-
testlibrary/ctw/test/ClassesDirTest.java
173-
testlibrary/ctw/test/ClassesListTest.java
174-
testlibrary/ctw/test/JarDirTest.java
175-
testlibrary/ctw/test/JarsTest.java
176143
testlibrary_tests/whitebox/vm_flags/DoubleTest.java
177144
testlibrary_tests/whitebox/vm_flags/IntxTest.java
178145
runtime/NMT/MallocStressTest.java

cvm/conf/jtreg_hotspot8_excludes_x64.list

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
compiler/6859338/Test6859338.java
22
compiler/7196199/Test7196199.java
33
compiler/8004741/Test8004741.java
4-
compiler/8009761/Test8009761.java
5-
compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java
6-
compiler/classUnloading/methodUnloading/TestMethodUnloading.java
74
compiler/EscapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java
8-
compiler/floatingpoint/TestPow2.java
9-
compiler/intrinsics/mathexact/sanity/AddExactLongTest.java
10-
compiler/intrinsics/mathexact/sanity/AddExactIntTest.java
11-
compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java
12-
compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java
13-
compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java
14-
compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java
15-
compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java
16-
compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java
17-
compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java
18-
compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java
19-
compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java
20-
compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java
215
compiler/intrinsics/muladd/TestMulAdd.java
226
compiler/intrinsics/sha/sanity/TestSHA1Intrinsics.java
237
compiler/intrinsics/sha/sanity/TestSHA1MultiBlockIntrinsics.java
@@ -29,7 +13,6 @@ compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
2913
compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
3014
compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java
3115
compiler/profiling/spectrapredefineclass/Launcher.java
32-
compiler/rangechecks/TestRangeCheckSmearing.java
3316
compiler/rtm/cli/TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig.java
3417
compiler/rtm/cli/TestRTMAbortRatioOptionOnUnsupportedConfig.java
3518
compiler/rtm/cli/TestRTMTotalCountIncrRateOptionOnUnsupportedConfig.java
@@ -50,19 +33,9 @@ compiler/tiered/ConstantGettersTransitionsTest.java
5033
compiler/tiered/NonTieredLevelsTest.java
5134
compiler/tiered/TieredLevelsTest.java
5235
compiler/tiered/LevelTransitionTest.java
53-
compiler/types/correctness/CorrectnessTest.java
54-
compiler/types/correctness/OffTest.java
55-
compiler/types/TestMeetIncompatibleInterfaceArrays.java
56-
compiler/whitebox/DeoptimizeAllTest.java
57-
compiler/whitebox/ClearMethodStateTest.java
58-
compiler/whitebox/DeoptimizeMultipleOSRTest.java
5936
compiler/whitebox/EnqueueMethodForCompilationTest.java
60-
compiler/whitebox/DeoptimizeMethodTest.java
6137
compiler/whitebox/GetNMethodTest.java
6238
compiler/whitebox/MakeMethodNotCompilableTest.java
63-
compiler/whitebox/IsMethodCompilableTest.java
64-
compiler/whitebox/SetDontInlineMethodTest.java
65-
compiler/whitebox/SetForceInlineMethodTest.java
6639
gc/6941923/Test6941923.java
6740
gc/arguments/TestAggressiveHeap.java
6841
gc/arguments/TestG1ConcRefinementThreads.java
@@ -76,7 +49,6 @@ gc/arguments/TestUseCompressedOopsErgo.java
7649
gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java
7750
gc/class_unloading/TestG1ClassUnloadingHWM.java
7851
gc/ergonomics/TestDynamicNumberOfGCThreads.java
79-
gc/g1/mixedgc/TestOldGenCollectionUsage.java
8052
gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java
8153
gc/g1/TestG1TraceEagerReclaimHumongousObjects.java
8254
gc/g1/TestGCLogMessages.java
@@ -105,7 +77,6 @@ gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterFullGC.java
10577
gc/survivorAlignment/TestPromotionFromEdenToTenured.java
10678
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
10779
gc/survivorAlignment/TestPromotionToSurvivor.java
108-
gc/whitebox/TestWBGC.java
10980
gc/TestGCLogRotationViaJcmd.java
11081
gc/TestMemoryMXBeansAndPoolsPresence.java
11182
gc/TestVerifyDuringStartup.java
@@ -163,10 +134,6 @@ runtime/SharedArchiveFile/SharedBaseAddress.java
163134
runtime/SharedArchiveFile/SpaceUtilizationCheck.java
164135
serviceability/dcmd/ClassLoaderStatsTest.java
165136
serviceability/ParserTest.java
166-
testlibrary/ctw/test/ClassesDirTest.java
167-
testlibrary/ctw/test/ClassesListTest.java
168-
testlibrary/ctw/test/JarDirTest.java
169-
testlibrary/ctw/test/JarsTest.java
170137
testlibrary_tests/whitebox/vm_flags/DoubleTest.java
171138
testlibrary_tests/whitebox/vm_flags/IntxTest.java
172139
testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java
@@ -177,5 +144,4 @@ compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java
177144
compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java
178145
compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java
179146
compiler/intrinsics/sha/cli/TestUseSHAOptionOnUnsupportedCPU.java
180-
compiler/rtm/cli/TestUseRTMLockingOptionOnUnsupportedVM.java
181147
runtime/containers/docker/DockerBasicTest.java

src/hotspot/share/prims/whitebox.cpp

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,8 +2374,12 @@ WB_END
23742374
static JNINativeMethod methods[] = {
23752375
#if HOTSPOT_TARGET_CLASSLIB == 8
23762376
{CC"getObjectAddress", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress },
2377+
{CC"getObjectSize", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize },
2378+
{CC"isObjectInOldGen", CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen },
23772379
#elif HOTSPOT_TARGET_CLASSLIB == 17
23782380
{CC"getObjectAddress0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress },
2381+
{CC"getObjectSize0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize },
2382+
{CC"isObjectInOldGen0", CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen },
23792383
#else
23802384
#error "Only classlib 8 and 17 are supported."
23812385
#endif
@@ -2443,6 +2447,16 @@ static JNINativeMethod methods[] = {
24432447
{CC"deoptimizeFrames", CC"(Z)I", (void*)&WB_DeoptimizeFrames },
24442448
{CC"isFrameDeoptimized", CC"(I)Z", (void*)&WB_IsFrameDeoptimized},
24452449
{CC"deoptimizeAll", CC"()V", (void*)&WB_DeoptimizeAll },
2450+
#if HOTSPOT_TARGET_CLASSLIB == 8
2451+
{CC"deoptimizeMethod", CC"(Ljava/lang/reflect/Executable;Z)I",
2452+
(void*)&WB_DeoptimizeMethod },
2453+
{CC"isMethodCompiled", CC"(Ljava/lang/reflect/Executable;Z)Z",
2454+
(void*)&WB_IsMethodCompiled },
2455+
{CC"isMethodCompilable", CC"(Ljava/lang/reflect/Executable;IZ)Z",
2456+
(void*)&WB_IsMethodCompilable},
2457+
{CC"isMethodQueuedForCompilation",
2458+
CC"(Ljava/lang/reflect/Executable;)Z", (void*)&WB_IsMethodQueuedForCompilation},
2459+
#elif HOTSPOT_TARGET_CLASSLIB == 17
24462460
{CC"deoptimizeMethod0", CC"(Ljava/lang/reflect/Executable;Z)I",
24472461
(void*)&WB_DeoptimizeMethod },
24482462
{CC"isMethodCompiled0", CC"(Ljava/lang/reflect/Executable;Z)Z",
@@ -2451,29 +2465,52 @@ static JNINativeMethod methods[] = {
24512465
(void*)&WB_IsMethodCompilable},
24522466
{CC"isMethodQueuedForCompilation0",
24532467
CC"(Ljava/lang/reflect/Executable;)Z", (void*)&WB_IsMethodQueuedForCompilation},
2468+
#else
2469+
#error "Only classlib 8 and 17 are supported."
2470+
#endif
24542471
{CC"isIntrinsicAvailable0",
24552472
CC"(Ljava/lang/reflect/Executable;Ljava/lang/reflect/Executable;I)Z",
24562473
(void*)&WB_IsIntrinsicAvailable},
24572474
{CC"makeMethodNotCompilable0",
24582475
CC"(Ljava/lang/reflect/Executable;IZ)V", (void*)&WB_MakeMethodNotCompilable},
2476+
#if HOTSPOT_TARGET_CLASSLIB == 8
2477+
{CC"testSetDontInlineMethod",
2478+
CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetDontInlineMethod},
2479+
{CC"getMethodCompilationLevel",
2480+
CC"(Ljava/lang/reflect/Executable;Z)I", (void*)&WB_GetMethodCompilationLevel},
2481+
{CC"getMethodEntryBci",
2482+
CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodEntryBci},
2483+
{CC"testSetForceInlineMethod",
2484+
CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod},
2485+
#elif HOTSPOT_TARGET_CLASSLIB == 17
24592486
{CC"testSetDontInlineMethod0",
24602487
CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetDontInlineMethod},
24612488
{CC"getMethodCompilationLevel0",
24622489
CC"(Ljava/lang/reflect/Executable;Z)I", (void*)&WB_GetMethodCompilationLevel},
24632490
{CC"getMethodEntryBci0",
24642491
CC"(Ljava/lang/reflect/Executable;)I", (void*)&WB_GetMethodEntryBci},
2465-
{CC"getCompileQueueSize",
2466-
CC"(I)I", (void*)&WB_GetCompileQueueSize},
24672492
{CC"testSetForceInlineMethod0",
24682493
CC"(Ljava/lang/reflect/Executable;Z)Z", (void*)&WB_TestSetForceInlineMethod},
2494+
#else
2495+
#error "Only classlib 8 and 17 are supported."
2496+
#endif
2497+
{CC"getCompileQueueSize",
2498+
CC"(I)I", (void*)&WB_GetCompileQueueSize},
24692499
{CC"enqueueMethodForCompilation0",
24702500
CC"(Ljava/lang/reflect/Executable;II)Z", (void*)&WB_EnqueueMethodForCompilation},
24712501
{CC"enqueueInitializerForCompilation0",
24722502
CC"(Ljava/lang/Class;I)Z", (void*)&WB_EnqueueInitializerForCompilation},
24732503
{CC"markMethodProfiled",
24742504
CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_MarkMethodProfiled},
2505+
#if HOTSPOT_TARGET_CLASSLIB == 8
2506+
{CC"clearMethodState",
2507+
CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState},
2508+
#elif HOTSPOT_TARGET_CLASSLIB == 17
24752509
{CC"clearMethodState0",
24762510
CC"(Ljava/lang/reflect/Executable;)V", (void*)&WB_ClearMethodState},
2511+
#else
2512+
#error "Only classlib 8 and 17 are supported."
2513+
#endif
24772514
{CC"lockCompilation", CC"()V", (void*)&WB_LockCompilation},
24782515
{CC"unlockCompilation", CC"()V", (void*)&WB_UnlockCompilation},
24792516
{CC"matchesMethod",
@@ -2526,7 +2563,13 @@ static JNINativeMethod methods[] = {
25262563
{CC"metaspaceCapacityUntilGC", CC"()J", (void*)&WB_MetaspaceCapacityUntilGC },
25272564
{CC"metaspaceSharedRegionAlignment", CC"()J", (void*)&WB_MetaspaceSharedRegionAlignment },
25282565
{CC"getCPUFeatures", CC"()Ljava/lang/String;", (void*)&WB_GetCPUFeatures },
2566+
#if HOTSPOT_TARGET_CLASSLIB == 8
2567+
{CC"getNMethod", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;",
2568+
#elif HOTSPOT_TARGET_CLASSLIB == 17
25292569
{CC"getNMethod0", CC"(Ljava/lang/reflect/Executable;Z)[Ljava/lang/Object;",
2570+
#else
2571+
#error "Only classlib 8 and 17 are supported."
2572+
#endif
25302573
(void*)&WB_GetNMethod },
25312574
{CC"forceNMethodSweep", CC"()V", (void*)&WB_ForceNMethodSweep },
25322575
{CC"allocateCodeBlob", CC"(II)J", (void*)&WB_AllocateCodeBlob },

0 commit comments

Comments
 (0)