RFR: 8276901: Implement UseHeavyMonitors consistently [v4]

Roman Kennke rkennke at openjdk.java.net
Wed Dec 1 12:38:26 UTC 2021


On Wed, 1 Dec 2021 01:28:58 GMT, David Holmes <dholmes at openjdk.org> wrote:

> > > IIUC you are only making UseHeavyMonitors work properly on x86_64, but in that case you cannot convert UseFastLocks to UseHeavyMonitors on all platforms as it won't work correctly on those other platforms.
> > > Cheers, David
> > 
> > 
> > It would not break as such on other platforms. It would only be partially implemented, that is C1 would emit calls to runtime for and only use monitors while interpreter and C2 would still emit stack locks. That is ok - and that is roughly what +UseFastLocking used to do.
> 
> Sorry but I don't see how having the interpreter+C2 use stack-locks while C1 ignores them can possibly be correct. ???

Ok, right. It worked before, because -UseFastLocking (C1) and +UseHeavyMonitors (interpreter) would generate runtime calls (instead of fast stack locking paths), and the runtime implementation would still do stack-locking.

For arches where UseHeavyMonitors is not (fully) supported, I am fixing this by letting the runtime do stack-locks.

TBH, it would be nice if this change could be properly implemented on remaining arches... (ping @TheRealMDoerr for PPC, not sure who could do arm or s390).

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

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


More information about the hotspot-compiler-dev mailing list