null checks vs. class resolution, and translation strategy for casts

forax at univ-mlv.fr forax at univ-mlv.fr
Tue Apr 14 14:08:34 UTC 2020


> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Frederic Parain" <frederic.parain at oracle.com>, "valhalla-spec-experts"
> <valhalla-spec-experts at openjdk.java.net>
> Envoyé: Mardi 14 Avril 2020 15:56:06
> Objet: Re: null checks vs. class resolution, and translation strategy for casts

>> How it is better than a new opcode "unbox" with exactly the same semantics ?

> For one, an “unbox” opcode assumes that the VM understands the fictitious
> relationship between the val and ref projections. But these are language
> fictions; the VM sees only classes related by extension and sealing.

No, 
your assuming that the semantics of unbox implies that the verifier will check for 'sealness', this is not the case, unbox <==> checkcast restricted to inline type (so with eager loading). 

You're free to unbox an Object to a Point, by example. 

Rémi 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/valhalla-spec-experts/attachments/20200414/1df77725/attachment.htm>


More information about the valhalla-spec-experts mailing list