B3 ref model

Dan Smith daniel.smith at oracle.com
Tue Apr 26 18:25:42 UTC 2022


On Apr 26, 2022, at 9:19 AM, forax at univ-mlv.fr<mailto:forax at univ-mlv.fr> wrote:

For me, L-type means: if you do not already know, you will discover later if it's a B1/B2/B3 when the class will be loaded.
The preload attribute means: if you do not already know, you should load the class now (at least when you want to take a decison based on the class being a B1/B2/B3 or not).

Yes, this is right.

Where you're going wrong (or at least in a different direction than the plan of record) is in the expectation that it should matter whether the class is a B2 or a B3. If you look at JEP 401, you'll see that 'ACC_PRIMITIVE' just means "I'm a value class that also supports Q types."

A L-type does not mean, it's a pointer and it's always be a pointer, because if a user has chosen a class to be a B3, the VM should do whatever is possible to flatten it, even if the declared type is a L-type.

L types for both B2 and B3 classes may be flattened; in both cases, there's a requirement that atomicity be preserved. In the plan of record model, this is not by fiat, but a consequence of the fact that an L type is a reference type, and reference types come with traditional expectations about integrity.



More information about the valhalla-spec-observers mailing list