RFR 8054494: Remove sun.misc.Unsafe.monitorEnter, monitorExit and tryMonitorEnter

David Holmes david.holmes at oracle.com
Mon Jan 12 00:51:17 UTC 2015


Hi Paul,

On 10/01/2015 1:52 AM, Paul Sandoz wrote:
> Hi,
>
> http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8054494-dev-unsafe-monitor-remove/webrev/
>
> This "forest" webrev [*] removes the monitor related methods from Unsafe.

Overall looks good to me. For hotspot runtime we also require copyright 
notices be updated.

> The temptation to cleanup code in unsafe.cpp was resisted. I gather now that HotSpot Express no longer exists the grouping of registered native methods can be cleaned up plus there is dead code related to prefetch support. I propose to cleanup in a future patch.

Yep lots of historical baggage in there.

> The monitor methods resurface on WhiteBox because i noticed some associated Unsafe usages within hotspot Java tests. Rather than attempting to change such tests i thought it better to move the existing functionality.

Unfortunate. :(

> Now that WhiteBox has moved to the top level repository i could update ProcessBuilder/Basic.java to use WhiteBox. I held off doing that for now (it seems a little involved to get the relevant classes on the classpath for the executing tests with such a dependency).

I think using WB would be a lot clearer/cleaner than what you had to 
implement to determine when the lock was held!

Also the:

   System.out.println(thread.getState());

seems to be leftover debugging code?

> A JPRT job using the hotspot testset passed. Is that the correct testset to use?

Yes. It also has to be used when doing the forest push.

Thanks,
David

> Thanks,
> Paul.
>
> [*] Unfortunately "webrev -f" does not create a patch per repo as listed by "hg tlist".
>


More information about the hotspot-runtime-dev mailing list