RFR: [XS] 8219460: ppc: adjust NativeGeneralJump::insert_unconditional to stack allocated MacroAssembler -was RE: NativeGeneralJump::insert_unconditional ResourceMark

Baesken, Matthias matthias.baesken at sap.com
Wed Feb 20 17:15:31 UTC 2019


Hi Martin, I followed your idea and  use now a  stack allocated MacroAssembler object
 In the  ppc version  of  NativeGeneralJump::insert_unconditional  .

Please review .


Bug/webrev :

https://bugs.openjdk.java.net/browse/JDK-8219460

http://cr.openjdk.java.net/~mbaesken/webrevs/8219460.0/


Thanks, Matthias



> -----Original Message-----
> From: Doerr, Martin
> Sent: Dienstag, 19. Februar 2019 13:09
> To: Baesken, Matthias <matthias.baesken at sap.com>; Aleksey Shipilev
> <shade at redhat.com>; 'hotspot-dev at openjdk.java.net' <hotspot-
> dev at openjdk.java.net>
> Subject: RE: NativeGeneralJump::insert_unconditional ResourceMark - was :
> RE: RFR [XS] : 8219112: name_and_sig_as_C_string usages in frame_s390
> miss ResourceMark
> 
> Hi Matthias,
> 
> aarch64 looks ok. The MacroAssembler is allocated on stack. So I can't find
> anything which gets allocated in resource area.
> Actually, I think this would be a better fix for PPC64 than adding a
> ResourceMark (see below).
> 
> Best regards,
> Martin
> 
> 
> 
> diff -r 140ecd460080 src/hotspot/cpu/ppc/nativeInst_ppc.cpp
> --- a/src/hotspot/cpu/ppc/nativeInst_ppc.cpp    Tue Feb 19 12:52:28 2019
> +0100
> +++ b/src/hotspot/cpu/ppc/nativeInst_ppc.cpp    Tue Feb 19 12:56:50 2019
> +0100
> @@ -362,8 +362,8 @@
> 
>  void NativeGeneralJump::insert_unconditional(address code_pos, address
> entry) {
>    CodeBuffer cb(code_pos, BytesPerInstWord + 1);
> -  MacroAssembler* a = new MacroAssembler(&cb);
> -  a->b(entry);
> +  MacroAssembler a(&cb);
> +  a.b(entry);
>    ICache::ppc64_flush_icache_bytes(code_pos,
> NativeGeneralJump::instruction_size);
>  }
> 
> 
> 
> -----Original Message-----
> From: Baesken, Matthias
> Sent: Dienstag, 19. Februar 2019 09:47
> To: Doerr, Martin <martin.doerr at sap.com>; Aleksey Shipilev
> <shade at redhat.com>; 'hotspot-dev at openjdk.java.net' <hotspot-
> dev at openjdk.java.net>
> Subject: NativeGeneralJump::insert_unconditional ResourceMark - was : RE:
> RFR [XS] : 8219112: name_and_sig_as_C_string usages in frame_s390 miss
> ResourceMark
> 
> Hi Martin, thanks for commenting .
> 
> >
> > In the example below (nativeInst_ppc.cpp), I think we should add one. At
> > least, I couldn't find one at a good place.
> >
> 
> NativeGeneralJump::insert_unconditional   for aarch64 looks similar  to what
> we see in   nativeInst_ppc.cpp  ,   should we add a ResourceMark   here as
> well ?
>  (maybe someone from  the aarch64  developers could comment).
> 
> 
> src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
> 
> 490void NativeGeneralJump::insert_unconditional(address code_pos,
> address entry) {
> 491  NativeGeneralJump* n_jump = (NativeGeneralJump*)code_pos;
> 492
> 493  CodeBuffer cb(code_pos, instruction_size);
> 494  MacroAssembler a(&cb);
> 495
> 496  a.movptr(rscratch1, (uintptr_t)entry);
> 497  a.br(rscratch1);
> 498
> 499  ICache::invalidate_range(code_pos, instruction_size);
> 500}
> 



More information about the hotspot-dev mailing list