RFR(S): 8223965: [lworld] Reflective method invocation does not handle value type returned as fields

Tobias Hartmann tobias.hartmann at oracle.com
Fri May 17 12:53:29 UTC 2019


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8223965
http://cr.openjdk.java.net/~thartmann/8223965/webrev.00/

If a method is invoked via reflection we first call through the runtime [1] and once the method is
invoked more than 'sun.reflect.inflationThreshold' times we emit bytecodes to directly call the
method. Now while the generated bytecodes are fine because they are executed through the interpreter
(or the JIT), the call stub does not correctly handle (c2 compiled) methods that return a value type
as fields.

I added the corresponding check and also had to use different registers in the call stub to avoid
trashing those used by the return convention.

Thanks,
Tobias

[1] Reflection::invoke_method() -> ... -> StubRoutines::call_stub()


More information about the valhalla-dev mailing list