RFR: 8217389: JTREG: Clean up, remove unused variable warnings

Thomas Schatzl thomas.schatzl at oracle.com
Tue Jan 22 11:02:22 UTC 2019


Hi,

On Mon, 2019-01-21 at 12:30 +0100, Leo Korinth wrote:
> Hi,
> 
> 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): 
> http://cr.openjdk.java.net/~lkorinth/8217389/00_01
> 
> Testing: gc test suite still passes.

Looks good.

Note that some tests use System.out.println(some-object) to achieve the
same effect - maybe using reachabilityFence there might be worthwhile
too.

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list