call to __Value methods can't pass fields as arguments

Frederic Parain frederic.parain at oracle.com
Fri Mar 24 15:01:36 UTC 2017


Hi Roland,

Thank you for finding this issue with the __Value methods,

I’m concerned with changes in sharedRuntime.cpp:2607:

2605           ValueKlass* vk = ValueKlass::cast(holder);

2606           if (vk == SystemDictionary::___Value_klass()) {
2607             sig_extended.push(SigEntry(T_OBJECT));
2608           } else {

2609             const GrowableArray<SigEntry>& sig_vk = collect_fields(vk);
2610             sig_extended.appendAll(&sig_vk);

2611           }

Is it trying passing a reference to a standalone value by pretending that it is
an Object?

Fred


> On Mar 21, 2017, at 05:55, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:
> 
> Hi Roland,
> 
> On 16.03.2017 14:11, Roland Westrelin wrote:
>> http://cr.openjdk.java.net/~roland/valhalla/__valuemethods/webrev.00/
> 
> This looks good to me!
> 
> Best regards,
> Tobias
> 
>> When calling a method that's defined only by __Value (toString etc.),
>> we can't pass fields, we have to pass a reference (the callee is generic
>> so has no way to know what fields to expect).
>> 
>> There's a little tweak to some runtime code so someone from runtime
>> should probably take a look.
>> 
>> Roland.
>> 



More information about the valhalla-dev mailing list