RFR 8174954: Parameter target type can yield successful access after a module read edge or a package export has occurred after failed resolution
harold seigel
harold.seigel at oracle.com
Thu Jun 8 13:33:50 UTC 2017
Hi,
Please review this JDK-10 fix for JDK-8174954. For invokedynamic, the
JVM currently does not conform to the following module related upcoming
JVM Spec change to 5.4.3 Resolution:
This means that a class in one module that attempts to access, via
resolution of a symbolic reference in its run-time constant pool, an
unexported public type in a different module will always receive the
same error indicating an inaccessible type (§5.4.4), even if the
Java SE Platform API is used to dynamically export the public type's
package at some time after the class's first attempt.
This RFR fixes this issue by caching the LinkageError exception from the
initial resolution failure. Subsequent resolution attempts will then
just throw the cached exception instead of actually re-doing the
resolution, and so will get the same failure even if the module graph
has been changed.
Note that this fix also fixes JDK-8174942
<https://bugs.openjdk.java.net/browse/JDK-8174942>.
Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8174954/webrev/
JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8174954
The fix was tested with JCK Lang, VM, and API/java_lang tests, the JTreg
hotspot, java/io, java/lang, java/util and other tests, the co-located
NSK tests, RBT tests, and with JPRT. The new tests (based on Lois's
test cases) were run with and without -Xcomp.
Thanks, Harold
More information about the hotspot-runtime-dev
mailing list