[lworld] RFR: 8352647: [lworld] Remove larval InlineTypeNode in Unsafe intrinsics
Quan Anh Mai
qamai at openjdk.org
Sun Mar 30 03:01:14 UTC 2025
On Sat, 29 Mar 2025 22:41:26 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> Yes, I agree, this should be seen on the lines of a primitive (value) meeting an identity object (boxes),
I think you are misunderstanding, the type `reference` here refers to a verification type that represents the most general reference type, it is even higher than `java.lang.Object`. From the JVMS:
Verification type hierarchy:
top
____________/____________
/ \
/ \
oneWord twoWord
/ | \ / \
/ | \ / \
int float reference long double <--- meeting of a larval value and a non-larval value results in the `reference` type here
/ \
/ _____________
/ \
/ \
uninitialized +------------------+ <--- larval objects have their verification type being `uninitialized`
/ \ | Java reference | <--- `java.lang.Object` and its subclasses are here
/ \ | type hierarchy |
uninitializedThis uninitialized(Offset) +------------------+
|
|
null
> Thus, here at merge point, MyValue should be buffered, since this is MEETing a larval value so new oop (Phi) should be larval, similar to following
Note that this implicit boxing and unboxing only happens at the language level, `javac` will automatically translate `ret = genInt(val)` into `ret = Integer.valueOf(genInt(val))`. So, at the VM level, we do not ever encounter a meet of a `java.lang.Integer` and an `int`. As a result, C2 does not have to take auto boxing and unboxing into consideration.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1406#issuecomment-2764355420
More information about the valhalla-dev
mailing list