C2 support for method invocations on value types

Zoltán Majó zoltan.majo at oracle.com
Fri Nov 4 15:38:39 UTC 2016


Hi Roland,


thank you for looking at the suggested change.

On 11/04/2016 04:13 PM, Roland Westrelin wrote:
> Hi Zoltan,
>
>> http://cr.openjdk.java.net/~zmajo/valhalla/00.invokedirect.webrev.00/
> Why is the change in Parse::create_entry_map() needed?

That change needed to avoid checking if the receiver is null with 
null_check_receiver_before_call()(we don't need to "fake" the null check 
if the callee method is inlined, I think; as value type fields are 
anyway used "directly").

But what I suggest is a bit too much: Theallocation of the oop for the 
valutype (as below) is not required, because only its fields are used 
anyway:

1117 if (kit.argument(0)->is_ValueType()) {
1118 ValueTypeNode* vt = kit.argument(0)->as_ValueType();
1119 vt->store_to_memory(&kit);
1120 } else {
1121       kit.null_check_receiver_before_call(method());
1122 }


So it's probably best to just skip it. Here is what I suggest to do in 
the updated webrev [1]:

1117 if (!kit.argument(0)->is_ValueType()) {
1118       kit.null_check_receiver_before_call(method());
1119 }
1120     _caller = kit.transfer_exceptions_into_jvms();

Does that make more sense to you?

Thank you and best regards,


Zoltan

[1] http://cr.openjdk.java.net/~zmajo/valhalla/00.invokedirect.webrev.01/


>
> Roland.



More information about the valhalla-dev mailing list