JDK-8294976 : test/hotspot 183 test classes use ASM
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: test
  • Priority: P5
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2022-10-07
  • Updated: 2024-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Test Classes that use the ASM Library:

--> Test Group 1: "Converted"
test/hotspot/jtreg/vmTestbase/vm/mlvm/patches/java.base/jdk/internal/org/objectweb/asm/ClassWriterExt.java
- This class has a helper method that calculates the length of code Attributes inside the methods.

--> Test Group 2: "Disabled"
test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java
- This test was annotated @ignore as the bug for which this test is being ignored is probably not fixed yet.

--> Test Group 3: "Converted and Tested"
test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/func/regression/b7127687/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/meth/func/regression/b7127687/Test.java

--> Test Group 4: "Disabled Tests"
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mt/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/manyIndyOneCPX/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/incorrectBootstrap/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java
-Those test descriptions are disabled due to bugs to fixed yet.

--> Test Group 5: "Converted & Ghost tests need to be reviewed" - "Pending Review by [~lmesnik] "
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/HandleType.java (Deleted due to Conversion & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyIncorrectBootstrap.java (Converted & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyCorrectBootstrap.java (Converted & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMT.java (Converted & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyOneCPX.java (Converted & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenFullCP.java (Converted & Ghost Code)
test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMH.java (Converted & Ghost Code)
- This code was converted but not tested since it was never been used somewhere.

--> Test Group 6 Contains test cases related to the default methods.
: https://bugs.openjdk.org/browse/JDK-8328260
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/DefaultVsAbstractTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/SuperCallTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/AccessibilityFlagsTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/PrivateMethodsTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/StressTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/RedefineTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/ConflictingDefaultsTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/ObjectMethodOverridesTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/MethodResolutionTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/StaticMethodsTest.java

test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/Util.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/DefMethTest.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/ClassFileGenerator.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/Printer.java

test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/executor/ReflectionTest.java

test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/data/ConcreteClass.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/data/method/ConcreteMethod.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/data/method/AbstractMethod.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/data/method/body/CallMethod.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/data/method/DefaultMethod.java

test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/MethodBuilder.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/TestBuilder.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/AccessFlag.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/ClassBuilder.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/TesterBuilder.java
test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/shared/builder/ConcreteClassBuilder.java

-> Test Group 7: 
test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/TestDescription.java
test/hotspot/jtreg/vmTestbase/vm/compiler/coverage/parentheses/share/HotspotInstructionsExecutor.java
test/hotspot/jtreg/vmTestbase/vm/share/transform/AnnotationAppender.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_keep_class/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_inMemoryCompilation_keep_class/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_inMemoryCompilation_keep_cl/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_keep_obj/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_inMemoryCompilation_keep_obj/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/tests/unloading_keepRef_rootClass_keep_cl/TestDescription.java
test/hotspot/jtreg/vmTestbase/gc/g1/unloading/GenClassPoolJar.java
test/hotspot/jtreg/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java
test/hotspot/jtreg/runtime/lambda-features/TestStaticandInstance.java
test/hotspot/jtreg/runtime/ParallelLoad/AsmClasses.java
test/hotspot/jtreg/runtime/ParallelLoad/ParallelSuperTest.java
test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java
test/hotspot/jtreg/runtime/exceptionMsgs/NullPointerException/NullPointerExceptionTest.java
test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IllegalAccessErrorTest.java
test/hotspot/jtreg/runtime/HiddenClasses/HiddenDefMeths.java
test/hotspot/jtreg/runtime/MirrorFrame/Test8003720.java
test/hotspot/jtreg/runtime/MirrorFrame/Asmator.java
test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java
test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java
test/hotspot/jtreg/runtime/InvocationTests/invokeinterface/ClassGenerator.java
test/hotspot/jtreg/runtime/InvocationTests/invokeinterface/Generator.java
test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java
test/hotspot/jtreg/runtime/InvocationTests/invokevirtual/ClassGenerator.java
test/hotspot/jtreg/runtime/InvocationTests/invokevirtual/Generator.java
test/hotspot/jtreg/runtime/InvocationTests/invokespecial/ClassGenerator.java
test/hotspot/jtreg/runtime/InvocationTests/invokespecial/Generator.java
test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java
test/hotspot/jtreg/runtime/InvocationTests/shared/ExecutorGenerator.java
test/hotspot/jtreg/runtime/InvocationTests/shared/GenericClassGenerator.java
test/hotspot/jtreg/runtime/InvocationTests/shared/AccessCheck.java
test/hotspot/jtreg/runtime/InvocationTests/shared/AccessType.java
test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java
test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java
test/hotspot/jtreg/runtime/cds/appcds/VerifierTest_1B.java
test/hotspot/jtreg/runtime/cds/appcds/VerifierTest_2.java
test/hotspot/jtreg/runtime/cds/appcds/OldClassTest.java
test/hotspot/jtreg/runtime/cds/appcds/VerifierTest.java
test/hotspot/jtreg/runtime/cds/appcds/VerifierTest_0.java
test/hotspot/jtreg/runtime/cds/appcds/VerifierTest_1A.java

-> Test Group 8: Runtime -- see https://bugs.openjdk.org/browse/JDK-8328111, which takes care of the following group of tests

test/hotspot/jtreg/runtime/finalStatic/FinalStatic.java
test/hotspot/jtreg/runtime/verifier/OverriderMsg.java
test/hotspot/jtreg/runtime/verifier/TestANewArray.java
test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java
test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java
test/hotspot/jtreg/runtime/ConstantPool/IntfMethod.java
test/hotspot/jtreg/runtime/invokedynamic/BootstrapMethodErrorTest.java
test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java

Test Group 9: Serviceability

test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineRunningMethodsWithResolutionErrors.java
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineGenericSignatureTest.java
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineObject.java
test/hotspot/jtreg/serviceability/jvmti/RedefineClasses/RedefineAnnotations.java
test/hotspot/jtreg/serviceability/jvmti/SetBreakpoint/TestManyBreakpoints.java

Test Group 10: Compiler

test/hotspot/jtreg/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java
test/hotspot/jtreg/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java
test/hotspot/jtreg/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java
test/hotspot/jtreg/compiler/calls/common/InvokeDynamicPatcher.java
test/hotspot/jtreg/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java
test/hotspot/jtreg/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java
test/hotspot/jtreg/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java
test/hotspot/jtreg/compiler/cha/StrengthReduceInterfaceCall.java
test/hotspot/jtreg/compiler/cha/Utils.java
test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java
test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java

--> not triaged yet
test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeVirtualICCE.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Method.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassConstruct.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Interface.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/TestBuilder.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Clazz.java
test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/ClassBuilder.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeSpecialSuccessTest.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeVirtualSuccessTest.java
test/hotspot/jtreg/runtime/SelectionResolution/IllegalAccessErrorTest.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeStaticSuccessTest.java
test/hotspot/jtreg/runtime/SelectionResolution/AbstractMethodErrorTest.java
test/hotspot/jtreg/runtime/SelectionResolution/NoSuchMethodErrorTest.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeSpecialICCE.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceICCE.java
test/hotspot/jtreg/runtime/SelectionResolution/InvokeStaticICCE.java
test/hotspot/jtreg/runtime/AccModule/ConstModule.java
test/hotspot/jtreg/runtime/AccModule/ACCModule52.java
test/hotspot/jtreg/runtime/TransitiveOverrideCFV50/TransitiveOverrideCFV50.java
test/hotspot/jtreg/gc/epsilon/TestClasses.java
test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java

test/hotspot/jtreg/compiler/types/TestMeetIncompatibleInterfaceArrays.java
test/hotspot/jtreg/compiler/jsr292/NonInlinedCall/RedefineTest.java
test/hotspot/jtreg/compiler/jsr292/CallSiteDepContextTest.java
test/hotspot/jtreg/compiler/jsr292/RedefineMethodUsedByMultipleMethodHandles.java
test/hotspot/jtreg/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java
test/hotspot/jtreg/compiler/c1/Test6932496.java
test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java
test/hotspot/jtreg/compiler/runtime/TestConstantDynamic.java
test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java
test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java
test/hotspot/jtreg/compiler/osr/TestOSRWithNonEmptyStack.java
test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java
test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java
test/hotspot/jtreg/compiler/jvmci/common/CTVMUtilities.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/IsCompilableTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ReprofileTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetSymbolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolveMethodTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetExceptionTableTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetBytecodeTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetConstantPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/IterateFramesNative.java
test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java
test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java
test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.java
test/hotspot/jtreg/serviceability/dcmd/compiler/CompilerQueueTest.java


Comments
Correct, frozen ASM will lost ability to parse future class versions.
21-08-2024

> Only conservative tests using ASM to generate classes can remain once we decide to stop updating ASM and move it from java.base to test libs. Any test requiring to parse or transform actual version of a class files must be converted to ClassFile API at that time. Am I correct to assume that’s because non-”conservative” tests will need to parse class files that are newer than the version supported by the frozen version of ASM?
20-08-2024

Only conservative tests using ASM to generate classes can remain once we decide to stop updating ASM and move it from java.base to test libs. Any test requiring to parse or transform actual version of a class files must be converted to ClassFile API at that time. It might be good to focus on the class parsing tests in this bug.
20-08-2024

I agree that new tests should use the ClassFile API, once that API is finalized.
19-08-2024

I think we might still keep a copy of ASM in our tests: ClassFile API's own benchmarks are using ASM too. That said, we still wish to see newer tests being developed in ClassFile API, once it is finalized. ASM is good as long as you don't __read__ class files.
19-08-2024

Do we really need to do this? Changing old tests to use the new API risks making those tests invalid. Wouldn’t it be safer, and less work, to put a frozen copy of the current ASM library into our test library, as [~dholmes] suggested earlier, and be done?
19-08-2024

ClassFile API primary purpose is to serve for the JDK use cases and to reduce the number of maintained external libraries for bytecode manipulation within the JDK. It is a "chicken-egg" problem to finalize a library before it is applied, and to apply the library before it is finalized. As all these converted tests are under JDK repository together with the ClassFile API, it is easy to detect compilation failures and fix them if anything changes in the ClassFile API. I agree making this change as a bulk in one commit would be very complicated. The work will split into chunks (with individual clones of this bug and PRs). It is easier to have one active bug and PR at a time and clone/split for the continuation at the very last moment.
18-03-2024

I think this is premature while the ClassFile API is still in preview and also too disruptive as a bulk change.
13-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17834 Date: 2024-02-13 16:24:15 +0000
29-02-2024

Can't we just freeze the ASM version that is needed by the existing tests so there is no (or very little) maintenance involved? Perhaps even move ASM into the test library if we really want it out of the JDK.
28-02-2024

Update of archaic tests is work that must be done at some point if we want to remove JDK dependency on ASM. From the economical perspective the sooner the better. Alternative solutions are to remove the archaic tests or update and maintain ASM library dependency forever.
27-02-2024

Is there a reason we actually need to migrate away from using ASM? Updating a lot of tests, many of which are archaic to begin with, does not seem like a good use of resources. This may also introduce backporting issues, both in terms of modifying existing tests and also if we write new tests using the Classfile API going forward, then we will need to write a different version of the test for backports.
27-02-2024