help understanding the "putLongRelease" implemetation in openjdk9
Mikael Vidstedt
mikael.vidstedt at oracle.com
Fri Oct 28 04:04:05 UTC 2016
In jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.cpp you’ll find this:
/** Release version of {@link #putLongVolatile(Object, long, long)} */
@HotSpotIntrinsicCandidate
public final void putLongRelease(Object o, long offset, long x) {
putLongVolatile(o, offset, x);
}
That is - in the default/interpreter case the putLongRelease method will delegate to the putLongVolatile method, and putLongVolatile in turn is in the default/interpreter case implemented in unsafe.cpp. However, the @HotSpotIntrinsicCandidate annotation is an indication that the JIT compiler handles the method differently, and if you have a look at hotspot/src/share/vm/opto/library_call.cpp you’ll find that putLongRelease, along with the other methods in the same family, get intensified and expanded during compilation using the inline_unsafe_access C++ method.
Cheers,
Mikael
> On Oct 27, 2016, at 8:29 PM, 恶灵骑士 <1072213404 at qq.com> wrote:
>
> for jdk8 according to src/share/vm/classfile/vmSymbols.hpp
> do_intrinsic(_putOrderedLong, sun_misc_Unsafe, putOrderedLong_name, putOrderedLong_signature, F_RN)
> do_name( putOrderedLong_name, "putOrderedLong")
>
>
>
> i can find method "putOrderedLong" in src/share/vm/prims/unsafe.hpp,
>
>
> but for jdk9 src/share/vm/classfile/vmSymbols.hpp
> do_intrinsic(_getLongAcquire, jdk_internal_misc_Unsafe, getLongAcquire_name, getLong_signature, F_R)
> do_name(getLongAcquire_name, "getLongAcquire") do_name(putLongRelease_name, "putLongRelease")
>
>
> i can not find method "putLongRelease" in src/share/vm/prims/unsafe.hpp,
> why ?
> Is the method "putLongRelease" of interpreter userd version discarded?
> only reserve the implemetation of compiler used version?
More information about the hotspot-dev
mailing list