prefetch instructions in Hotspot

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Mar 31 18:56:10 UTC 2014


Hi Mahmood

You don't need anything additional if you can build and execute java from sources you have.

Do you want to use readPrefetch from java code?
If yes, you need to add declarations into jdk/src/share/classessun/misc/Unsafe.java:

     public native void prefetchRead (Object o, long offset);
     public native void prefetchWrite(Object o, long offset);
     public static native void prefetchReadStatic (Object o, long offset);
     public static native void prefetchWriteStatic(Object o, long offset);

And we already have corresponding intrinsics in Hotspot:

hotspot/src/share/vm/opto/library_call.cpp
LibraryCallKit::inline_unsafe_prefetch()

Regards,
Vladimir


On 3/31/14 5:38 AM, Mahmood Naderan wrote:
> Hi,
>
> I have some naive questions so any answer to the following questions are appreciated.
>
> 1- I have open-jdk 1.6 and 1.7. Do I have to install additional things?
>
> 2- I want to use some intrinsics (readPrefetch) but there are little information on how to use the intrinsics. Is there any example for that? The only thing I see is https://bugs.openjdk.java.net/browse/JDK-2146656
>
>
> Regards,
> Mahmood
>


More information about the hotspot-dev mailing list