[PATCH] test/jdk/java/beans/PropertyEditor/Test6397609.java failed in JITed code
Alan Bateman
Alan.Bateman at oracle.com
Wed Jan 2 10:46:24 UTC 2019
On 02/01/2019 07:01, Fu Jie wrote:
> Hi all,
>
> test/jdk/java/beans/PropertyEditor/Test6397609.java failed in JITed
> code of Test6397609::main.
>
> The failure was caused by the lost of the OopMap item for the object
> loader which was optimized out by the JIT with the liveness analysis
> optimization.
> For more details, see [1].
>
> It seems that Test6397609.java is only suitable for testing
> interpreters which is not adapted to JITs at all.
> Different behaviors performed by the interpreter and JITs with the
> same test case really confused people a lot.
> And I think it's worth making the test also suitable for JITs.
>
> A tiny change can fix this issue
> ---------------------------------
> diff -r b99b41325d89 test/jdk/java/beans/PropertyEditor/Test6397609.java
> --- a/test/jdk/java/beans/PropertyEditor/Test6397609.java Tue Jan 01
> 20:09:02 2019 -0500
> +++ b/test/jdk/java/beans/PropertyEditor/Test6397609.java Wed Jan 02
> 12:01:21 2019 +0800
> @@ -44,6 +44,7 @@
> if (!isEditorExist(Object.class)) {
> throw new Error("the editor is lost");
> }
> + loader.hashCode(); // prevent being optimized out by JIT
> loader = null; // clean the reference
> if (isEditorExist(Object.class)) {
> throw new Error("unexpected editor is found");
The beans-dev list is probably the right place to discuss this change.
Also you might want to consider using Reference.reachabilityFence to
keep loader from being GC'ed.
-Alan
More information about the jdk-dev
mailing list