RFR (S): JDK-8051045: HotSpot fails to wrap Exceptions from invokedynamic in a BootstrapMethodError
Andreas Eriksson
andreas.eriksson at oracle.com
Wed Apr 29 11:36:50 UTC 2015
Hi,
Please review this change to resolve_invokedynamic.
In linkResolver.cpp LinkResolver::resolve_invokedynamic could miss
wrapping some exceptions in BootstrapMethodError.
According to the JVM specification [1] invokedynamic should wrap any
exceptions that occur during resolution in a BootstrapMethodError.
As part of other changes, exception CHECK macros where used, which do
not wrap the exception as needed.
This fix moves the exception wrapping logic to a separate function,
wrap_invokedynamic_exception.
It then changes the functions that can throw exceptions to not use the
CHECK macro.
Instead the exception wrapping function is called immediately after
functions that can throw.
Included in the change is a test that tries to access a private method
with invokedynamic.
The test expects a BootstrapMethodError, but without the fix it gets an
IllegalAccessError and the test fails.
Webrev: http://cr.openjdk.java.net/~aeriksso/8051045/webrev.00/
Thanks,
Andreas
[1]
http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5.invokedynamic
More information about the hotspot-runtime-dev
mailing list