Baffled asks: what does post_call_nop() do?

Rickard Bäckman rickard.backman at oracle.com
Mon Oct 7 16:24:36 UTC 2019


We use it to put metadata about the nmethod in there. Like offset to nmethod header for faster lookup. 

I’m wondering if those numbers are really attributed to the right instruction. 
Change it to emit nothing and see if you get a 71% speedup. I’m guessing that % is really the call / return instruction and if post_call_nop wasn’t there it would just be added to the next instruction. 

> 7 okt. 2019 kl. 18:15 skrev Andrew Haley <aph at redhat.com>:
> 
> I'm seeing this in one of my Scoped benchmarks:
> 
>  5.30%    0x00007f0f811f0080:   mov    rsi,QWORD PTR [rsp]
>           0x00007f0f811f0084:   nop
>           0x00007f0f811f0085:   nop
>           0x00007f0f811f0086:   nop
>           0x00007f0f811f0087:   call   0x00007f0f8111f520           ; ImmutableOopMap {[0]=Oop [64]=Oop [72]=Oop [80]=Oop [88]=Oop }
>                                                                     ;*invokevirtual consume {reexecute=0 rethrow=0 return_oop=0}
>                                                                     ; - org.sample.generated.ThreadLocalTest_getSC_jmhTest::getSC_avgt_jmhStub at 22 (line 239)
>                                                                     ;   {optimized virtual_call}
> 71.87%    0x00007f0f811f008c:   nop    DWORD PTR [rax+rax*1+0x0]    ;*invokevirtual consume {reexecute=0 rethrow=0 return_oop=0}
>                                                                     ; - org.sample.generated.ThreadLocalTest_getSC_jmhTest::getSC_avgt_jmhStub at 22 (line 239)
>          ;; B16: #    out( B11 B17 ) <- in( B15 )  Freq: 64789.4
>           0x00007f0f811f0094:   mov    r10,QWORD PTR [rsp+0x40]
>           0x00007f0f811f0099:   movzx  r10d,BYTE PTR [r10+0x94]     ;*invokestatic scopedCache {reexecute=0 rethrow=0 return_oop=0}
>                                                                     ; - java.lang.Scoped::getObject at 6 (line 76)
>                                                                     ; - java.lang.MyVariable_1::get at 5
> 
> So, about 72% of my total runtime is being accounted against post_call_nop() !
> 
> Is there any reason why this isn't just a bogus result? I'm not
> actually using Fibers or anything like them.
> 
> -- 
> Andrew Haley  (he/him)
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> https://keybase.io/andrewhaley
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the loom-dev mailing list