[PATCH] test/jdk/java/beans/PropertyEditor/Test6397609.java failed in JITed code
Fu Jie
fujie at loongson.cn
Wed Jan 2 07:01:09 UTC 2019
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");
---------------------------------
Would you please review it and tell me if it's OK to file on JBS and
post a webrev.
Thanks.
[1]
https://github.com/DamonFool/MyBlog/blob/master/JVM/editor-lost-in-jit.md
Best Regards,
Jie
More information about the jdk-dev
mailing list