RFR: 8217389: JTREG: Clean up, remove unused variable warnings
leo.korinth at oracle.com
Tue Jan 22 13:01:27 UTC 2019
On 22/01/2019 12:02, Thomas Schatzl wrote:
> On Mon, 2019-01-21 at 12:30 +0100, Leo Korinth wrote:
>> I have a new update that uses Reference.reachabilityFence to make
>> sure that allocations are not optimized away. After a bit of thinking
>> and asking around, I believe reachabilityFence to be a better
>> solution than a public static variable in these cases where we want
>> to make sure allocation is not optimized away but do not want the
>> object to be reachable. It also makes it a bit more obvious that the
>> code is used to allocate garbage and not to be optimized away rather
>> than being a programming mistake.
>> I also added spaces to the "XXX*M" pattern.
>> Webrev (Full): http://cr.openjdk.java.net/~lkorinth/8217389/01
>> Webrev (Incremental):
>> Testing: gc test suite still passes.
> Looks good.
Thanks for your review.
> Note that some tests use System.out.println(some-object) to achieve the
> same effect - maybe using reachabilityFence there might be worthwhile
Thanks for pointing this out. I have created:
https://bugs.openjdk.java.net/browse/JDK-8217515 JTREG: clean up, use
Reference.reachabilityFence instead of System.out.println (and assigned
it to me).
I do not want to add it to this fix and create too big webrevs/long reviews.
More information about the hotspot-gc-dev