Then it’s a terrible and confusing name for an opcode :)
> On Apr 14, 2020, at 10:08 AM, fo...@univ-mlv.fr wrote: > > > > De: "Brian Goetz" <brian.go...@oracle.com> > À: "Remi Forax" <fo...@univ-mlv.fr> > Cc: "Frederic Parain" <frederic.par...@oracle.com>, "valhalla-spec-experts" > <valhalla-spec-experts@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 >