RFR (S): 8228858: Reimplement JVM_RawMonitors to use PlatformMutex
David Holmes
david.holmes at oracle.com
Wed Aug 14 22:23:12 UTC 2019
One follow up to clarify testing ...
On 14/08/2019 10:32 pm, David Holmes wrote:
> bug: https://bugs.openjdk.java.net/browse/JDK-8228858
> webrev: http://cr.openjdk.java.net/~dholmes/8228858/webrev/
>
> A JVM_RawMonitor (not to be confused with JvmtiRawMonitor) is a simple
> mutex (despite the name) currently implemented via two special entry
> points in the VM Monitor code. This fix changes that so that a
> JVM_RawMonitor is just a PlatformMutex, enabling us to delete the
> special Monitor code.
>
> There are two clients of JVM_RawMonitor:
> - the native Zip library provided by the JDK and used by the JVM during
> classloading
> - AWT debug code
>
> The first should be tested by using the VM. :) The second I don't know.
> But the functionality we're testing is already present so there's
> sufficient coverage just by testing one client.
That may have sounded a bit too much like "fingers crossed it should be
okay" :)
In essence this change introduces no new code, it just shortens the code
paths. E.g for locking
Current:
JVM_RawMonitorLock -> Monitor::raw_enter -> PlatformMonitor::lock ->
pthread_mutex_lock
New:
JVM_RawMonitorLock -> PlatformMutex::lock -> pthread_mutex_lock
we are just cutting out the indirection via the Monitor class.
David
-----
> Testing: tiers 1 - 3 on Linux/macOS/Window x64, Solaris sparcv9
>
> Thanks,
> David
More information about the hotspot-runtime-dev
mailing list