Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
java.lang.Integer.numberOfLeadingZeros (in Assembler x86)
CompilerOracle: print *Integer.numberOfLeadingZeros
Compiled method (c1) 1437 56 3 java.lang.Integer::numberOfLeadingZeros (76 bytes)
total in heap [0x000000010a826bd0,0x000000010a8270f0] = 1312
relocation [0x000000010a826cf8,0x000000010a826d30] = 56
main code [0x000000010a826d40,0x000000010a826f60] = 544
stub code [0x000000010a826f60,0x000000010a826ff0] = 144
metadata [0x000000010a826ff0,0x000000010a826ff8] = 8
scopes data [0x000000010a826ff8,0x000000010a827038] = 64
scopes pcs [0x000000010a827038,0x000000010a8270e8] = 176
dependencies [0x000000010a8270e8,0x000000010a8270f0] = 8
Decoding compiled method 0x000000010a826bd0:
Code:
[Disassembling for mach='i386:x86-64']
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer'
# parm0: rsi = int
# [sp+0x40] (sp of caller)
0x000000010a826d40: mov DWORD PTR [rsp-0x14000],eax
0x000000010a826d47: push rbp
0x000000010a826d48: sub rsp,0x30
0x000000010a826d4c: movabs rax,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826d56: mov edi,DWORD PTR [rax+0xdc]
0x000000010a826d5c: add edi,0x8
0x000000010a826d5f: mov DWORD PTR [rax+0xdc],edi
0x000000010a826d65: movabs rax,0x11e805e98 ; {metadata({method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826d6f: and edi,0x1ff8
0x000000010a826d75: cmp edi,0x0
0x000000010a826d78: je 0x000000010a826ef9 ;*iload_0
; - java.lang.Integer::numberOfLeadingZeros@0 (line 1397)
0x000000010a826d7e: cmp esi,0x0
0x000000010a826d81: movabs rax,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826d8b: movabs rdi,0x108
0x000000010a826d95: jne 0x000000010a826da5
0x000000010a826d9b: movabs rdi,0x118
0x000000010a826da5: mov rbx,QWORD PTR [rax+rdi*1]
0x000000010a826da9: lea rbx,[rbx+0x1]
0x000000010a826dad: mov QWORD PTR [rax+rdi*1],rbx
0x000000010a826db1: je 0x000000010a826ee8 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@1 (line 1397)
0x000000010a826db7: mov rax,rsi
0x000000010a826dba: shr eax,0x10
0x000000010a826dbd: cmp eax,0x0
0x000000010a826dc0: movabs rax,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826dca: movabs rdi,0x128
0x000000010a826dd4: jne 0x000000010a826de4
0x000000010a826dda: movabs rdi,0x138
0x000000010a826de4: mov rbx,QWORD PTR [rax+rdi*1]
0x000000010a826de8: lea rbx,[rbx+0x1]
0x000000010a826dec: mov QWORD PTR [rax+rdi*1],rbx
0x000000010a826df0: je 0x000000010a826e00 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@13 (line 1400)
0x000000010a826df6: mov eax,0x1
0x000000010a826dfb: jmp 0x000000010a826e08
0x000000010a826e00: shl esi,0x10
0x000000010a826e03: mov eax,0x11 ;*iload_0
; - java.lang.Integer::numberOfLeadingZeros@24 (line 1401)
0x000000010a826e08: mov rdi,rsi
0x000000010a826e0b: shr edi,0x18
0x000000010a826e0e: cmp edi,0x0
0x000000010a826e11: movabs rdi,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826e1b: movabs rbx,0x148
0x000000010a826e25: jne 0x000000010a826e35
0x000000010a826e2b: movabs rbx,0x158
0x000000010a826e35: mov rdx,QWORD PTR [rdi+rbx*1]
0x000000010a826e39: lea rdx,[rdx+0x1]
0x000000010a826e3d: mov QWORD PTR [rdi+rbx*1],rdx
0x000000010a826e41: jne 0x000000010a826e4d ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@28 (line 1401)
0x000000010a826e47: add eax,0x8
0x000000010a826e4a: shl esi,0x8
0x000000010a826e4d: mov rdi,rsi
0x000000010a826e50: shr edi,0x1c
0x000000010a826e53: cmp edi,0x0
0x000000010a826e56: movabs rdi,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826e60: movabs rbx,0x168
0x000000010a826e6a: jne 0x000000010a826e7a
0x000000010a826e70: movabs rbx,0x178
0x000000010a826e7a: mov rdx,QWORD PTR [rdi+rbx*1]
0x000000010a826e7e: lea rdx,[rdx+0x1]
0x000000010a826e82: mov QWORD PTR [rdi+rbx*1],rdx
0x000000010a826e86: jne 0x000000010a826e92 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@43 (line 1402)
0x000000010a826e8c: add eax,0x4
0x000000010a826e8f: shl esi,0x4
0x000000010a826e92: mov rdi,rsi
0x000000010a826e95: shr edi,0x1e
0x000000010a826e98: cmp edi,0x0
0x000000010a826e9b: movabs rdi,0x11e9daa60 ; {metadata(method data for {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer')}
0x000000010a826ea5: movabs rbx,0x188
0x000000010a826eaf: jne 0x000000010a826ebf
0x000000010a826eb5: movabs rbx,0x198
0x000000010a826ebf: mov rdx,QWORD PTR [rdi+rbx*1]
0x000000010a826ec3: lea rdx,[rdx+0x1]
0x000000010a826ec7: mov QWORD PTR [rdi+rbx*1],rdx
0x000000010a826ecb: jne 0x000000010a826ed7 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@57 (line 1403)
0x000000010a826ed1: add eax,0x2
0x000000010a826ed4: shl esi,0x2
0x000000010a826ed7: shr esi,0x1f
0x000000010a826eda: sub eax,esi
0x000000010a826edc: add rsp,0x30
0x000000010a826ee0: pop rbp
0x000000010a826ee1: test DWORD PTR [rip+0xffffffffff91c219],eax # 0x000000010a143100
; {poll_return}
0x000000010a826ee7: ret ;*ireturn
; - java.lang.Integer::numberOfLeadingZeros@75 (line 1405)
0x000000010a826ee8: mov eax,0x20
0x000000010a826eed: add rsp,0x30
0x000000010a826ef1: pop rbp
0x000000010a826ef2: test DWORD PTR [rip+0xffffffffff91c208],eax # 0x000000010a143100
; {poll_return}
0x000000010a826ef8: ret
0x000000010a826ef9: mov QWORD PTR [rsp+0x8],rax
0x000000010a826efe: mov QWORD PTR [rsp],0xffffffffffffffff
0x000000010a826f06: call 0x000000010a8013e0 ; OopMap{off=459}
;*synchronization entry
; - java.lang.Integer::numberOfLeadingZeros@-1 (line 1397)
; {runtime_call}
0x000000010a826f0b: jmp 0x000000010a826d7e
0x000000010a826f10: nop
0x000000010a826f11: nop
0x000000010a826f12: mov rax,QWORD PTR [r15+0x298]
0x000000010a826f19: movabs r10,0x0
0x000000010a826f23: mov QWORD PTR [r15+0x298],r10
0x000000010a826f2a: movabs r10,0x0
0x000000010a826f34: mov QWORD PTR [r15+0x2a0],r10
0x000000010a826f3b: add rsp,0x30
0x000000010a826f3f: pop rbp
0x000000010a826f40: jmp 0x000000010a771860 ; {runtime_call}
0x000000010a826f45: hlt
0x000000010a826f46: hlt
0x000000010a826f47: hlt
0x000000010a826f48: hlt
0x000000010a826f49: hlt
0x000000010a826f4a: hlt
0x000000010a826f4b: hlt
0x000000010a826f4c: hlt
0x000000010a826f4d: hlt
0x000000010a826f4e: hlt
0x000000010a826f4f: hlt
0x000000010a826f50: hlt
0x000000010a826f51: hlt
0x000000010a826f52: hlt
0x000000010a826f53: hlt
0x000000010a826f54: hlt
0x000000010a826f55: hlt
0x000000010a826f56: hlt
0x000000010a826f57: hlt
0x000000010a826f58: hlt
0x000000010a826f59: hlt
0x000000010a826f5a: hlt
0x000000010a826f5b: hlt
0x000000010a826f5c: hlt
0x000000010a826f5d: hlt
0x000000010a826f5e: hlt
0x000000010a826f5f: hlt
[Exception Handler]
[Stub Code]
0x000000010a826f60: call 0x000000010a7feb60 ; {no_reloc}
0x000000010a826f65: mov QWORD PTR [rsp-0x28],rsp
0x000000010a826f6a: sub rsp,0x80
0x000000010a826f71: mov QWORD PTR [rsp+0x78],rax
0x000000010a826f76: mov QWORD PTR [rsp+0x70],rcx
0x000000010a826f7b: mov QWORD PTR [rsp+0x68],rdx
0x000000010a826f80: mov QWORD PTR [rsp+0x60],rbx
0x000000010a826f85: mov QWORD PTR [rsp+0x50],rbp
0x000000010a826f8a: mov QWORD PTR [rsp+0x48],rsi
0x000000010a826f8f: mov QWORD PTR [rsp+0x40],rdi
0x000000010a826f94: mov QWORD PTR [rsp+0x38],r8
0x000000010a826f99: mov QWORD PTR [rsp+0x30],r9
0x000000010a826f9e: mov QWORD PTR [rsp+0x28],r10
0x000000010a826fa3: mov QWORD PTR [rsp+0x20],r11
0x000000010a826fa8: mov QWORD PTR [rsp+0x18],r12
0x000000010a826fad: mov QWORD PTR [rsp+0x10],r13
0x000000010a826fb2: mov QWORD PTR [rsp+0x8],r14
0x000000010a826fb7: mov QWORD PTR [rsp],r15
0x000000010a826fbb: movabs rdi,0x10976880c ; {external_word}
0x000000010a826fc5: movabs rsi,0x10a826f65 ; {internal_word}
0x000000010a826fcf: mov rdx,rsp
0x000000010a826fd2: and rsp,0xfffffffffffffff0
0x000000010a826fd6: call 0x00000001095a0cc6 ; {runtime_call}
0x000000010a826fdb: hlt
[Deopt Handler Code]
0x000000010a826fdc: movabs r10,0x10a826fdc ; {section_word}
0x000000010a826fe6: push r10
0x000000010a826fe8: jmp 0x000000010a749d00 ; {runtime_call}
0x000000010a826fed: hlt
0x000000010a826fee: hlt
0x000000010a826fef: hlt
OopMapSet contains 1 OopMaps
#0
OopMap{off=459}
Compiled method (c2) 1598 57 4 java.lang.Integer::numberOfLeadingZeros (76 bytes)
total in heap [0x000000010a82e890,0x000000010a82ebd0] = 832
relocation [0x000000010a82e9b8,0x000000010a82e9c0] = 8
main code [0x000000010a82e9c0,0x000000010a82ea40] = 128
stub code [0x000000010a82ea40,0x000000010a82ea58] = 24
metadata [0x000000010a82ea58,0x000000010a82ea60] = 8
scopes data [0x000000010a82ea60,0x000000010a82eab8] = 88
scopes pcs [0x000000010a82eab8,0x000000010a82ebc8] = 272
dependencies [0x000000010a82ebc8,0x000000010a82ebd0] = 8
Decoding compiled method 0x000000010a82e890:
Code:
[Entry Point]
[Verified Entry Point]
[Constants]
# {method} {0x000000011e805e98} 'numberOfLeadingZeros' '(I)I' in 'java/lang/Integer'
# parm0: rsi = int
# [sp+0x20] (sp of caller)
0x000000010a82e9c0: sub rsp,0x18
0x000000010a82e9c7: mov QWORD PTR [rsp+0x10],rbp ;*synchronization entry
; - java.lang.Integer::numberOfLeadingZeros@-1 (line 1397)
0x000000010a82e9cc: test esi,esi
0x000000010a82e9ce: je 0x000000010a82ea32 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@1 (line 1397)
0x000000010a82e9d0: mov r11d,esi
0x000000010a82e9d3: shr r11d,0x10
0x000000010a82e9d7: test r11d,r11d
0x000000010a82e9da: jne 0x000000010a82ea2b ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@13 (line 1400)
0x000000010a82e9dc: shl esi,0x10 ;*ishl
; - java.lang.Integer::numberOfLeadingZeros@22 (line 1400)
0x000000010a82e9df: mov eax,0x11 ;*iload_0
; - java.lang.Integer::numberOfLeadingZeros@24 (line 1401)
0x000000010a82e9e4: mov r10d,esi
0x000000010a82e9e7: shr r10d,0x18
0x000000010a82e9eb: test r10d,r10d
0x000000010a82e9ee: jne 0x000000010a82e9f6 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@28 (line 1401)
0x000000010a82e9f0: shl esi,0x8 ;*ishl
; - java.lang.Integer::numberOfLeadingZeros@37 (line 1401)
0x000000010a82e9f3: add eax,0x8 ;*iload_0
; - java.lang.Integer::numberOfLeadingZeros@39 (line 1402)
0x000000010a82e9f6: mov r11d,esi
0x000000010a82e9f9: shr r11d,0x1c
0x000000010a82e9fd: test r11d,r11d
0x000000010a82ea00: jne 0x000000010a82ea08 ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@43 (line 1402)
0x000000010a82ea02: shl esi,0x4 ;*ishl
; - java.lang.Integer::numberOfLeadingZeros@51 (line 1402)
0x000000010a82ea05: add eax,0x4 ;*iload_0
; - java.lang.Integer::numberOfLeadingZeros@53 (line 1403)
0x000000010a82ea08: mov r10d,esi
0x000000010a82ea0b: shr r10d,0x1e
0x000000010a82ea0f: test r10d,r10d
0x000000010a82ea12: jne 0x000000010a82ea1a ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@57 (line 1403)
0x000000010a82ea14: shl esi,0x2 ;*ishl
; - java.lang.Integer::numberOfLeadingZeros@65 (line 1403)
0x000000010a82ea17: add eax,0x2 ;*iload_1
; - java.lang.Integer::numberOfLeadingZeros@67 (line 1404)
0x000000010a82ea1a: shr esi,0x1f
0x000000010a82ea1d: sub eax,esi ;*ifne
; - java.lang.Integer::numberOfLeadingZeros@43 (line 1402)
0x000000010a82ea1f: add rsp,0x10
0x000000010a82ea23: pop rbp
0x000000010a82ea24: test DWORD PTR [rip+0xffffffffff9145d6],eax # 0x000000010a143000
; {poll_return}
0x000000010a82ea2a: ret
0x000000010a82ea2b: mov eax,0x1
0x000000010a82ea30: jmp 0x000000010a82e9e4
0x000000010a82ea32: mov eax,0x20
0x000000010a82ea37: jmp 0x000000010a82ea1f
0x000000010a82ea39: hlt
0x000000010a82ea3a: hlt
0x000000010a82ea3b: hlt
0x000000010a82ea3c: hlt
0x000000010a82ea3d: hlt
0x000000010a82ea3e: hlt
0x000000010a82ea3f: hlt
[Exception Handler]
[Stub Code]
0x000000010a82ea40: jmp 0x000000010a76eda0 ; {no_reloc}
[Deopt Handler Code]
0x000000010a82ea45: call 0x000000010a82ea4a
0x000000010a82ea4a: sub QWORD PTR [rsp],0x5
0x000000010a82ea4f: jmp 0x000000010a749d00 ; {runtime_call}
0x000000010a82ea54: hlt
0x000000010a82ea55: hlt
0x000000010a82ea56: hlt
0x000000010a82ea57: hlt
OopMapSet contains 0 OopMaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment