[lworld] Handling of missing ValueTypes attributes

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jul 10 12:22:48 UTC 2018


Hi John,

On 10.07.2018 02:08, John Rose wrote:
> On Jul 9, 2018, at 3:44 PM, Ioi Lam <ioi.lam at oracle.com> wrote:
>> In that case, I think the program's output should be the same as if the ValueTypes attribute had been present, although performance may differ (slower, more heap allocations, etc).
>>
>> Is this understanding correct?
> 
> Yes, that is correct.  This model is intended to make it easier for old-school classfiles
> to link to old types which have (over time) been upgraded to value types.

How do we then handle the following scenario?

We have a method m1(MyValue vt) in a class that has no value types attribute set although MyValue is
a value type. Once the calling convention for that method is determined (i.e. at adapter creation),
we therefore don't know that MyValue is a value type and as a result, m1 will expect vt to be passed
as oop.

Now another compiled method m2 that calls compiled m1 might be well aware that vt is a value type
but has no way to know that m1 does *not* expect vt to be passed as fields (especially if the call
is virtual).

Thanks,
Tobias



More information about the valhalla-dev mailing list