RFR: 8256999: Add C2 intrinsic for Reference.refersTo and PhantomReference::refersTo
Erik Österlund
eosterlund at openjdk.java.net
Wed Nov 25 18:36:54 UTC 2020
On Wed, 25 Nov 2020 18:07:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> I don't think we have any !in_heap && on_weak loads today. But if we did, they would indeed need read barriers.
>> We need read barrier if the the reference isn't provably strong... unless it's an AS_NO_KEEPALIVE access. That also reflects why the variable is called no_keepalive instead of keepalive; it is to reflect the shared decorator name used all over the place. I don't mind inverting it though, but personally found it easier to read when the names match our decorators.
>
> From this conversation the only change I can do is 'Turn (on_weak || on_phantom) into !on_strong'.
> @fisk Is this correct? I am concern that it will include `unknown` decorator too.
> I agree with Erik to keep !no_keepalive because he prefer it and this is code supported by GC group.
Well if on_weak || on_phantom then it is provably a weak access. But I think the absence of the strong decorator does not prove it is weak, as it could have an unknown strength (via unsafe), in which case we need some extra logic to see if we can prove that an unknown strength access can't be weak.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1425
More information about the core-libs-dev
mailing list