[External] : Re: consolidated VM notes for primitive classes

John Rose john.r.rose at oracle.com
Wed Apr 28 01:17:03 UTC 2021


On Apr 27, 2021, at 7:27 AM, Peter Levart <peter.levart at gmail.com<mailto:peter.levart at gmail.com>> wrote:

If this did see an implementation in the VM, we would essentially get muti-referent Ephemeron(s) out of it. Not very easy to implement though.


Sorry, this is not correct. The rules for Ephemeron(s) are different. If primitive object became unreachable when all of its component identity object references became unreachable, then we would get Ephemeron. The rules in the document (at least one) are easier to implement.

Yep.  Brian and Jim Laskey have a POC that works.
Also (as the GC folks observe) this is similar to the
rule we use in HotSpot for liveness of “n-methods”
(compiled code blobs).  As soon as one weak ref in
a code blob goes dead, the whole thing can be
recycled.

The difference here is between “and” and “or”
connectives.  In one case, a weak ref is queued
when *any* of its sub-references is queueable,
while in the other (ephemeron) case, we wait
until *all* are queueable.

— John


More information about the valhalla-spec-observers mailing list