RFR: 8276901: Implement UseHeavyMonitors consistently [v7]

Roman Kennke rkennke at openjdk.java.net
Tue Nov 30 15:19:38 UTC 2021


> The flag UseHeavyMonitors seems to imply that it makes Hotspot always use inflated monitors, rather than stack locks. However, it is only implemented in the interpreter that way. When it calls into runtime, it would still happily stack-lock. Even worse, C1 uses another flag UseFastLocking to achieve something similar (with the same caveat that runtime would stack-lock anyway). C2 doesn't have any such mechanism at all.
> I would like to experiment with disabling stack-locking, and thus, having this flag work as expected would seem very useful.
> 
> The change removes the C1 flag UseFastLocking, and replaces its uses with equivalent (i.e. inverted) UseHeavyMonitors instead. I think it makes sense to make UseHeavyMonitors develop (I wouldn't want anybody to use this in production, not currently without this change, and not with this change). I also added a flag VerifyHeavyMonitors to be able to verify that stack-locking is really disabled. We can't currently verify this uncondiftionally (e.g. in debug builds) because all non-x86_64 platforms would need work.
> 
> Testing:
>  - [x] tier1
>  - [x] tier2
>  - [x] tier3
>  - [ ] tier4

Roman Kennke has updated the pull request incrementally with five additional commits since the last revision:

 - Implement x86_32 parts
 - Run UseHeavyMonitors test only on x86_64, add VerifyHeavyMonitors option
 - Fix indentation
 - Verify flags consistency
 - Add (Deprecated) to UseHeavyMonitors flag description

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/6320/files
  - new: https://git.openjdk.java.net/jdk/pull/6320/files/eca00517..4cba9d10

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=6320&range=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=6320&range=05-06

  Stats: 78 lines in 6 files changed: 25 ins; 0 del; 53 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6320.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6320/head:pull/6320

PR: https://git.openjdk.java.net/jdk/pull/6320


More information about the hotspot-compiler-dev mailing list