[lworld] Handling of missing ValueTypes attributes (original) (raw)
Tobias Hartmann tobias.hartmann at oracle.com
Tue Jul 10 12:22:48 UTC 2018
- Previous message (by thread): [lworld] Handling of missing ValueTypes attributes
- Next message (by thread): [lworld] Handling of missing ValueTypes attributes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): [lworld] Handling of missing ValueTypes attributes
- Next message (by thread): [lworld] Handling of missing ValueTypes attributes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]