Lock coarsening LogCompilation output?

Chris Newland cnewland at chrisnewland.com
Wed Jul 22 14:04:03 UTC 2015


I'm building support into JITWatch for highlighting eliminated heap
allocations and locks (either via elision or coarsening) and I'm confused
by the LogCompilation output in this case:

Given the source code here:

Which consists of two synchronized(this) regions separated by a single
statement modifying a local primitive.

I get the following LogCompilation output:

Which has the following elimination info in the optimizer phase:

<eliminate_lock lock='1'>
<jvms bci='61' method='818'/>
<eliminate_lock lock='0'>

BCI 61 refers to the 2nd synchronized block's monitor enter which I
believe will be eliminated due to coarsening but I don't understand what

<eliminate_lock lock='0'>

tag means, and why it doesn't contain a jvms tag?

Does it mean the first synchronized block has also been eliminated (via
elision) ? I don't see any "lock cmpxchg" related to the first
synchronized block in the PrintAssembly?



More information about the hotspot-compiler-dev mailing list