For many HotSpot features, such as CDS, we need to test interaction with ClassFileLoadeHook (e.g. JDK-8141341).
Writing a ClassFileLoadHook is complicated (native library is needed). To simplify test development, we should provide a simple way to use ClassFileLoadHook without having to write native code.
The proposal is to add a generic native test library SimpleClassFileLoadHook. A test case can use this library like this:
/*
* @test
* @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
* SimpleClassFileLoadHookTest
*/
This will replace all occurrences of "XXX" to "YYY" in the classfile of the Foo class. While this is a very simple transformation, it should be enough for test cases that just need to "do some simple stuff" with ClassFileLoadHook.
Writing a ClassFileLoadHook is complicated (native library is needed). To simplify test development, we should provide a simple way to use ClassFileLoadHook without having to write native code.
The proposal is to add a generic native test library SimpleClassFileLoadHook. A test case can use this library like this:
/*
* @test
* @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
* SimpleClassFileLoadHookTest
*/
This will replace all occurrences of "XXX" to "YYY" in the classfile of the Foo class. While this is a very simple transformation, it should be enough for test cases that just need to "do some simple stuff" with ClassFileLoadHook.
- relates to
-
JDK-8141341 CDS should be disabled if JvmtiExport::should_post_class_file_load_hook() is true
-
- Closed
-