Since [JDK-8335256](https://bugs.openjdk.org/browse/JDK-8335256) / 
https://github.com/openjdk/valhalla/pull/1447 we attempt lock elimination 
already before Escape Analysis.  However, allocations of locked objects might 
block lock elimination if their escape state isn't determined yet and we only 
got one chance at eliminating the lock:
https://github.com/openjdk/valhalla/blob/1207841579be65b56c3e18d8d13453dd507d6a74/src/hotspot/share/opto/macro.cpp#L3001-L3004

I changed the code such that we only attempt lock elimination after EA and 
added a corresponding regression test.

Thanks,
Tobias

-------------

Commit messages:
 - 8366879: [lworld] C2's lock elimination fails after JDK-8335256

Changes: https://git.openjdk.org/valhalla/pull/1546/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1546&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8366879
  Stats: 107 lines in 5 files changed: 82 ins; 9 del; 16 mod
  Patch: https://git.openjdk.org/valhalla/pull/1546.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1546/head:pull/1546

PR: https://git.openjdk.org/valhalla/pull/1546

Reply via email to