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

Tobias Hartmann tobias.hartmann at oracle.com
Mon May 20 11:29:02 UTC 2019


Thanks Ioi!

Best regards,
Tobias

On 17.05.19 19:16, Ioi Lam wrote:
> Hi Tobias,
> 
> The changes look good to me.
> 
> Thanks
> - Ioi
> 
> On 5/17/19 5:53 AM, Tobias Hartmann wrote:
>> 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