JDK-8230501: Class data support for hidden classes

John Rose john.r.rose at oracle.com
Fri Nov 13 22:46:24 UTC 2020

On Nov 13, 2020, at 2:02 PM, forax at univ-mlv.fr wrote:
> I want it, null is easy to check in term of bytecode and is aggressively propagated by c1 and c2 so you can write the equivalent IFDEF at runtine by putting nulls in the right holes.
> It's also pretty useful when you have object that have a double representation, i.e. a value that can be a primitive value or a box, again testing if the box is null is a common operation.

Null as a static constant can be created easily by other means,
so in most use cases, there’s no need to plumb a null through
a ClassData.  Just use aconst_null or ili.CBs::nullConstant.

Maybe what you are hoping for is statically generated bytecodes
which are invariant across nullable “holes”, where the holes
are filled by a ClassData.  Fine, in that case use a nullable
container, such as Stuart Marks’ Stream::asList.

— John

More information about the valhalla-dev mailing list