JVM implementation of null-restricted value class types for cast and array

Dan Smith daniel.smith at oracle.com
Mon Oct 30 17:29:42 UTC 2023


> On Oct 30, 2023, at 2:25 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> Hello,
> in https://bugs.openjdk.org/browse/JDK-8317766,
> cast and array creation are specified using the usual opcodes checkcast and anewarray but with the constant pool constant is a condy.
> 
> While I like the fact that those opcodes directly use a condy unlike in the parametrized VM proposal where there are intermediary constant pool constants,
> I think this is too early to introduce suck non backward compatible design.

Possibly you're misunderstanding here: the idea would be for checkcast and anewarray to support *both* a CONSTANT_Class and a CONSTANT_Dynamic (of the appropriate shape). Fully backward compatible.

> given that we will need something like that for the parametrized VM anyway. So I would prefer to introduce this kind of constant pool description all at once instead of saying, it currently only work with CheckedType and we will extend this design later.

CheckedType is the mechanism that we envision for expressing, e.g., a cast to a species type. Agree we should not introduce one thing now, something different later—avoiding that is one of our goals.



More information about the valhalla-spec-experts mailing list