Valhalla EG notes Jan 16, 2019

Remi Forax forax at
Wed Jan 30 15:05:51 UTC 2019

> De: "John Rose" <john.r.rose at>
> À: "Brian Goetz" <brian.goetz at>
> Cc: "valhalla-spec-experts" <valhalla-spec-experts at>
> Envoyé: Mercredi 30 Janvier 2019 01:20:50
> Objet: Re: Valhalla EG notes Jan 16, 2019

> On Jan 29, 2019, at 12:27 PM, Brian Goetz < [ mailto:brian.goetz at |
> brian.goetz at ] > wrote:

>> But, now we a problem: we have existing code that erases arrays to `Object[]`,
>> but after the flag day, such code will erase to Array instead.

> Maybe, another way to address this, besides bridging distinct
> descriptors, is to declare that the old descriptors describe
> the new types.

> After all, the old descriptors will be dead (to Java) after the
> translation strategy stops using them. Make all descriptors
> of the form `[T` erase to `Array` or some subtype.

> This isa lossy translation, which means the interpreter will have
> to do extra runtime type checks on xaload/xastore instructions.
> The JIT probably won't care. The scheme might shipwreck
> on reflection, since we need to distinguish all the array classes
> reflectively, but maybe that's where Crasses (runtime class
> mirrors) come in handy, to make that distinction. Put another
> way, int[] and String[] and Object[] are mirrored by Crasses,
> not proper classes.

String[].class == Array.class.getSpecialization(String.class) 

Note that even if String is a reference type, here we still want the specialization, unlike for generics, so an Array is a special kind of generics that requires full reification. 

> Maybe there's a solution along this path. Or maybe the floor
> gives way at some point and you are plunged into the basement
> where the monsters are.

the risk is more a Franckenstein's monster than Cthulhu IMO 

> — John


More information about the valhalla-spec-observers mailing list