RFR 10 JDK-8159995: Rename internal Unsafe.compare methods
Paul Sandoz
paul.sandoz at oracle.com
Wed May 10 17:25:14 UTC 2017
Hi,
Looks good. Some minor comments.
Paul.
src/share/vm/classfile/vmSymbols.cpp
—
A prior bug: in the original code the case statements for the _weakCompareAndSwapLongVolatile were missing, so we need to add:
case vmIntrinsics::_weakCompareAndSeLong
etc.
I think this is mostly benign as it’s related to disabling intrinsics.
src/share/vm/opto/library_call.cpp
—
2594 // LS_cmp_swap_weak:
2595 //
2596 // boolean weakCompareAndSetObjectPlain( Object o, long offset, Object expected, Object x);
2597 // boolean weakCompareAndSetObjectAcquire(Object o, long offset, Object expected, Object x);
2598 // boolean weakCompareAndSetObjectRelease(Object o, long offset, Object expected, Object x);
2599 //
2600 // boolean weakCompareAndSetIntPlain( Object o, long offset, int expected, int x);
2601 // boolean weakCompareAndSetIntAcquire( Object o, long offset, int expected, int x);
2602 // boolean weakCompareAndSetIntRelease( Object o, long offset, int expected, int x);
2603 //
2604 // boolean weakCompareAndSetLongPlain( Object o, long offset, long expected, long x);
2605 // boolean weakCompareAndSetLongAcquire( Object o, long offset, long expected, long x);
2606 // boolean weakCompareAndSetLongRelease( Object o, long offset, long expected, long x);
2607 //
Missing volatile variantes in the comment.
@@ -4962,7 +4962,7 @@
// See arraycopy_restore_alloc_state() comment
// if alloc == NULL we don't have to worry about a tightly coupled allocation so we can emit all needed guards
// if saved_jvms != NULL (then alloc != NULL) then we can handle guards and a tightly coupled allocation
- // if saved_jvms == NULL and alloc != NULL, we can’t emit any guards
+ // if saved_jvms == NULL and alloc != NULL, we can’t emit any guards
Rouge characters that substituted “,"
test/compiler/unsafe/
—
In this directory there are templates you can update from which the test source is generated by running a script. See:
hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh
hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template
> On 5 May 2017, at 12:27, Ron Pressler <ron.pressler at oracle.com> wrote:
>
> Hi,
> Please review the following core/hotspot change:
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8159995
> core webrev: http://cr.openjdk.java.net/~psandoz/jdk10/JDK-8159995-unsafe-compare-and-swap-to-set-jdk/webrev/
> hotspot webrev: http://cr.openjdk.java.net/~psandoz/jdk10/JDK-8159995-unsafe-compare-and-swap-to-set-hotspot/webrev/
>
> This change is covered by existing tests.
>
> The following renaming was applied:
>
> - compareAndExchange*Volatile -> compareAndExchange*
> - compareAndSwap* -> compareAndSet*
> - weakCompareAndSwap* -> weakCompareAndSet*Plain
> - weakCompareAndSwap*Volatile -> weakCompareAndSet*
>
> At this stage, only method and hotspot intrinsic names were changed; node names were left as-is, and may be handled in a separate issue.
>
> Ron
More information about the core-libs-dev
mailing list