RFR(M) : 8134102 : [TESTBUG] compiler/unsafe/UnsafeGetConstantField.java test fails in Jake

Igor Ignatyev igor.ignatyev at oracle.com
Fri Jan 29 01:49:28 UTC 2016

> 134 lines changed: 84 ins; 15 del; 35 mod;
Hi all,

could you please review the patch for compiler/unsafe/UnsafeGetConstantField.java test?

the test fails in jake, because the test class is in java.lang.invoke package, which is already defined in java.base module. Instead of using “patch” mechanism, which allows to add classes into existing modules, I decided to remove direct usage of package-private members from j.l.i:
 - @DontInline was changed by a corresponding -XX:CompileCommand
 - direct usage of Stable.class replaced w/ Class.forName
 - UnsafeGetConstantField is moved from java.lang.invoke package to compile.unsafe, thus all the nested classes used from generated tests are made public

Besides changes for jake, I also slightly modified the test (originally to be sure that the test still checks that it supposed to):
 - for getObject* tests, String constant is used as the field value instead of 'new Object()'
 - add checks that Test::testDirect/testUnsafe return prev. value even after field's value was changed. this check fails for Unsafe::getCharUnaligned if JVM is started w/ -XX:-UseUnalignedAccesses. I’ve filed a bug for that (JDK-8148518) and temporary disabled the check which fails
 - in case of failure, the generated class is dumped into workdir

testing: run the test against 2016-01-26 jake nightly build

JDK-8134102 : http://bugs.openjdk.java.net/browse/JDK-8134102
JDK-8148518 : http://bugs.openjdk.java.net/browse/JDK-8148518

PS the patch will be integrated thru jigsaw/jake repo

— Igor

More information about the hotspot-compiler-dev mailing list