RFR: 8318015: Lock inflation not needed for OSR or Deopt for new locking modes

Patricio Chilano Mateo pchilanomate at openjdk.org
Fri Oct 13 14:29:21 UTC 2023


On Thu, 12 Oct 2023 14:03:20 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

> Only LockingMode "LM_LEGACY" requires inflation before lock transfers because it is the only one which uses stack addresses in the mark word. I think we should treat the displaced header as stale data because it may be uninitialized.

Looks good to me.

src/hotspot/share/runtime/basicLock.cpp line 70:

> 68: 
> 69:   if (LockingMode == LM_LEGACY && displaced_header().is_neutral()) {
> 70:     // The object is locked and the resulting ObjectMonitor* will also be

Isn't the set_displaced_header() below also unnecessary for other locking modes, i.e shouldn't it be `if (LockingMode != LM_LEGACY) { return; }`?

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

PR Review: https://git.openjdk.org/jdk/pull/16165#pullrequestreview-1676607334
PR Review Comment: https://git.openjdk.org/jdk/pull/16165#discussion_r1358330805


More information about the hotspot-dev mailing list