JVM implementation of null-restricted value class types for cast and array
Remi Forax
forax at univ-mlv.fr
Mon Oct 30 09:25:18 UTC 2023
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.
Just to be clear, the design is fine because obviously class file are versioned but I do not see the point of introducing such radical change now 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.
With my ASM hat, given that we can use invokedynamic to represent checkcast and anewarray in a fully backward compatible way (in term of produced bytecode),
I would prefer null-restricted value types opcodes to use indy until we are sure of how to represent specialized opcodes as part of the design of the parametrized VM.
For bytecode libraries, I would mean only one API change instead of two.
regards,
Rémi
More information about the valhalla-spec-experts
mailing list