RFR (S): 8007898: Incorrect optimization of Memory Barriers in Matcher::post_store_load_barrier()

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Jul 10 20:38:36 PDT 2013


http://cr.openjdk.java.net/~kvn/8007898/webrev/

The problem is caused by complicated (and questionable) barriers code 
generated for volatile stores. It is questionable from performance view 
because second volatile membar is for bottom memory (AliasIdxBot). So 
any memory operations can not pass it.
The fix is to generate one "fat" membar instead of set of barriers.

I also cleaned/fixed corresponding code in Matcher which tries to 
optimize out those multiply barriers. The problem with it was it did not 
take into account biased locking when cas could be not executed.
Also code for FastUnlock ('If' check) was not removed before because of, 
I think, incorrect comment "upcoming fastlock block" - it should be 
"fastUnlock block".

Added regression test which shows the problem with -XX:+StressLCM[GCM] 
flags added by Aleksey some time ago.

Aleksey is testing performance of these changes and no regression is 
observed so far.

Thanks,
Vladimir

















More information about the hotspot-compiler-dev mailing list