RFR(M): 8016697: PPC64 (part 5): Use stubs to implement safefetch

Christian Thalinger christian.thalinger at oracle.com
Mon Jun 17 22:12:43 PDT 2013


On Jun 17, 2013, at 10:08 AM, Volker Simonis <volker.simonis at gmail.com> wrote:

> Hi Goetz,
> 
> I think the change is good and if the other reviewers don't decide to
> implement it for the current platforms we can push it.

I talked with Vladimir about this today and I my opinion we should use this stub on all platforms.  On which other platforms are you guys having this?

-- Chris

> 
> By the way, the makefile changes in ppc64.make will follow in patch 8 for
> linux [1] and patch 14 for aix [2].
> The implementation of the stubs will be in patch 9 for linux [3] and patch
> 15 for aix [4] (only the signal handling part).
> 
> Regards,
> Volker
> 
> [1]
> http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/tip/ppc_patches/0008_linux_ppc_make_changes.patch
> [2]
> http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/tip/ppc_patches/0014_aix_make_changes.patch
> [3]
> http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/tip/ppc_patches/0009_linux_ppc_files.patch
> [4]
> http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/tip/ppc_patches/0015_aix_ppc_files.patch
> 
> 
> 
> On Mon, Jun 17, 2013 at 3:55 PM, Lindenmaier, Goetz <
> goetz.lindenmaier at sap.com> wrote:
> 
>> Hi,****
>> 
>> ** **
>> 
>> the PPC64 port uses stub routines to implement safefetch. We had and****
>> 
>> have problems with inline assembly, especially with non-gcc****
>> 
>> compilers. Stub routines allow to implement safefetch without****
>> 
>> depending on OS or compiler, as it's the case with the current****
>> 
>> implementation. This also allows to use a single implementation if an****
>> 
>> architecture is supported on several os platforms.****
>> 
>> ** **
>> 
>> http://cr.openjdk.java.net/~goetz/webrevs/8016697-safefetch/****
>> 
>> ** **
>> 
>> Currently, we guard the code with ****
>> 
>>  #ifdef SAFEFETCH_STUBS****
>> 
>> which is set in ppc64.make.****
>> 
>> ** **
>> 
>> I could also imagine an implementation that uses a pd_debug flag****
>> 
>> or a const flag set in os_<os_cpu>.hpp that allows the C-compiler to ****
>> 
>> optimize, and writing the code like this:****
>> 
>> ** **
>> 
>> extern "C" int pd_SafeFetch32 (int * adr, int errValue) ;****
>> 
>> extern "C" intptr_t pd_SafeFetchN (intptr_t * adr, intptr_t errValue) ;***
>> *
>> 
>> inline int SafeFetch32(int* adr, int errValue) {****
>> 
>>  if (UseSafefetchStub) {****
>> 
>>    assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");***
>> *
>> 
>>    return StubRoutines::SafeFetch32_stub()(adr, errValue);****
>> 
>>  } else {****
>> 
>>    pd_SafeFetch32(adr, errValue);****
>> 
>>  }****
>> 
>> }****
>> 
>> ** **
>> 
>> Unfortunately this requires ****
>> 
>>  1) setting the flag on all platforms****
>> 
>>  2) renaming the safefetch function on all platfoms.****
>> 
>> ** **
>> 
>> Actually I would prefer this second solution as it avoids the
>> preprocessor, ****
>> 
>> and am happy to edit the sources accordingly if this finds acceptance.****
>> 
>> ** **
>> 
>> For the implementation of a safefetch_stub see****
>> 
>> 
>> http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/fce884e5ba0b/src/cpu/ppc/vm/stubGenerator_ppc.cpp
>> ****
>> 
>> ** **
>> 
>> Could I get a review on this change, please?****
>> 
>> ** **
>> 
>> Thanks,****
>> 
>>  Goetz.****
>> 



More information about the ppc-aix-port-dev mailing list