RFR: 8273486: Zero: Handle DiagnoseSyncOnValueBasedClasses VM option
David Holmes
dholmes at openjdk.java.net
Tue Sep 14 01:56:07 UTC 2021
On Wed, 8 Sep 2021 10:41:34 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> JDK-8257027 added a diagnostic option to check for synchronization on value-based classes. Zero does not support it, so it would fail the relevant test:
>
>
> $ CONF=linux-x86_64-zero-fastdebug make exploded-test TEST=runtime/Monitor/SyncOnValueBasedClassTest.java
>
> STDERR:
> stdout: [];
> stderr: [Exception in thread "main" java.lang.RuntimeException: synchronization on value based class did not fail
> at SyncOnValueBasedClassTest$FatalTest.main(SyncOnValueBasedClassTest.java:128)
> ]
> exitValue = 1
>
> java.lang.RuntimeException: 'fatal error: Synchronizing on object' missing from stdout/stderr
>
>
> Template interpreters implement this check by going to to slowpath that calls `InterpreterRuntime::monitorenter`. Zero already goes to that path when `UseHeavyMonitors` is enabled, so we might just enable it when lock diagnostics is requested. This would cost us zero (pun intended) when diagnostic option is disabled.
>
> Additional testing:
> - [x] Linux x86_64 Zero, affected test now passes
Hi Aleksey,
Change seems fine. I'm a little surprised this is all you need.
Cheers,
David
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5412
More information about the hotspot-dev
mailing list