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


please review the following patch:

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.


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

More information about the valhalla-dev mailing list