Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC [v2]

2024-09-10 Thread Stuart Marks
On Tue, 10 Sep 2024 19:23:16 GMT, Brent Christian wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effect

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC [v2]

2024-09-10 Thread David Holmes
On Tue, 10 Sep 2024 19:23:16 GMT, Brent Christian wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effect

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-10 Thread Brent Christian
On Sat, 7 Sep 2024 00:59:25 GMT, Stuart Marks wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effectivel

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC [v2]

2024-09-10 Thread Brent Christian
On Tue, 10 Sep 2024 19:23:16 GMT, Brent Christian wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effect

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC [v2]

2024-09-10 Thread Brent Christian
> From the bug description: > ForceGC would be improved by moving the Reference.reachabilityFence() calls > for 'obj' and 'ref'. > > Reference.reachabilityFence(obj) is currently placed after 'obj' has been set > to null, so effectively does nothing. It should occur before obj = null; > > For R

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-10 Thread David Holmes
On Fri, 6 Sep 2024 19:57:41 GMT, Brent Christian wrote: > From the bug description: > ForceGC would be improved by moving the Reference.reachabilityFence() calls > for 'obj' and 'ref'. > > Reference.reachabilityFence(obj) is currently placed after 'obj' has been set > to null, so effectively d

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Kim Barrett
On Mon, 9 Sep 2024 16:25:15 GMT, Stuart Marks wrote: >> @dholmes-ora Is this really possible? The `obj` ref is passed to the >> PhantomReference constructor, which stores it in a field, the constructed >> PhantomReference is returned, and it's then used in a reachabilityFence call >> below. So

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Kim Barrett
On Fri, 6 Sep 2024 19:57:41 GMT, Brent Christian wrote: > From the bug description: > ForceGC would be improved by moving the Reference.reachabilityFence() calls > for 'obj' and 'ref'. > > Reference.reachabilityFence(obj) is currently placed after 'obj' has been set > to null, so effectively d

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Kim Barrett
On Mon, 9 Sep 2024 14:40:12 GMT, Daniel Fuchs wrote: >> test/lib/jdk/test/lib/util/ForceGC.java line 102: >> >>> 100: } >>> 101: } >>> 102: Reference.reachabilityFence(ref); >> >> I think everything from the creation of ref to the line above needs to >> enclosed in

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread David Holmes
On Mon, 9 Sep 2024 16:25:15 GMT, Stuart Marks wrote: >> @dholmes-ora Is this really possible? The `obj` ref is passed to the >> PhantomReference constructor, which stores it in a field, the constructed >> PhantomReference is returned, and it's then used in a reachabilityFence call >> below. So

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Stuart Marks
On Mon, 9 Sep 2024 16:12:02 GMT, Stuart Marks wrote: >> The reason for the explicit reference and RF, as I recall, is to guard >> against the allocation of the new object being elided entirely, with the >> `PhantomReference` constructor being passed null (or itself being elided) >> and no refe

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Stuart Marks
On Mon, 9 Sep 2024 05:01:26 GMT, David Holmes wrote: >> test/lib/jdk/test/lib/util/ForceGC.java line 82: >> >>> 80: PhantomReference ref = new PhantomReference<>(obj, >>> queue); >>> 81: Reference.reachabilityFence(obj); >>> 82: obj = null; >> >> You're right to questio

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Daniel Fuchs
On Sat, 7 Sep 2024 00:40:24 GMT, Stuart Marks wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effectivel

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-09 Thread Daniel Fuchs
On Mon, 9 Sep 2024 05:01:26 GMT, David Holmes wrote: >> test/lib/jdk/test/lib/util/ForceGC.java line 82: >> >>> 80: PhantomReference ref = new PhantomReference<>(obj, >>> queue); >>> 81: Reference.reachabilityFence(obj); >>> 82: obj = null; >> >> You're right to questio

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-08 Thread David Holmes
On Sat, 7 Sep 2024 00:39:16 GMT, Stuart Marks wrote: >> From the bug description: >> ForceGC would be improved by moving the Reference.reachabilityFence() calls >> for 'obj' and 'ref'. >> >> Reference.reachabilityFence(obj) is currently placed after 'obj' has been >> set to null, so effectivel

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-06 Thread Stuart Marks
On Fri, 6 Sep 2024 19:57:41 GMT, Brent Christian wrote: > From the bug description: > ForceGC would be improved by moving the Reference.reachabilityFence() calls > for 'obj' and 'ref'. > > Reference.reachabilityFence(obj) is currently placed after 'obj' has been set > to null, so effectively d

Re: RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-06 Thread Stuart Marks
On Fri, 6 Sep 2024 19:57:41 GMT, Brent Christian wrote: > From the bug description: > ForceGC would be improved by moving the Reference.reachabilityFence() calls > for 'obj' and 'ref'. > > Reference.reachabilityFence(obj) is currently placed after 'obj' has been set > to null, so effectively d

RFR: 8339687: Rearrange reachabilityFence()s in jdk.test.lib.util.ForceGC

2024-09-06 Thread Brent Christian
>From the bug description: ForceGC would be improved by moving the Reference.reachabilityFence() calls for 'obj' and 'ref'. Reference.reachabilityFence(obj) is currently placed after 'obj' has been set to null, so effectively does nothing. It should occur before obj = null; For Reference.reacha