Lock coarsening LogCompilation output?
Chris Newland
cnewland at chrisnewland.com
Wed Jul 22 14:04:03 UTC 2015
Hi,
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:
https://github.com/AdoptOpenJDK/jitwatch/blob/master/src/main/resources/examples/LockCoarsen.java
Which consists of two synchronized(this) regions separated by a single
statement modifying a local primitive.
I get the following LogCompilation output:
https://gist.github.com/chriswhocodes/124984ce8078290485e7
Which has the following elimination info in the optimizer phase:
<eliminate_lock lock='1'>
<jvms bci='61' method='818'/>
</eliminate_lock>
<eliminate_lock lock='0'>
</eliminate_lock>
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
the
<eliminate_lock lock='0'>
</eliminate_lock>
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?
Thanks,
Chris
More information about the hotspot-compiler-dev
mailing list