Looking at the generated code, OSR version of runXXXTest looks different:
runIntTest OSR:
[Verified Entry Point]
[Constants]
# {method} 'runIntTest' '()V' in 'benchmark/IntLongBench'
0x00000000026319c0: int3
0x00000000026319c1: data32 data32 nop WORD PTR [rax+rax*1+0x0]
0x00000000026319cc: data32 data32 xchg ax,ax
0x00000000026319d0: mov DWORD PTR [rsp-0x6000],eax
0x00000000026319d7: push rbp
0x00000000026319d8: sub rsp,0x30
0x00000000026319dc: mov rbx,QWORD PTR [rdx]
0x00000000026319df: mov rcx,rdx
0x00000000026319e2: movabs r10,0x6753fff0
0x00000000026319ec: call r10
0x00000000026319ef: mov r11d,DWORD PTR [rbx+0x8] ; implicit exception: dispatches to 0x0000000002631a5d
0x00000000026319f3: cmp r11d,0xef84b2c1 ; {oop('benchmark/IntLongBench')}
0x00000000026319fa: jne 0x0000000002631a4d ;*aload_0
; - benchmark.IntLongBench::runIntTest@6 (line 44)
0x00000000026319fc: mov r11d,DWORD PTR [rbx+0xc] ;*getfield i
; - benchmark.IntLongBench::decrementAndCheckInt@2 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a00: mov r10d,r11d
0x0000000002631a03: dec r10d ;*aload_0
; - benchmark.IntLongBench::runIntTest@6 (line 44)
0x0000000002631a06: dec r11d ;*isub
; - benchmark.IntLongBench::decrementAndCheckInt@7 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a09: mov DWORD PTR [rbx+0xc],r11d ;*putfield i
; - benchmark.IntLongBench::decrementAndCheckInt@8 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a0d: cmp r11d,r10d
0x0000000002631a10: jg 0x0000000002631a06 ;*ifeq
; - benchmark.IntLongBench::runIntTest@10 (line 44)
0x0000000002631a12: cmp r11d,0xd
0x0000000002631a16: jle 0x0000000002631a2e
0x0000000002631a18: nop DWORD PTR [rax+rax*1+0x0]
;*aload_0
; - benchmark.IntLongBench::runIntTest@6 (line 44)
0x0000000002631a20: add r11d,0xfffffff0 ;*isub
; - benchmark.IntLongBench::decrementAndCheckInt@7 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a24: mov DWORD PTR [rbx+0xc],r11d ;*putfield i
; - benchmark.IntLongBench::decrementAndCheckInt@8 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a28: cmp r11d,0xd
0x0000000002631a2c: jg 0x0000000002631a20 ;*ifeq
; - benchmark.IntLongBench::runIntTest@10 (line 44)
0x0000000002631a2e: cmp r11d,0xfffffffe
0x0000000002631a32: jle 0x0000000002631a41 ;*aload_0
; - benchmark.IntLongBench::runIntTest@6 (line 44)
0x0000000002631a34: dec r11d ;*isub
; - benchmark.IntLongBench::decrementAndCheckInt@7 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a37: mov DWORD PTR [rbx+0xc],r11d ;*putfield i
; - benchmark.IntLongBench::decrementAndCheckInt@8 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x0000000002631a3b: cmp r11d,0xfffffffe
0x0000000002631a3f: jg 0x0000000002631a34
0x0000000002631a41: add rsp,0x30
0x0000000002631a45: pop rbp
0x0000000002631a46: test DWORD PTR [rip+0xfffffffffde8e5b4],eax # 0x00000000004c0000
; {poll_return}
0x0000000002631a4c: ret
runLongTest OSR:
[Verified Entry Point]
[Constants]
# {method} 'runLongTest' '()V' in 'benchmark/IntLongBench'
0x000000000262fea0: int3
0x000000000262fea1: data32 data32 nop WORD PTR [rax+rax*1+0x0]
0x000000000262feac: data32 data32 xchg ax,ax
0x000000000262feb0: mov DWORD PTR [rsp-0x6000],eax
0x000000000262feb7: push rbp
0x000000000262feb8: sub rsp,0x30
0x000000000262febc: mov rbx,QWORD PTR [rdx]
0x000000000262febf: mov rcx,rdx
0x000000000262fec2: movabs r10,0x6753fff0
0x000000000262fecc: call r10
0x000000000262fecf: mov r11d,DWORD PTR [rbx+0x8] ; implicit exception: dispatches to 0x000000000262ff25
0x000000000262fed3: cmp r11d,0xef84b2c1 ; {oop('benchmark/IntLongBench')}
0x000000000262feda: jne 0x000000000262ff16 ;*aload_0
; - benchmark.IntLongBench::runLongTest@7 (line 55)
0x000000000262fedc: mov r10,QWORD PTR [rbx+0x10] ;*getfield l
; - benchmark.IntLongBench::decrementAndCheckLong@2 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262fee0: jmp 0x000000000262fee5
0x000000000262fee2: mov r10,r8 ;*aload_0
; - benchmark.IntLongBench::runLongTest@7 (line 55)
0x000000000262fee5: test r10,r10
0x000000000262fee8: jl 0x000000000262ff0e ;*ifge
; - benchmark.IntLongBench::decrementAndCheckLong@13 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262feea: xor r11d,r11d ;*invokevirtual decrementAndCheckLong
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262feed: mov r8,r10
0x000000000262fef0: dec r8 ;*lsub
; - benchmark.IntLongBench::decrementAndCheckLong@7 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262fef3: mov QWORD PTR [rbx+0x10],r8 ; OopMap{rbx=Oop off=87}
;*ifeq
; - benchmark.IntLongBench::runLongTest@11 (line 55)
0x000000000262fef7: test DWORD PTR [rip+0xfffffffffde90103],eax # 0x00000000004c0000
; {poll}
0x000000000262fefd: test r10,r10
0x000000000262ff00: jge 0x000000000262fee2
0x000000000262ff02: add rsp,0x30
0x000000000262ff06: pop rbp
0x000000000262ff07: test DWORD PTR [rip+0xfffffffffde900f3],eax # 0x00000000004c0000
; {poll_return}
0x000000000262ff0d: ret
But non-OSR version are very very similar (to DWORD/QWORD mov).
runIntTest non-OSR:
[Constants]
# {method} 'runIntTest' '()V' in 'benchmark/IntLongBench'
# [sp+0x20] (sp of caller)
0x000000000262fb80: mov r10d,DWORD PTR [rdx+0x8]
0x000000000262fb84: shl r10,0x3
0x000000000262fb88: cmp rax,r10
0x000000000262fb8b: jne 0x0000000002607a60 ; {runtime_call}
0x000000000262fb91: data32 xchg ax,ax
0x000000000262fb94: nop DWORD PTR [rax+rax*1+0x0]
0x000000000262fb9c: data32 data32 xchg ax,ax
[Verified Entry Point]
0x000000000262fba0: sub rsp,0x18
0x000000000262fba7: mov QWORD PTR [rsp+0x10],rbp ;*synchronization entry
; - benchmark.IntLongBench::runIntTest@-1 (line 43)
0x000000000262fbac: mov DWORD PTR [rdx+0xc],0x7ffffffe
;*putfield i
; - benchmark.IntLongBench::decrementAndCheckInt@8 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x000000000262fbb3: mov r11d,0x7ffffffe
0x000000000262fbb9: mov r10d,0x7ffffffd
0x000000000262fbbf: jmp 0x000000000262fbcd
0x000000000262fbc1: mov r9d,r10d
0x000000000262fbc4: dec r9d ;*isub
; - benchmark.IntLongBench::decrementAndCheckInt@7 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x000000000262fbc7: mov r11d,r10d
0x000000000262fbca: mov r10d,r9d ;*aload_0
; - benchmark.IntLongBench::runIntTest@6 (line 44)
0x000000000262fbcd: test r11d,r11d
0x000000000262fbd0: jl 0x000000000262fbf0 ;*ifge
; - benchmark.IntLongBench::decrementAndCheckInt@11 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x000000000262fbd2: xor r8d,r8d ;*invokevirtual decrementAndCheckInt
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x000000000262fbd5: mov DWORD PTR [rdx+0xc],r10d ; OopMap{rdx=Oop off=89}
;*ifeq
; - benchmark.IntLongBench::runIntTest@10 (line 44)
0x000000000262fbd9: test DWORD PTR [rip+0xfffffffffde90421],eax # 0x00000000004c0000
; {poll}
0x000000000262fbdf: test r11d,r11d
0x000000000262fbe2: jge 0x000000000262fbc1 ;*getfield i
; - benchmark.IntLongBench::decrementAndCheckInt@2 (line 49)
; - benchmark.IntLongBench::runIntTest@7 (line 44)
0x000000000262fbe4: add rsp,0x10
0x000000000262fbe8: pop rbp
0x000000000262fbe9: test DWORD PTR [rip+0xfffffffffde90411],eax # 0x00000000004c0000
; {poll_return}
0x000000000262fbef: ret
runLongTest non-OSR:
[Constants]
# {method} 'runLongTest' '()V' in 'benchmark/IntLongBench'
# [sp+0x20] (sp of caller)
0x000000000262f880: mov r10d,DWORD PTR [rdx+0x8]
0x000000000262f884: shl r10,0x3
0x000000000262f888: cmp rax,r10
0x000000000262f88b: jne 0x0000000002607a60 ; {runtime_call}
0x000000000262f891: data32 xchg ax,ax
0x000000000262f894: nop DWORD PTR [rax+rax*1+0x0]
0x000000000262f89c: data32 data32 xchg ax,ax
[Verified Entry Point]
0x000000000262f8a0: sub rsp,0x18
0x000000000262f8a7: mov QWORD PTR [rsp+0x10],rbp ;*synchronization entry
; - benchmark.IntLongBench::runLongTest@-1 (line 54)
0x000000000262f8ac: mov QWORD PTR [rdx+0x10],0x7ffffffe
;*putfield l
; - benchmark.IntLongBench::decrementAndCheckLong@8 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262f8b4: mov r10d,0x7ffffffe
0x000000000262f8ba: mov r11d,0x7ffffffd
0x000000000262f8c0: jmp 0x000000000262f8ce
0x000000000262f8c2: mov r8,r11
0x000000000262f8c5: dec r8 ;*lsub
; - benchmark.IntLongBench::decrementAndCheckLong@7 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262f8c8: mov r10,r11
0x000000000262f8cb: mov r11,r8 ;*aload_0
; - benchmark.IntLongBench::runLongTest@7 (line 55)
0x000000000262f8ce: test r10,r10
0x000000000262f8d1: jl 0x000000000262f8f1 ;*ifge
; - benchmark.IntLongBench::decrementAndCheckLong@13 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262f8d3: xor r8d,r8d ;*invokevirtual decrementAndCheckLong
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262f8d6: mov QWORD PTR [rdx+0x10],r11 ; OopMap{rdx=Oop off=90}
;*ifeq
; - benchmark.IntLongBench::runLongTest@11 (line 55)
0x000000000262f8da: test DWORD PTR [rip+0xfffffffffde90720],eax # 0x00000000004c0000
; {poll}
0x000000000262f8e0: test r10,r10
0x000000000262f8e3: jge 0x000000000262f8c2 ;*getfield l
; - benchmark.IntLongBench::decrementAndCheckLong@2 (line 60)
; - benchmark.IntLongBench::runLongTest@8 (line 55)
0x000000000262f8e5: add rsp,0x10
0x000000000262f8e9: pop rbp
0x000000000262f8ea: test DWORD PTR [rip+0xfffffffffde90710],eax # 0x00000000004c0000
; {poll_return}
0x000000000262f8f0: ret
Which confirm my observation from the benchmark (so in fact no need to benchmark ;-))