Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(lldb) di -f
Python`_PyObject_Alloc:
0x10a6d89b7 <+0>: pushq %rbp
0x10a6d89b8 <+1>: movq %rsp, %rbp
0x10a6d89bb <+4>: pushq %r15
0x10a6d89bd <+6>: pushq %r14
0x10a6d89bf <+8>: pushq %r13
0x10a6d89c1 <+10>: pushq %r12
0x10a6d89c3 <+12>: pushq %rbx
0x10a6d89c4 <+13>: subq $0x18, %rsp
0x10a6d89c8 <+17>: movq %rdx, %rbx
0x10a6d89cb <+20>: movq %rsi, %r12
0x10a6d89ce <+23>: movl %edi, %r14d
0x10a6d89d1 <+26>: incq 0x182428(%rip) ; _Py_AllocatedBlocks
0x10a6d89d8 <+33>: movq %rbx, %r15
0x10a6d89db <+36>: imulq %r12, %r15
0x10a6d89df <+40>: testq %r12, %r12
0x10a6d89e2 <+43>: je 0x10a6d8d38 ; <+897>
0x10a6d89e8 <+49>: testq %rbx, %rbx
0x10a6d89eb <+52>: je 0x10a6d8d38 ; <+897>
0x10a6d89f1 <+58>: leaq -0x1(%r15), %r13
0x10a6d89f5 <+62>: cmpq $0x1ff, %r13 ; imm = 0x1FF
0x10a6d89fc <+69>: ja 0x10a6d8d38 ; <+897>
0x10a6d8a02 <+75>: shrl $0x3, %r13d
0x10a6d8a06 <+79>: leal (%r13,%r13), %esi
0x10a6d8a0b <+84>: leaq 0x13cd6e(%rip), %rdi ; usedpools
0x10a6d8a12 <+91>: movq (%rdi,%rsi,8), %rax
0x10a6d8a16 <+95>: movq 0x10(%rax), %rcx
0x10a6d8a1a <+99>: cmpq %rcx, %rax
0x10a6d8a1d <+102>: je 0x10a6d8a52 ; <+155>
0x10a6d8a1f <+104>: incl (%rax)
0x10a6d8a21 <+106>: movq 0x8(%rax), %rbx
-> 0x10a6d8a25 <+110>: movq (%rbx), %rdx
0x10a6d8a28 <+113>: movq %rdx, 0x8(%rax)
0x10a6d8a2c <+117>: testq %rdx, %rdx
0x10a6d8a2f <+120>: jne 0x10a6d8d01 ; <+842>
0x10a6d8a35 <+126>: movl 0x28(%rax), %edx
0x10a6d8a38 <+129>: cmpl 0x2c(%rax), %edx
0x10a6d8a3b <+132>: jbe 0x10a6d8c2b ; <+628>
0x10a6d8a41 <+138>: movq 0x18(%rax), %rax
0x10a6d8a45 <+142>: movq %rax, 0x18(%rcx)
0x10a6d8a49 <+146>: movq %rcx, 0x10(%rax)
0x10a6d8a4d <+150>: jmp 0x10a6d8d01 ; <+842>
0x10a6d8a52 <+155>: movq 0x1823cf(%rip), %rcx ; usable_arenas
0x10a6d8a59 <+162>: testq %rcx, %rcx
0x10a6d8a5c <+165>: jne 0x10a6d8c18 ; <+609>
0x10a6d8a62 <+171>: movq %rsi, -0x38(%rbp)
0x10a6d8a66 <+175>: movq 0x1823c3(%rip), %rcx ; unused_arena_objects
0x10a6d8a6d <+182>: testq %rcx, %rcx
0x10a6d8a70 <+185>: jne 0x10a6d8b4a ; <+403>
0x10a6d8a76 <+191>: movl 0x18238c(%rip), %eax ; maxarenas
0x10a6d8a7c <+197>: leal (%rax,%rax), %edx
0x10a6d8a7f <+200>: testl %eax, %eax
0x10a6d8a81 <+202>: movl $0x10, %ecx
0x10a6d8a86 <+207>: cmovnel %edx, %ecx
0x10a6d8a89 <+210>: cmpl %eax, %ecx
0x10a6d8a8b <+212>: jbe 0x10a6d8d2d ; <+886>
0x10a6d8a91 <+218>: movl %ecx, %eax
0x10a6d8a93 <+220>: shlq $0x4, %rax
0x10a6d8a97 <+224>: leaq (%rax,%rax,2), %rdx
0x10a6d8a9b <+228>: movq 0x18236e(%rip), %rsi ; arenas
0x10a6d8aa2 <+235>: movq 0x13cc47(%rip), %rdi ; _PyMem_Raw
0x10a6d8aa9 <+242>: movq %rcx, -0x30(%rbp)
0x10a6d8aad <+246>: callq *0x13cc55(%rip) ; _PyMem_Raw + 24
0x10a6d8ab3 <+252>: movq -0x30(%rbp), %r11
0x10a6d8ab7 <+256>: testq %rax, %rax
0x10a6d8aba <+259>: je 0x10a6d8d2d ; <+886>
0x10a6d8ac0 <+265>: movq %rax, 0x182349(%rip) ; arenas
0x10a6d8ac7 <+272>: movl 0x18233a(%rip), %r8d ; maxarenas
0x10a6d8ace <+279>: cmpl %r11d, %r8d
0x10a6d8ad1 <+282>: jae 0x10a6d8b31 ; <+378>
0x10a6d8ad3 <+284>: leal -0x1(%r11), %r9d
0x10a6d8ad7 <+288>: leaq (%r8,%r8,2), %rsi
0x10a6d8adb <+292>: shlq $0x4, %rsi
0x10a6d8adf <+296>: addq $0x20, %rsi
0x10a6d8ae3 <+300>: leaq 0x1(%r9), %r10
0x10a6d8ae7 <+304>: leal 0x1(%r8), %ecx
0x10a6d8aeb <+308>: shlq $0x4, %rcx
0x10a6d8aef <+312>: leaq (%rcx,%rcx,2), %rcx
0x10a6d8af3 <+316>: movq %r8, %rdx
0x10a6d8af6 <+319>: jmp 0x10a6d8b07 ; <+336>
0x10a6d8af8 <+321>: addq $0x30, %rsi
0x10a6d8afc <+325>: addq $0x30, %rcx
0x10a6d8b00 <+329>: movq 0x182309(%rip), %rax ; arenas
0x10a6d8b07 <+336>: movq $0x0, -0x20(%rax,%rsi)
0x10a6d8b10 <+345>: cmpq %r9, %rdx
0x10a6d8b13 <+348>: movl $0x0, %edi
0x10a6d8b18 <+353>: jae 0x10a6d8b1e ; <+359>
0x10a6d8b1a <+355>: leaq (%rax,%rcx), %rdi
0x10a6d8b1e <+359>: movq %rdi, (%rax,%rsi)
0x10a6d8b22 <+363>: incq %rdx
0x10a6d8b25 <+366>: cmpq %rdx, %r10
0x10a6d8b28 <+369>: jne 0x10a6d8af8 ; <+321>
0x10a6d8b2a <+371>: movq 0x1822df(%rip), %rax ; arenas
0x10a6d8b31 <+378>: leaq (%r8,%r8,2), %rcx
0x10a6d8b35 <+382>: shlq $0x4, %rcx
0x10a6d8b39 <+386>: addq %rax, %rcx
0x10a6d8b3c <+389>: movq %rcx, 0x1822ed(%rip) ; unused_arena_objects
0x10a6d8b43 <+396>: movl %r11d, 0x1822be(%rip) ; maxarenas
0x10a6d8b4a <+403>: movq %rcx, -0x30(%rbp)
0x10a6d8b4e <+407>: movq 0x20(%rcx), %rax
0x10a6d8b52 <+411>: movq %rax, 0x1822d7(%rip) ; unused_arena_objects
0x10a6d8b59 <+418>: movq 0x13cc08(%rip), %rdi ; _PyObject_Arena
0x10a6d8b60 <+425>: movl $0x40000, %esi ; imm = 0x40000
0x10a6d8b65 <+430>: callq *0x13cc05(%rip) ; _PyObject_Arena + 8
0x10a6d8b6b <+436>: testq %rax, %rax
0x10a6d8b6e <+439>: je 0x10a6d8d17 ; <+864>
0x10a6d8b74 <+445>: movq -0x30(%rbp), %rcx
0x10a6d8b78 <+449>: movq %rax, (%rcx)
0x10a6d8b7b <+452>: movq 0x1822b6(%rip), %rax ; narenas_currently_allocated
0x10a6d8b82 <+459>: incq %rax
0x10a6d8b85 <+462>: movq %rax, 0x1822ac(%rip) ; narenas_currently_allocated
0x10a6d8b8c <+469>: incq 0x182285(%rip) ; ntimes_arena_allocated
0x10a6d8b93 <+476>: cmpq 0x182286(%rip), %rax ; narenas_highwater
0x10a6d8b9a <+483>: movq -0x38(%rbp), %rsi
0x10a6d8b9e <+487>: leaq 0x13cbdb(%rip), %rdi ; usedpools
0x10a6d8ba5 <+494>: movq %rcx, %rbx
0x10a6d8ba8 <+497>: jbe 0x10a6d8bb1 ; <+506>
0x10a6d8baa <+499>: movq %rax, 0x18226f(%rip) ; narenas_highwater
0x10a6d8bb1 <+506>: movq $0x0, 0x18(%rbx)
0x10a6d8bb9 <+514>: movq (%rbx), %rax
0x10a6d8bbc <+517>: movq %rax, 0x8(%rbx)
0x10a6d8bc0 <+521>: movl $0x40, 0x10(%rbx)
0x10a6d8bc7 <+528>: movl %eax, %ecx
0x10a6d8bc9 <+530>: andl $0xfff, %ecx ; imm = 0xFFF
0x10a6d8bcf <+536>: movl $0x40, %edx
0x10a6d8bd4 <+541>: je 0x10a6d8bf0 ; <+569>
0x10a6d8bd6 <+543>: movl $0x3f, 0x10(%rbx)
0x10a6d8bdd <+550>: movl $0x1000, %edx ; imm = 0x1000
0x10a6d8be2 <+555>: subl %ecx, %edx
0x10a6d8be4 <+557>: addq %rdx, %rax
0x10a6d8be7 <+560>: movq %rax, 0x8(%rbx)
0x10a6d8beb <+564>: movl $0x3f, %edx
0x10a6d8bf0 <+569>: movl %edx, 0x14(%rbx)
0x10a6d8bf3 <+572>: movq %rbx, 0x18222e(%rip) ; usable_arenas
0x10a6d8bfa <+579>: movq $0x0, 0x28(%rbx)
0x10a6d8c02 <+587>: movq 0x18221f(%rip), %rax ; usable_arenas
0x10a6d8c09 <+594>: movq $0x0, 0x20(%rax)
0x10a6d8c11 <+602>: movq 0x182210(%rip), %rcx ; usable_arenas
0x10a6d8c18 <+609>: movq 0x18(%rcx), %rax
0x10a6d8c1c <+613>: testq %rax, %rax
0x10a6d8c1f <+616>: je 0x10a6d8c48 ; <+657>
0x10a6d8c21 <+618>: movq 0x10(%rax), %rdx
0x10a6d8c25 <+622>: movq %rdx, 0x18(%rcx)
0x10a6d8c29 <+626>: jmp 0x10a6d8c75 ; <+702>
0x10a6d8c2b <+628>: leaq (%rax,%rdx), %rcx
0x10a6d8c2f <+632>: movq %rcx, 0x8(%rax)
0x10a6d8c33 <+636>: leal 0x8(%rdx,%r13,8), %ecx
0x10a6d8c38 <+641>: movl %ecx, 0x28(%rax)
0x10a6d8c3b <+644>: movq $0x0, (%rax,%rdx)
0x10a6d8c43 <+652>: jmp 0x10a6d8d01 ; <+842>
0x10a6d8c48 <+657>: movq 0x8(%rcx), %rax
0x10a6d8c4c <+661>: movq %rcx, %rdx
0x10a6d8c4f <+664>: subq 0x1821ba(%rip), %rdx ; arenas
0x10a6d8c56 <+671>: shrq $0x4, %rdx
0x10a6d8c5a <+675>: imull $0xaaaaaaab, %edx, %edx ; imm = 0xAAAAAAAB
0x10a6d8c60 <+681>: movl %edx, 0x20(%rax)
0x10a6d8c63 <+684>: movl $0xffff, 0x24(%rax) ; imm = 0xFFFF
0x10a6d8c6a <+691>: leaq 0x1000(%rax), %rdx
0x10a6d8c71 <+698>: movq %rdx, 0x8(%rcx)
0x10a6d8c75 <+702>: movq 0x1821ac(%rip), %rcx ; usable_arenas
0x10a6d8c7c <+709>: decl 0x10(%rcx)
0x10a6d8c7f <+712>: jne 0x10a6d8c99 ; <+738>
0x10a6d8c81 <+714>: movq 0x20(%rcx), %rcx
0x10a6d8c85 <+718>: movq %rcx, 0x18219c(%rip) ; usable_arenas
0x10a6d8c8c <+725>: testq %rcx, %rcx
0x10a6d8c8f <+728>: je 0x10a6d8c99 ; <+738>
0x10a6d8c91 <+730>: movq $0x0, 0x28(%rcx)
0x10a6d8c99 <+738>: movq (%rdi,%rsi,8), %rcx
0x10a6d8c9d <+742>: movq %rcx, 0x10(%rax)
0x10a6d8ca1 <+746>: movq %rcx, 0x18(%rax)
0x10a6d8ca5 <+750>: movq %rax, 0x10(%rcx)
0x10a6d8ca9 <+754>: movq %rax, 0x18(%rcx)
0x10a6d8cad <+758>: movl $0x1, (%rax)
0x10a6d8cb3 <+764>: cmpl %r13d, 0x24(%rax)
0x10a6d8cb7 <+768>: jne 0x10a6d8cc6 ; <+783>
0x10a6d8cb9 <+770>: movq 0x8(%rax), %rbx
0x10a6d8cbd <+774>: movq (%rbx), %rcx
0x10a6d8cc0 <+777>: movq %rcx, 0x8(%rax)
0x10a6d8cc4 <+781>: jmp 0x10a6d8d01 ; <+842>
0x10a6d8cc6 <+783>: movl %r13d, 0x24(%rax)
0x10a6d8cca <+787>: leal (,%r13,8), %ecx
0x10a6d8cd2 <+795>: leal 0x8(,%r13,8), %edx
0x10a6d8cda <+803>: leal 0x40(%rcx,%rcx), %esi
0x10a6d8cde <+807>: movl %esi, 0x28(%rax)
0x10a6d8ce1 <+810>: movl $0xff8, %esi ; imm = 0xFF8
0x10a6d8ce6 <+815>: subl %ecx, %esi
0x10a6d8ce8 <+817>: movl %esi, 0x2c(%rax)
0x10a6d8ceb <+820>: leaq 0x30(%rax,%rdx), %rcx
0x10a6d8cf0 <+825>: movq %rcx, 0x8(%rax)
0x10a6d8cf4 <+829>: movq $0x0, 0x30(%rax,%rdx)
0x10a6d8cfd <+838>: leaq 0x30(%rax), %rbx
0x10a6d8d01 <+842>: testl %r14d, %r14d
0x10a6d8d04 <+845>: je 0x10a6d8d91 ; <+986>
0x10a6d8d0a <+851>: movq %rbx, %rdi
0x10a6d8d0d <+854>: movq %r15, %rsi
0x10a6d8d10 <+857>: callq 0x10a7aa464 ; symbol stub for: __bzero
0x10a6d8d15 <+862>: jmp 0x10a6d8d91 ; <+986>
0x10a6d8d17 <+864>: movq 0x182112(%rip), %rax ; unused_arena_objects
0x10a6d8d1e <+871>: movq -0x30(%rbp), %rcx
0x10a6d8d22 <+875>: movq %rax, 0x20(%rcx)
0x10a6d8d26 <+879>: movq %rcx, 0x182103(%rip) ; unused_arena_objects
0x10a6d8d2d <+886>: movq $0x0, 0x1820f0(%rip) ; narenas_highwater + 4
0x10a6d8d38 <+897>: testl %r14d, %r14d
0x10a6d8d3b <+900>: je 0x10a6d8d6b ; <+948>
0x10a6d8d3d <+902>: testq %rbx, %rbx
0x10a6d8d40 <+905>: je 0x10a6d8d56 ; <+927>
0x10a6d8d42 <+907>: movabsq $0x7fffffffffffffff, %rax ; imm = 0x7FFFFFFFFFFFFFFF
0x10a6d8d4c <+917>: xorl %edx, %edx
0x10a6d8d4e <+919>: divq %rbx
0x10a6d8d51 <+922>: cmpq %r12, %rax
0x10a6d8d54 <+925>: jb 0x10a6d8d88 ; <+977>
0x10a6d8d56 <+927>: movq 0x13c993(%rip), %rdi ; _PyMem_Raw
0x10a6d8d5d <+934>: movq %r12, %rsi
0x10a6d8d60 <+937>: movq %rbx, %rdx
0x10a6d8d63 <+940>: callq *0x13c997(%rip) ; _PyMem_Raw + 16
0x10a6d8d69 <+946>: jmp 0x10a6d8d80 ; <+969>
0x10a6d8d6b <+948>: testq %r15, %r15
0x10a6d8d6e <+951>: js 0x10a6d8d88 ; <+977>
0x10a6d8d70 <+953>: movq 0x13c979(%rip), %rdi ; _PyMem_Raw
0x10a6d8d77 <+960>: movq %r15, %rsi
0x10a6d8d7a <+963>: callq *0x13c978(%rip) ; _PyMem_Raw + 8
0x10a6d8d80 <+969>: movq %rax, %rbx
0x10a6d8d83 <+972>: testq %rbx, %rbx
0x10a6d8d86 <+975>: jne 0x10a6d8d91 ; <+986>
0x10a6d8d88 <+977>: decq 0x182071(%rip) ; _Py_AllocatedBlocks
0x10a6d8d8f <+984>: xorl %ebx, %ebx
0x10a6d8d91 <+986>: movq %rbx, %rax
0x10a6d8d94 <+989>: addq $0x18, %rsp
0x10a6d8d98 <+993>: popq %rbx
0x10a6d8d99 <+994>: popq %r12
0x10a6d8d9b <+996>: popq %r13
0x10a6d8d9d <+998>: popq %r14
0x10a6d8d9f <+1000>: popq %r15
0x10a6d8da1 <+1002>: popq %rbp
0x10a6d8da2 <+1003>: retq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment