RFR: 8286957: Held monitor count [v7]

Robbin Ehn rehn at openjdk.org
Wed Jul 6 13:05:27 UTC 2022


> The current implementation do not count all monitor enter, counts high up in abstraction and causes a performance regression on aarch64 with some benchmarks due to C2 changes.
> 
> This change makes the counting exact by pushing the counting down in the abstraction.
> The additional JNI counter is strictly not needed, but enables us to figure out if we have monitors "on stack".
> 
> An uncontended lock plus unlock is 1 ns (21.5 -> 22.5) slower in C2 compiled code on x64 with the additional increment and decrement.
> 
> Fixed aarch64, x64, x86 and zero.
> 
> Passes t1-8

Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:

  Fixed return value truncation and prep CA for 32 bit

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/8945/files
  - new: https://git.openjdk.org/jdk/pull/8945/files/85853052..1bfb9c7b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=8945&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=8945&range=05-06

  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/8945.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/8945/head:pull/8945

PR: https://git.openjdk.org/jdk/pull/8945


More information about the hotspot-dev mailing list