name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
luaG_getfuncline
int luaG_getfuncline (const Proto *f, int pc) { if (f->lineinfo == NULL) /* no debug information? */ return -1; else { int basepc; int baseline = getbaseline(f, pc, &basepc); while (basepc++ < pc) { /* walk until given instruction */ lua_assert(f->lineinfo[basepc] != ABSLINEINFO); baseline += f->lineinfo[basepc]; /* correct line */ } return baseline; } }
movq 0x58(%rdi), %rcx testq %rcx, %rcx je 0x9ec5 movslq 0x28(%rdi), %rdx testq %rdx, %rdx je 0x9eba movq 0x60(%rdi), %rax cmpl %esi, (%rax) jle 0x9ecb addq $0x2c, %rdi movl $0xffffffff, %edx # imm = 0xFFFFFFFF jmp 0x9f0e movl $0xffffffff, %eax # imm = 0xFFFFFFFF retq leal 0x7f(%rsi), %edi testl %esi, %esi cmovnsl %esi, %edi sarl $0x7, %edi cmpl %edi, %edx movslq %edi, %r8 cmovgl %edx, %edi decl %edi cmpq %r8, %rdx cmovleq %r8, %rdx cmpq %r8, %rdx je 0x9f00 leaq 0x1(%r8), %r9 cmpl %esi, (%rax,%r8,8) movq %r9, %r8 jle 0x9ee7 addl $-0x2, %r9d movl %r9d, %edi movslq %edi, %rdx leaq (%rax,%rdx,8), %rdi addq $0x4, %rdi movl -0x4(%rdi), %edx movl (%rdi), %eax cmpl %esi, %edx jge 0x9f29 movslq %edx, %rdx movslq %esi, %rsi movsbl 0x1(%rcx,%rdx), %edi incq %rdx addl %edi, %eax cmpq %rdx, %rsi jne 0x9f1a retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldebug.c
lua_sethook
LUA_API void lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { if (func == NULL || mask == 0) { /* turn off hooks? */ mask = 0; func = NULL; } L->hook = func; L->basehookcount = count; resethookcount(L); L->hookmask = cast_byte(mask); if (mask) settraps(L->ci); /* to trace inside 'luaV_execute' */ }
xorl %eax, %eax testq %rsi, %rsi movl %edx, %r8d cmovel %eax, %r8d testl %edx, %edx cmovneq %rsi, %rax movq %rax, 0xa0(%rdi) movl %ecx, 0xbc(%rdi) movl %ecx, 0xc0(%rdi) movzbl %r8b, %eax movl %eax, 0xc4(%rdi) testl %r8d, %r8d je 0x9f7a movq 0x20(%rdi), %rax testq %rax, %rax je 0x9f7a testb $-0x80, 0x3d(%rax) jne 0x9f74 movl $0x1, 0x28(%rax) movq 0x10(%rax), %rax jmp 0x9f62 retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldebug.c
lua_getstack
LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { int status; CallInfo *ci; if (level < 0) return 0; /* invalid (negative) level */ lua_lock(L); for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous) level--; if (level == 0 && ci != &L->base_ci) { /* level found? */ status = 1; ar->i_ci = ci; } else status = 0; /* no such level */ lua_unlock(L); return status; }
xorl %eax, %eax testl %esi, %esi js 0x9fed movq 0x20(%rdi), %rcx addq $0x60, %rdi testl %esi, %esi setne %r9b cmpq %rdi, %rcx setne %r8b andb %r8b, %r9b cmpb $0x1, %r9b jne 0x9fd2 movl %esi, %r9d leal -0x1(%r9), %esi movq 0x10(%rcx), %rcx cmpq %rdi, %rcx setne %r8b cmpl $0x2, %r9d jl 0x9fd2 cmpq %rdi, %rcx jne 0x9fb5 testl %esi, %esi sete %sil andb %r8b, %sil cmpb $0x1, %sil jne 0x9fed movq %rcx, 0x88(%rdx) movl $0x1, %eax retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldebug.c
lua_getlocal
LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { const char *name; lua_lock(L); if (ar == NULL) { /* information about non-active function? */ if (!isLfunction(s2v(L->top.p - 1))) /* not a Lua function? */ name = NULL; else /* consider live variables at function start (parameters) */ name = luaF_getlocalname(clLvalue(s2v(L->top.p - 1))->p, n, 0); } else { /* active function; get information through 'ar' */ StkId pos = NULL; /* to avoid warnings */ name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { setobjs2s(L, L->top.p, pos); api_incr_top(L); } } lua_unlock(L); return name; }
pushq %rbx subq $0x10, %rsp movq %rdi, %rbx testq %rsi, %rsi je 0xa130 leaq 0x8(%rsp), %rcx movq $0x0, (%rcx) movq 0x88(%rsi), %rsi movq %rbx, %rdi callq 0x9fee testq %rax, %rax je 0xa152 movq 0x10(%rbx), %rcx movq 0x8(%rsp), %rdx movq (%rdx), %rsi movq %rsi, (%rcx) movb 0x8(%rdx), %dl movb %dl, 0x8(%rcx) addq $0x10, 0x10(%rbx) jmp 0xa152 movq 0x10(%rbx), %rax cmpb $0x46, -0x8(%rax) jne 0xa150 movq -0x10(%rax), %rax movq 0x18(%rax), %rdi movl %edx, %esi xorl %edx, %edx addq $0x10, %rsp popq %rbx jmp 0xd4c1 xorl %eax, %eax addq $0x10, %rsp popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldebug.c
luaD_throw
l_noret luaD_throw (lua_State *L, TStatus errcode) { if (L->errorJmp) { /* thread has an error handler? */ L->errorJmp->status = errcode; /* set status */ LUAI_THROW(L, L->errorJmp); /* jump to it */ } else { /* thread has no error handler */ global_State *g = G(L); lua_State *mainth = mainthread(g); errcode = luaE_resetthread(L, errcode); /* close all upvalues */ L->status = errcode; if (mainth->errorJmp) { /* main thread has a handler? */ setobjs2s(L, mainth->top.p++, L->top.p - 1); /* copy error obj. */ luaD_throw(mainth, errcode); /* re-throw in main thread */ } else { /* no handler at all; abort */ if (g->panic) { /* panic function? */ lua_unlock(L); g->panic(L); /* call panic function (last chance to jump out) */ } abort(); } } }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movq 0x58(%rdi), %rdi testq %rdi, %rdi jne 0xb263 movq 0x18(%rbx), %r14 movzbl %sil, %esi movq %rbx, %rdi callq 0x16962 movb %al, 0xb(%rbx) cmpq $0x0, 0x5e0(%r14) jne 0xb278 movq 0x100(%r14), %rax testq %rax, %rax je 0xb25e movq %rbx, %rdi callq *%rax callq 0x51e0 movb %sil, 0xd0(%rdi) addq $0x8, %rdi movl $0x1, %esi callq 0x5150 leaq 0x588(%r14), %rdi movq 0x598(%r14), %rcx leaq 0x10(%rcx), %rdx movq %rdx, 0x598(%r14) movq 0x10(%rbx), %rdx movq -0x10(%rdx), %rsi movq %rsi, (%rcx) movb -0x8(%rdx), %dl movb %dl, 0x8(%rcx) movzbl %al, %esi callq 0xb220
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_rawrunprotected
TStatus luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { l_uint32 oldnCcalls = L->nCcalls; struct lua_longjmp lj; lj.status = LUA_OK; lj.previous = L->errorJmp; /* chain new error handler */ L->errorJmp = &lj; LUAI_TRY(L, &lj, f, ud); /* call 'f' catching errors */ L->errorJmp = lj.previous; /* restore old error handler */ L->nCcalls = oldnCcalls; return lj.status; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0xd8, %rsp movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movl 0xb0(%rdi), %ebp movq %rsp, %rax movb $0x0, 0xd0(%rax) movq 0x58(%rdi), %rcx movq %rcx, (%rax) movq %rax, 0x58(%rdi) leaq 0x8(%rsp), %rdi callq 0x5440 testl %eax, %eax jne 0xb2f2 movq %rbx, %rdi movq %r15, %rsi callq *%r14 movq (%rsp), %rax movq %rax, 0x58(%rbx) movl %ebp, 0xb0(%rbx) movb 0xd0(%rsp), %al addq $0xd8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_reallocstack
int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) { int oldsize = stacksize(L); int i; StkId newstack; StkId oldstack = L->stack.p; lu_byte oldgcstop = G(L)->gcstopem; lua_assert(newsize <= MAXSTACK || newsize == ERRORSTACKSIZE); relstack(L); /* change pointers to offsets */ G(L)->gcstopem = 1; /* stop emergency collection */ newstack = luaM_reallocvector(L, oldstack, oldsize + EXTRA_STACK, newsize + EXTRA_STACK, StackValue); G(L)->gcstopem = oldgcstop; /* restore emergency collection */ if (l_unlikely(newstack == NULL)) { /* reallocation failed? */ correctstack(L, oldstack); /* change offsets back to pointers */ if (raiseerror) luaM_error(L); else return 0; /* do not raise an error */ } L->stack.p = newstack; correctstack(L, oldstack); /* change offsets back to pointers */ L->stack_last.p = L->stack.p + newsize; for (i = oldsize + EXTRA_STACK; i < newsize + EXTRA_STACK; i++) setnilvalue(s2v(newstack + i)); /* erase new segment */ return 1; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, 0x4(%rsp) movq %rdi, %rbx movq 0x18(%rdi), %rcx movq 0x28(%rdi), %r12 movq 0x30(%rdi), %rax movb 0x6d(%rcx), %r13b subq %rax, 0x10(%rdi) movl %esi, %ebp subq %rax, 0x40(%rdi) subq %rax, %r12 shrq $0x4, %r12 movq 0x38(%rdi), %rcx testq %rcx, %rcx je 0xb395 movq 0x30(%rbx), %rdx subq %rdx, 0x10(%rcx) movq 0x18(%rcx), %rcx jmp 0xb382 movq 0x20(%rbx), %rcx testq %rcx, %rcx je 0xb3b3 movq 0x30(%rbx), %rdx subq %rdx, 0x8(%rcx) movq 0x30(%rbx), %rdx subq %rdx, (%rcx) movq 0x10(%rcx), %rcx jmp 0xb399 movq 0x18(%rbx), %rcx movb $0x1, 0x6d(%rcx) movslq %r12d, %rdx shlq $0x4, %rdx addq $0x50, %rdx movslq %ebp, %r14 shlq $0x4, %r14 leaq 0x50(%r14), %rcx movq %rbx, %rdi movq %rax, %rsi callq 0x112d5 movq %rax, %r15 movq 0x18(%rbx), %rax movb %r13b, 0x6d(%rax) testq %r15, %r15 je 0xb443 movq %r15, 0x30(%rbx) movq %rbx, %rdi callq 0xb461 addq 0x30(%rbx), %r14 movq %r14, 0x28(%rbx) movl $0x1, %eax cmpl %ebp, %r12d jge 0xb434 addl $0x5, %r12d addl $0x5, %ebp movslq %r12d, %rcx movslq %ebp, %rdx movq %rcx, %rsi shlq $0x4, %rsi addq %r15, %rsi addq $0x8, %rsi movb $0x0, (%rsi) incq %rcx addq $0x10, %rsi cmpq %rdx, %rcx jl 0xb425 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi callq 0xb461 xorl %eax, %eax cmpl $0x0, 0x4(%rsp) je 0xb434 movq %rbx, %rdi movl $0x4, %esi callq 0xb220
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
correctstack
static void correctstack (lua_State *L, StkId oldstack) { CallInfo *ci; UpVal *up; UNUSED(oldstack); L->top.p = restorestack(L, L->top.offset); L->tbclist.p = restorestack(L, L->tbclist.offset); for (up = L->openupval; up != NULL; up = up->u.open.next) up->v.p = s2v(restorestack(L, up->v.offset)); for (ci = L->ci; ci != NULL; ci = ci->previous) { ci->top.p = restorestack(L, ci->top.offset); ci->func.p = restorestack(L, ci->func.offset); if (isLua(ci)) ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */ } }
movq 0x30(%rdi), %rcx movq 0x38(%rdi), %rax addq %rcx, 0x10(%rdi) addq %rcx, 0x40(%rdi) testq %rax, %rax je 0xb484 movq 0x30(%rdi), %rcx addq %rcx, 0x10(%rax) movq 0x18(%rax), %rax jmp 0xb471 movq 0x20(%rdi), %rax testq %rax, %rax je 0xb4af movq 0x30(%rdi), %rcx addq %rcx, 0x8(%rax) movq 0x30(%rdi), %rcx addq %rcx, (%rax) testb $-0x80, 0x3d(%rax) jne 0xb4a9 movl $0x1, 0x28(%rax) movq 0x10(%rax), %rax jmp 0xb488 retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_growstack
int luaD_growstack (lua_State *L, int n, int raiseerror) { int size = stacksize(L); if (l_unlikely(size > MAXSTACK)) { /* if stack is larger than maximum, thread is already using the extra space reserved for errors, that is, thread is handling a stack error; cannot grow further than that. */ lua_assert(stacksize(L) == ERRORSTACKSIZE); if (raiseerror) luaD_errerr(L); /* error inside message handler */ return 0; /* if not 'raiseerror', just signal it */ } else if (n < MAXSTACK) { /* avoids arithmetic overflows */ int newsize = size + (size >> 1); /* tentative new size (size * 1.5) */ int needed = cast_int(L->top.p - L->stack.p) + n; if (newsize > MAXSTACK) /* cannot cross the limit */ newsize = MAXSTACK; if (newsize < needed) /* but must respect what was asked for */ newsize = needed; if (l_likely(newsize <= MAXSTACK)) return luaD_reallocstack(L, newsize, raiseerror); } /* else stack overflow */ /* add extra size to be able to handle the error message */ luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror); if (raiseerror) luaG_runerror(L, "stack overflow"); return 0; }
pushq %rbp pushq %r14 pushq %rbx movl %edx, %ebp movq %rdi, %rbx movq 0x28(%rdi), %rax movq 0x30(%rdi), %rcx subq %rcx, %rax shrq $0x4, %rax cmpl $0xf4241, %eax # imm = 0xF4241 jge 0xb532 cmpl $0xf423f, %esi # imm = 0xF423F jg 0xb518 movq 0x10(%rbx), %r14 subq %rcx, %r14 shrq $0x4, %r14 addl %esi, %r14d cmpl $0xf4240, %r14d # imm = 0xF4240 jg 0xb53e movl %eax, %esi sarl %esi addl %eax, %esi movl $0xf4240, %eax # imm = 0xF4240 cmpl %eax, %esi cmovgel %eax, %esi cmpl %r14d, %esi cmovlel %r14d, %esi movq %rbx, %rdi movl %ebp, %edx callq 0xb34b cmpl $0xf4241, %r14d # imm = 0xF4241 jl 0xb52d movq %rbx, %rdi movl $0xf4308, %esi # imm = 0xF4308 movl %ebp, %edx callq 0xb34b testl %ebp, %ebp jne 0xb540 xorl %eax, %eax popq %rbx popq %r14 popq %rbp retq testl %ebp, %ebp je 0xb52b movq %rbx, %rdi callq 0xb315 jmp 0xb50f leaq 0x1e58e(%rip), %rsi # 0x29ad5 movq %rbx, %rdi xorl %eax, %eax callq 0xa859
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_hook
void luaD_hook (lua_State *L, int event, int line, int ftransfer, int ntransfer) { lua_Hook hook = L->hook; if (hook && L->allowhook) { /* make sure there is a hook */ CallInfo *ci = L->ci; ptrdiff_t top = savestack(L, L->top.p); /* preserve original 'top' */ ptrdiff_t ci_top = savestack(L, ci->top.p); /* idem for 'ci->top' */ lua_Debug ar; ar.event = event; ar.currentline = line; ar.i_ci = ci; L->transferinfo.ftransfer = ftransfer; L->transferinfo.ntransfer = ntransfer; if (isLua(ci) && L->top.p < ci->top.p) L->top.p = ci->top.p; /* protect entire activation register */ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ if (ci->top.p < L->top.p + LUA_MINSTACK) ci->top.p = L->top.p + LUA_MINSTACK; L->allowhook = 0; /* cannot call hooks inside a hook */ ci->callstatus |= CIST_HOOKED; lua_unlock(L); (*hook)(L, &ar); lua_lock(L); lua_assert(!L->allowhook); L->allowhook = 1; ci->top.p = restorestack(L, ci_top); L->top.p = restorestack(L, top); ci->callstatus &= ~CIST_HOOKED; } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x98, %rsp movq 0xa0(%rdi), %r14 testq %r14, %r14 je 0xb6bd movq %rdi, %rbx cmpb $0x0, 0xa(%rdi) je 0xb6bd movq 0x10(%rbx), %r12 movq 0x20(%rbx), %r15 movq 0x30(%rbx), %rbp movq 0x8(%r15), %r13 movl %esi, 0x8(%rsp) movl %edx, 0x38(%rsp) movq %r15, 0x90(%rsp) movl %ecx, 0xc8(%rbx) movl %r8d, 0xcc(%rbx) testb $-0x80, 0x3d(%r15) jne 0xb667 movq 0x8(%r15), %rax cmpq %rax, %r12 jae 0xb667 movq %rax, 0x10(%rbx) movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x14f, %rax # imm = 0x14F jle 0xb6cf subq %rbp, %r12 subq %rbp, %r13 movl $0x140, %eax # imm = 0x140 addq 0x10(%rbx), %rax cmpq %rax, 0x8(%r15) jae 0xb690 movq %rax, 0x8(%r15) movb $0x0, 0xa(%rbx) orb $0x10, 0x3e(%r15) leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq *%r14 movb $0x1, 0xa(%rbx) addq 0x30(%rbx), %r13 movq %r13, 0x8(%r15) addq 0x30(%rbx), %r12 movq %r12, 0x10(%rbx) andb $-0x11, 0x3e(%r15) addq $0x98, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi movl $0x14, %esi movl $0x1, %edx callq 0xb4b0 jmp 0xb677
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_poscall
void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { l_uint32 fwanted = ci->callstatus & (CIST_TBC | CIST_NRESULTS); if (l_unlikely(L->hookmask) && !(fwanted & CIST_TBC)) rethook(L, ci, nres); /* move results to proper place */ moveresults(L, ci->func.p, nres, fwanted); /* function cannot be in any of these cases when returning */ lua_assert(!(ci->callstatus & (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_CLSRET))); L->ci = ci->previous; /* back to caller (after closing variables) */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx movl 0x3c(%rsi), %r13d cmpl $0x0, 0xc4(%rdi) jne 0xb905 movq (%r14), %r15 movl %r13d, %eax andl $0x400ff, %eax # imm = 0x400FF je 0xb84f cmpl $0x2, %eax je 0xb82b cmpl $0x1, %eax je 0xb8ea movzbl %r13b, %eax leal -0x1(%rax), %r12d btl $0x12, %r13d jae 0xb7e0 movq %rax, %r13 movq 0x20(%rbx), %rax movl %ebp, 0x38(%rax) movq 0x20(%rbx), %rax orl $0x20000, 0x3c(%rax) # imm = 0x20000 movq %rbx, %rdi movq %r15, %rsi movl $0x6, %edx movl $0x1, %ecx callq 0xd26c movq 0x20(%rbx), %rsi andl $0xfffdffff, 0x3c(%rsi) # imm = 0xFFFDFFFF movq %rax, %r15 cmpl $0x0, 0xc4(%rbx) je 0xb7d9 subq 0x30(%rbx), %r15 movq %rbx, %rdi movl %ebp, %edx callq 0xb922 addq 0x30(%rbx), %r15 testl %r13d, %r13d cmovel %ebp, %r12d cmpl %r12d, %ebp movl %r12d, %eax cmovll %ebp, %eax testl %eax, %eax jle 0xb8ba movq 0x10(%rbx), %rcx movslq %ebp, %rdx shlq $0x4, %rdx subq %rdx, %rcx movl %eax, %edx movl $0x8, %esi xorl %eax, %eax movq -0x8(%rcx,%rsi), %rdi movq %rdi, -0x8(%r15,%rsi) movb (%rcx,%rsi), %dil movb %dil, (%r15,%rsi) incq %rax addq $0x10, %rsi cmpq %rax, %rdx jne 0xb808 jmp 0xb8bc testl %ebp, %ebp je 0xb88a movq 0x10(%rbx), %rax movslq %ebp, %rcx shlq $0x4, %rcx movq %rax, %rdx subq %rcx, %rdx movq (%rdx), %rdx movq %rdx, (%r15) negq %rcx movb 0x8(%rax,%rcx), %al jmp 0xb88c movslq %ebp, %rax shlq $0x4, %rax movl %ebp, %ecx testl %ebp, %ebp jle 0xb896 movq 0x10(%rbx), %rsi subq %rax, %rsi movl $0x8, %edi xorl %edx, %edx movq -0x8(%rsi,%rdi), %r8 movq %r8, -0x8(%r15,%rdi) movb (%rsi,%rdi), %r8b movb %r8b, (%r15,%rdi) incq %rdx addq $0x10, %rdi cmpq %rdx, %rcx jne 0xb86a jmp 0xb898 xorl %eax, %eax movb %al, 0x8(%r15) addq $0x10, %r15 jmp 0xb8ea xorl %edx, %edx cmpl %ebp, %edx jge 0xb8e7 movl %edx, %edx subq %rdx, %rcx shlq $0x4, %rdx addq %r15, %rdx addq $0x8, %rdx movb $0x0, (%rdx) addq $0x10, %rdx decq %rcx jne 0xb8ac jmp 0xb8e7 xorl %eax, %eax cmpl %r12d, %eax jge 0xb8e0 movl %eax, %ecx movl %r12d, %eax subq %rcx, %rax shlq $0x4, %rcx addq %r15, %rcx addq $0x8, %rcx movb $0x0, (%rcx) addq $0x10, %rcx decq %rax jne 0xb8d4 movslq %r12d, %rax shlq $0x4, %rax addq %rax, %r15 movq %r15, 0x10(%rbx) movq 0x10(%r14), %rax movq %rax, 0x20(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq btl $0x12, %r13d jb 0xb754 movq %rbx, %rdi movq %r14, %rsi movl %ebp, %edx callq 0xb922 jmp 0xb754
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
rethook
static void rethook (lua_State *L, CallInfo *ci, int nres) { if (L->hookmask & LUA_MASKRET) { /* is return hook on? */ StkId firstres = L->top.p - nres; /* index of first result */ int delta = 0; /* correction for vararg functions */ int ftransfer; if (isLua(ci)) { Proto *p = ci_func(ci)->p; if (p->flag & PF_ISVARARG) delta = ci->u.l.nextraargs + p->numparams + 1; } ci->func.p += delta; /* if vararg, back to virtual 'func' */ ftransfer = cast_int(firstres - ci->func.p); luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */ ci->func.p -= delta; } if (isLua(ci = ci->previous)) L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* set 'oldpc' */ }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %rbx testl $0x2, 0xc4(%rdi) je 0xb99e movl %edx, %r8d movq 0x10(%rbx), %rcx movslq %edx, %rax shlq $0x4, %rax subq %rax, %rcx testb $-0x80, 0x3d(%r14) jne 0xb961 movq (%r14), %rax movq (%rax), %rax movq 0x18(%rax), %rax testb $0x1, 0xb(%rax) jne 0xb966 xorl %r15d, %r15d jmp 0xb975 movl 0x2c(%r14), %edx movzbl 0xa(%rax), %eax addl %edx, %eax incl %eax movslq %eax, %r15 shlq $0x4, %r15 movq (%r14), %rax addq %r15, %rax movq %rax, (%r14) subq %rax, %rcx shrq $0x4, %rcx movq %rbx, %rdi movl $0x1, %esi movl $0xffffffff, %edx # imm = 0xFFFFFFFF callq 0xb5f8 subq %r15, (%r14) movq 0x10(%r14), %rax testb $-0x80, 0x3d(%rax) jne 0xb9c6 movq (%rax), %rcx movq 0x20(%rax), %rax movq (%rcx), %rcx movq 0x18(%rcx), %rcx subq 0x40(%rcx), %rax shrq $0x2, %rax decl %eax movl %eax, 0xb4(%rbx) popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_pretailcall
int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta) { unsigned status = LUA_MULTRET + 1; retry: switch (ttypetag(s2v(func))) { case LUA_VCCL: /* C closure */ return precallC(L, func, status, clCvalue(s2v(func))->f); case LUA_VLCF: /* light C function */ return precallC(L, func, status, fvalue(s2v(func))); case LUA_VLCL: { /* Lua function */ Proto *p = clLvalue(s2v(func))->p; int fsize = p->maxstacksize; /* frame size */ int nfixparams = p->numparams; int i; checkstackp(L, fsize - delta, func); ci->func.p -= delta; /* restore 'func' (if vararg) */ for (i = 0; i < narg1; i++) /* move down function and arguments */ setobjs2s(L, ci->func.p + i, func + i); func = ci->func.p; /* moved-down function */ for (; narg1 <= nfixparams; narg1++) setnilvalue(s2v(func + narg1)); /* complete missing arguments */ ci->top.p = func + 1 + fsize; /* top for new function */ lua_assert(ci->top.p <= L->stack_last.p); ci->u.l.savedpc = p->code; /* starting point */ ci->callstatus |= CIST_TAIL; L->top.p = func + narg1; /* set top */ return -1; } default: { /* not a function */ checkstackp(L, 1, func); /* space for metamethod */ status = tryfuncTM(L, func, status); /* try '__call' metamethod */ narg1++; goto retry; /* try again */ } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl %r8d, (%rsp) movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %rbx movslq %ecx, %r12 movq %r12, %r13 shlq $0x4, %r13 orq $0x8, %r13 xorl %ebp, %ebp movzbl 0x8(%r14), %eax andl $0x3f, %eax cmpl $0x6, %eax je 0xba58 cmpl $0x16, %eax je 0xbb8a cmpl $0x26, %eax je 0xbb17 movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x10, %rax jle 0xba3c movq %rbx, %rdi movq %r14, %rsi movl %ebp, %edx callq 0xbc9a movl %eax, %ebp incq %r12 addq $0x10, %r13 jmp 0xb9f7 subq 0x30(%rbx), %r14 movq %rbx, %rdi movl $0x1, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xba24 movq (%r14), %rax movq 0x18(%rax), %rdi movzbl 0xc(%rdi), %r8d movzbl 0xa(%rdi), %r9d movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax sarq $0x4, %rax movslq (%rsp), %rbp movq %r8, %rsi subq %rbp, %rsi cmpq %rsi, %rax jle 0xbc12 shlq $0x4, %rbp subq %rbp, (%r15) testl %r12d, %r12d jle 0xbabb movl %r12d, %eax shlq $0x4, %rax xorl %ecx, %ecx movq (%r15), %rdx movq (%r14,%rcx), %rsi movq %rsi, (%rdx,%rcx) movb 0x8(%r14,%rcx), %sil movb %sil, 0x8(%rdx,%rcx) addq $0x10, %rcx cmpq %rcx, %rax jne 0xba9d movq (%r15), %rax cmpl %r9d, %r12d jg 0xbae2 leaq -0x1(%r12), %rcx movl %r9d, %edx addq %rax, %r13 movb $0x0, (%r13) incq %rcx addq $0x10, %r13 incl %r12d cmpq %rdx, %rcx jl 0xbace shll $0x4, %r8d leaq (%rax,%r8), %rcx addq $0x10, %rcx movq %rcx, 0x8(%r15) movq 0x40(%rdi), %rcx movq %rcx, 0x20(%r15) orb $0x40, 0x3e(%r15) movl %r12d, %ecx shlq $0x4, %rcx addq %rax, %rcx movq %rcx, 0x10(%rbx) movl $0xffffffff, %ebp # imm = 0xFFFFFFFF jmp 0xbc01 movq (%r14), %rax movq 0x18(%rax), %r12 movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x14f, %rax # imm = 0x14F jle 0xbc48 movl $0x140, %r13d # imm = 0x140 addq 0x10(%rbx), %r13 orl $0x8000, %ebp # imm = 0x8000 movq 0x20(%rbx), %rax movq 0x18(%rax), %r15 testq %r15, %r15 jne 0xbb5a movq %rbx, %rdi callq 0x16644 movq %rax, %r15 movq %r15, 0x20(%rbx) movq %r14, (%r15) movl %ebp, 0x3c(%r15) movq %r13, 0x8(%r15) movq %r15, 0x20(%rbx) testl $0x1, 0xc4(%rbx) je 0xbbec leaq 0x10(%rbx), %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x57ac jmp 0xbbec movq (%r14), %r12 movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x14f, %rax # imm = 0x14F jle 0xbc67 movl $0x140, %r13d # imm = 0x140 addq 0x10(%rbx), %r13 orl $0x8000, %ebp # imm = 0x8000 movq 0x20(%rbx), %rax movq 0x18(%rax), %r15 testq %r15, %r15 jne 0xbbc9 movq %rbx, %rdi callq 0x16644 movq %rax, %r15 movq %r15, 0x20(%rbx) movq %r14, (%r15) movl %ebp, 0x3c(%r15) movq %r13, 0x8(%r15) movq %r15, 0x20(%rbx) testl $0x1, 0xc4(%rbx) jne 0xbc86 movq %rbx, %rdi callq *%r12 movl %eax, %ebp movq %rbx, %rdi movq %r15, %rsi movl %eax, %edx callq 0xb730 movl %ebp, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq subq 0x30(%rbx), %r14 movq %rdi, (%rsp) movq %rbx, %rdi movl $0x1, %edx movq %r8, 0x10(%rsp) movl %r9d, 0xc(%rsp) callq 0xb4b0 movl 0xc(%rsp), %r9d movq 0x10(%rsp), %r8 movq (%rsp), %rdi addq 0x30(%rbx), %r14 jmp 0xba88 subq 0x30(%rbx), %r14 movq %rbx, %rdi movl $0x14, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xbb32 subq 0x30(%rbx), %r14 movq %rbx, %rdi movl $0x14, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xbba1 leaq 0x10(%rbx), %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x578c jmp 0xbbec
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
tryfuncTM
static unsigned tryfuncTM (lua_State *L, StkId func, unsigned status) { const TValue *tm; StkId p; tm = luaT_gettmbyobj(L, s2v(func), TM_CALL); if (l_unlikely(ttisnil(tm))) /* no metamethod? */ luaG_callerror(L, s2v(func)); for (p = L->top.p; p > func; p--) /* open space for metamethod */ setobjs2s(L, p, p-1); L->top.p++; /* stack space pre-allocated by the caller */ setobj2s(L, func, tm); /* metamethod is the new function to be called */ if ((status & MAX_CCMT) == MAX_CCMT) /* is counter full? */ luaG_runerror(L, "'__call' chain too long"); return status + (1u << CIST_CCMT); /* increment counter */ }
pushq %rbp pushq %r14 pushq %rbx movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx movl $0x17, %edx callq 0x1cb50 testb $0xf, 0x8(%rax) je 0xbd02 movq 0x10(%rbx), %rcx cmpq %r14, %rcx jbe 0xbcd8 movq -0x10(%rcx), %rdx movq %rdx, (%rcx) movb -0x8(%rcx), %dl movb %dl, 0x8(%rcx) leaq -0x10(%rcx), %rdx movq %rdx, %rcx cmpq %r14, %rdx ja 0xbcbf addq $0x10, 0x10(%rbx) movq (%rax), %rcx movq %rcx, (%r14) movb 0x8(%rax), %al movb %al, 0x8(%r14) movl %ebp, %eax notl %eax testl $0xf00, %eax # imm = 0xF00 je 0xbd0d addl $0x100, %ebp # imm = 0x100 movl %ebp, %eax popq %rbx popq %r14 popq %rbp retq movq %rbx, %rdi movq %r14, %rsi callq 0xa6df leaq 0x1de24(%rip), %rsi # 0x29b38 movq %rbx, %rdi xorl %eax, %eax callq 0xa859
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_precall
CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { unsigned status = cast_uint(nresults + 1); lua_assert(status <= MAXRESULTS + 1); retry: switch (ttypetag(s2v(func))) { case LUA_VCCL: /* C closure */ precallC(L, func, status, clCvalue(s2v(func))->f); return NULL; case LUA_VLCF: /* light C function */ precallC(L, func, status, fvalue(s2v(func))); return NULL; case LUA_VLCL: { /* Lua function */ CallInfo *ci; Proto *p = clLvalue(s2v(func))->p; int narg = cast_int(L->top.p - func) - 1; /* number of real arguments */ int nfixparams = p->numparams; int fsize = p->maxstacksize; /* frame size */ checkstackp(L, fsize, func); L->ci = ci = prepCallInfo(L, func, status, func + 1 + fsize); ci->u.l.savedpc = p->code; /* starting point */ for (; narg < nfixparams; narg++) setnilvalue(s2v(L->top.p++)); /* complete missing arguments */ lua_assert(ci->top.p <= L->stack_last.p); return ci; } default: { /* not a function */ checkstackp(L, 1, func); /* space for metamethod */ status = tryfuncTM(L, func, status); /* try '__call' metamethod */ goto retry; /* try again with metamethod */ } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, %ebp movq %rsi, %r14 movq %rdi, %rbx incl %ebp movzbl 0x8(%r14), %eax andl $0x3f, %eax cmpl $0x6, %eax je 0xbd8d cmpl $0x16, %eax je 0xbe2e cmpl $0x26, %eax je 0xbe25 movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x10, %rax jle 0xbd71 movq %rbx, %rdi movq %r14, %rsi movl %ebp, %edx callq 0xbc9a movl %eax, %ebp jmp 0xbd33 subq 0x30(%rbx), %r14 movq %rbx, %rdi movl $0x1, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xbd60 movq (%r14), %rax movq 0x18(%rax), %rcx movq 0x10(%rbx), %r13 movq 0x28(%rbx), %rax subq %r13, %rax subq %r14, %r13 shrq $0x4, %r13 movzbl 0xa(%rcx), %r12d movzbl 0xc(%rcx), %r15d sarq $0x4, %rax cmpq %r15, %rax jle 0xbeef shll $0x4, %r15d addq %r14, %r15 addq $0x10, %r15 movq 0x20(%rbx), %rax movq 0x18(%rax), %rax testq %rax, %rax jne 0xbde5 movq %rbx, %rdi movq %rcx, (%rsp) callq 0x16644 movq (%rsp), %rcx movq %rax, 0x20(%rbx) movq %r14, (%rax) movl %ebp, 0x3c(%rax) movq %r15, 0x8(%rax) movq %rax, 0x20(%rbx) movq 0x40(%rcx), %rcx movq %rcx, 0x20(%rax) cmpl %r12d, %r13d jg 0xbe9d subl %r13d, %r12d incl %r12d movq 0x10(%rbx), %rcx leaq 0x10(%rcx), %rdx movq %rdx, 0x10(%rbx) movb $0x0, 0x8(%rcx) decl %r12d jne 0xbe0e jmp 0xbe9d movq (%r14), %rax movq 0x18(%rax), %r12 jmp 0xbe31 movq (%r14), %r12 movq 0x28(%rbx), %rax subq 0x10(%rbx), %rax cmpq $0x14f, %rax # imm = 0x14F jle 0xbeac movl $0x140, %r13d # imm = 0x140 addq 0x10(%rbx), %r13 orl $0x8000, %ebp # imm = 0x8000 movq 0x20(%rbx), %rax movq 0x18(%rax), %r15 testq %r15, %r15 jne 0xbe69 movq %rbx, %rdi callq 0x16644 movq %rax, %r15 movq %r15, 0x20(%rbx) movq %r14, (%r15) movl %ebp, 0x3c(%r15) movq %r13, 0x8(%r15) movq %r15, 0x20(%rbx) testl $0x1, 0xc4(%rbx) jne 0xbecb movq %rbx, %rdi callq *%r12 movq %rbx, %rdi movq %r15, %rsi movl %eax, %edx callq 0xb730 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq subq 0x30(%rbx), %r14 movq %rbx, %rdi movl $0x14, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xbe41 movq 0x10(%rbx), %r8 subq %r14, %r8 shrq $0x4, %r8 decl %r8d movq %rbx, %rdi xorl %esi, %esi movl $0xffffffff, %edx # imm = 0xFFFFFFFF movl $0x1, %ecx callq 0xb5f8 jmp 0xbe88 subq 0x30(%rbx), %r14 movq %rbx, %rdi movl %r15d, %esi movl $0x1, %edx movq %rcx, (%rsp) callq 0xb4b0 movq (%rsp), %rcx addq 0x30(%rbx), %r14 jmp 0xbdbd
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_callnoyield
void luaD_callnoyield (lua_State *L, StkId func, int nResults) { ccall(L, func, nResults, nyci); }
pushq %rbp pushq %r14 pushq %rbx subq $0x10, %rsp movl %edx, %ebp movq %rdi, %rbx movl $0x10001, %eax # imm = 0x10001 addl 0xb0(%rdi), %eax movl %eax, 0xb0(%rdi) andl $0xfff8, %eax # imm = 0xFFF8 cmpl $0xc8, %eax jae 0xbfd8 movq %rbx, %rdi movl %ebp, %edx callq 0xbd1e testq %rax, %rax je 0xbfc5 orb $0x1, 0x3e(%rax) movq %rbx, %rdi movq %rax, %rsi callq 0x1eb29 addl $0xfffeffff, 0xb0(%rbx) # imm = 0xFFFEFFFF addq $0x10, %rsp popq %rbx popq %r14 popq %rbp retq leaq 0x8(%rsp), %r14 movq %rbx, %rdi movq %r14, %rdx callq 0x580f movq (%r14), %rsi jmp 0xbfa7
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
lua_resume
LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, int *nresults) { TStatus status; lua_lock(L); if (L->status == LUA_OK) { /* may be starting a coroutine */ if (L->ci != &L->base_ci) /* not in base level? */ return resume_error(L, "cannot resume non-suspended coroutine", nargs); else if (L->top.p - (L->ci->func.p + 1) == nargs) /* no function? */ return resume_error(L, "cannot resume dead coroutine", nargs); } else if (L->status != LUA_YIELD) /* ended with errors? */ return resume_error(L, "cannot resume dead coroutine", nargs); L->nCcalls = (from) ? getCcalls(from) : 0; if (getCcalls(L) >= LUAI_MAXCCALLS) return resume_error(L, "C stack overflow", nargs); L->nCcalls++; luai_userstateresume(L, nargs); api_checkpop(L, (L->status == LUA_OK) ? nargs + 1 : nargs); status = luaD_rawrunprotected(L, resume, &nargs); /* continue running after recoverable errors */ status = precover(L, status); if (l_likely(!errorstatus(status))) lua_assert(status == L->status); /* normal end or yield */ else { /* unrecoverable error */ L->status = status; /* mark thread as 'dead' */ luaD_seterrorobj(L, status, L->top.p); /* push error message */ L->ci->top.p = L->top.p; } *nresults = (status == LUA_YIELD) ? L->ci->u2.nyield : cast_int(L->top.p - (L->ci->func.p + 1)); lua_unlock(L); return APIstatus(status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x10, %rsp movq %rcx, %r14 movq %rdi, %rbx movl %edx, 0xc(%rsp) movzbl 0xb(%rdi), %eax cmpl $0x1, %eax je 0xc098 testl %eax, %eax jne 0xc03c movq 0x10(%rbx), %r15 movq 0x20(%rbx), %rax leaq 0x60(%rbx), %rcx cmpq %rcx, %rax je 0xc05a movslq %edx, %rax shlq $0x4, %rax subq %rax, %r15 movq %r15, 0x10(%rbx) leaq 0x1da56(%rip), %rsi # 0x29a90 jmp 0xc082 movq 0x10(%rbx), %r14 movslq %edx, %r15 shlq $0x4, %r15 movq %r14, %r12 subq %r15, %r12 movq %r12, 0x10(%rbx) leaq 0x1da5e(%rip), %rsi # 0x29ab6 jmp 0xc0d1 movq %r15, %rcx subq (%rax), %rcx addq $-0x10, %rcx sarq $0x4, %rcx movslq %edx, %rax cmpq %rax, %rcx jne 0xc098 shlq $0x4, %rax subq %rax, %r15 movq %r15, 0x10(%rbx) leaq 0x1da34(%rip), %rsi # 0x29ab6 movq %rbx, %rdi callq 0x1734a movq %rax, (%r15) movb 0x8(%rax), %al orb $0x40, %al movb %al, 0x8(%r15) jmp 0xc0ea testq %rsi, %rsi je 0xc0a6 movzwl 0xb0(%rsi), %eax jmp 0xc0a8 xorl %eax, %eax movl %eax, 0xb0(%rbx) cmpl $0xc8, %eax jb 0xc103 movq 0x10(%rbx), %r14 movslq %edx, %r15 shlq $0x4, %r15 movq %r14, %r12 subq %r15, %r12 movq %r12, 0x10(%rbx) leaq 0x1da02(%rip), %rsi # 0x29ad3 movq %rbx, %rdi callq 0x1734a movq %rax, (%r12) movb 0x8(%rax), %al orb $0x40, %al negq %r15 movb %al, 0x8(%r14,%r15) addq $0x10, 0x10(%rbx) movl $0x2, %ebp movl %ebp, %eax addq $0x10, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq incl %eax movl %eax, 0xb0(%rbx) leaq 0xa0(%rip), %rsi # 0xc1b2 leaq 0xc(%rsp), %rdx movq %rbx, %rdi callq 0xb2aa cmpb $0x2, %al jb 0xc170 movl $0xffff8fff, %ebp # imm = 0xFFFF8FFF leaq 0x496(%rip), %r15 # 0xc5c5 movq 0x20(%rbx), %rcx testq %rcx, %rcx je 0xc144 testb $0x20, 0x3e(%rcx) jne 0xc146 movq 0x10(%rcx), %rcx jmp 0xc133 xorl %ecx, %ecx testq %rcx, %rcx je 0xc170 movzbl %al, %eax movq %rcx, 0x20(%rbx) movl 0x3c(%rcx), %edx andl %ebp, %edx shll $0xc, %eax orl %edx, %eax movl %eax, 0x3c(%rcx) movq %rbx, %rdi movq %r15, %rsi xorl %edx, %edx callq 0xb2aa cmpb $0x1, %al ja 0xc12f movzbl %al, %ebp cmpb $0x2, %bpl jae 0xc1a2 cmpl $0x1, %ebp jne 0xc187 movq 0x20(%rbx), %rax movl 0x38(%rax), %eax jmp 0xc19a movq 0x10(%rbx), %rax movq 0x20(%rbx), %rcx subq (%rcx), %rax addq $-0x10, %rax shrq $0x4, %rax movl %eax, (%r14) jmp 0xc0f4 leaq 0xb(%rbx), %rsi movl %ebp, %edi movq %rbx, %rdx callq 0x5852 jmp 0xc179
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
resume
static void resume (lua_State *L, void *ud) { int n = *(cast(int*, ud)); /* number of arguments */ StkId firstArg = L->top.p - n; /* first argument */ CallInfo *ci = L->ci; if (L->status == LUA_OK) /* starting a coroutine? */ ccall(L, firstArg - 1, LUA_MULTRET, 0); /* just call its body */ else { /* resuming from previous yield */ lua_assert(L->status == LUA_YIELD); L->status = LUA_OK; /* mark that it is running (again) */ if (isLua(ci)) { /* yielded inside a hook? */ /* undo increment made by 'luaG_traceexec': instruction was not executed yet */ lua_assert(ci->callstatus & CIST_HOOKYIELD); ci->u.l.savedpc--; L->top.p = firstArg; /* discard arguments */ luaV_execute(L, ci); /* just continue running Lua code */ } else { /* 'common' yield */ if (ci->u.c.k != NULL) { /* does it have a continuation function? */ lua_unlock(L); n = (*ci->u.c.k)(L, LUA_YIELD, ci->u.c.ctx); /* call continuation */ lua_lock(L); api_checknelems(L, n); } luaD_poscall(L, ci, n); /* finish 'luaD_call' */ } unroll(L, NULL); /* run continuation */ } }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movslq (%rsi), %rdx movq 0x10(%rdi), %rax movq %rdx, %rcx shlq $0x4, %rcx movq %rax, %r14 subq %rcx, %r14 cmpb $0x0, 0xb(%rdi) je 0xc200 movq 0x20(%rbx), %r15 movb $0x0, 0xb(%rbx) testb $-0x80, 0x3d(%r15) movq 0x20(%r15), %rax jne 0xc240 addq $-0x4, %rax movq %rax, 0x20(%r15) movq %r14, 0x10(%rbx) movq %rbx, %rdi movq %r15, %rsi callq 0x1eb29 jmp 0xc260 addq $-0x10, %r14 movl $0xfff8, %ecx # imm = 0xFFF8 andl 0xb0(%rbx), %ecx cmpl $0xc8, %ecx jae 0xc273 movq %rbx, %rdi movq %r14, %rsi movl $0xffffffff, %edx # imm = 0xFFFFFFFF callq 0xbd1e testq %rax, %rax je 0xc26d orb $0x1, 0x3e(%rax) movq %rbx, %rdi movq %rax, %rsi popq %rbx popq %r14 popq %r15 jmp 0x1eb29 testq %rax, %rax je 0xc255 movq 0x30(%r15), %rdx movq %rbx, %rdi movl $0x1, %esi callq *%rax movl %eax, %edx movq %rbx, %rdi movq %r15, %rsi callq 0xb730 movq %rbx, %rdi popq %rbx popq %r14 popq %r15 jmp 0xc5c5 popq %rbx popq %r14 popq %r15 retq movq 0x28(%rbx), %rcx subq %rax, %rcx cmpq $0xf, %rcx jle 0xc28a movq %rbx, %rdi callq 0x166c7 jmp 0xc217 subq 0x30(%rbx), %r14 movq %rbx, %rdi xorl %esi, %esi movl $0x1, %edx callq 0xb4b0 addq 0x30(%rbx), %r14 jmp 0xc280
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
lua_yieldk
LUA_API int lua_yieldk (lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k) { CallInfo *ci; luai_userstateyield(L, nresults); lua_lock(L); ci = L->ci; api_checkpop(L, nresults); if (l_unlikely(!yieldable(L))) { if (L != mainthread(G(L))) luaG_runerror(L, "attempt to yield across a C-call boundary"); else luaG_runerror(L, "attempt to yield from outside a coroutine"); } L->status = LUA_YIELD; ci->u2.nyield = nresults; /* save number of results */ if (isLua(ci)) { /* inside a hook? */ lua_assert(!isLuacode(ci)); api_check(L, nresults == 0, "hooks cannot yield values"); api_check(L, k == NULL, "hooks cannot continue after yielding"); } else { if ((ci->u.c.k = k) != NULL) /* is there a continuation? */ ci->u.c.ctx = ctx; /* save context */ luaD_throw(L, LUA_YIELD); } lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */ lua_unlock(L); return 0; /* return to 'luaD_hook' */ }
pushq %rax cmpl $0x10000, 0xb0(%rdi) # imm = 0x10000 jae 0xc2d5 movq 0x20(%rdi), %rax movb $0x1, 0xb(%rdi) movl %esi, 0x38(%rax) testb $-0x80, 0x3d(%rax) jne 0xc2da xorl %eax, %eax popq %rcx retq callq 0x5893 movq %rcx, 0x20(%rax) testq %rcx, %rcx je 0xc2e7 movq %rdx, 0x30(%rax) movl $0x1, %esi callq 0xb220
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_closeprotected
TStatus luaD_closeprotected (lua_State *L, ptrdiff_t level, TStatus status) { CallInfo *old_ci = L->ci; lu_byte old_allowhooks = L->allowhook; for (;;) { /* keep closing upvalues until no more errors */ struct CloseP pcl; pcl.level = restorestack(L, level); pcl.status = status; status = luaD_rawrunprotected(L, &closepaux, &pcl); if (l_likely(status == LUA_OK)) /* no more errors? */ return pcl.status; else { /* an error occurred; restore saved state and repeat */ L->ci = old_ci; L->allowhook = old_allowhooks; } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl %edx, %eax movq %rsi, %rbx movq %rdi, %r14 movq 0x20(%rdi), %rcx movq %rcx, (%rsp) movb 0xa(%rdi), %r13b leaq 0x51(%rip), %r15 # 0xc36b leaq 0x8(%rsp), %r12 movq 0x30(%r14), %rcx addq %rbx, %rcx movq %rcx, 0x8(%rsp) movb %al, 0x10(%rsp) movq %r14, %rdi movq %r15, %rsi movq %r12, %rdx callq 0xb2aa testb %al, %al jne 0xc34c movb 0x10(%rsp), %bpl testb %al, %al jne 0xc31f jmp 0xc35a movq (%rsp), %rcx movq %rcx, 0x20(%r14) movb %r13b, 0xa(%r14) jmp 0xc346 movl %ebp, %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_pcall
TStatus luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t old_top, ptrdiff_t ef) { TStatus status; CallInfo *old_ci = L->ci; lu_byte old_allowhooks = L->allowhook; ptrdiff_t old_errfunc = L->errfunc; L->errfunc = ef; status = luaD_rawrunprotected(L, func, u); if (l_unlikely(status != LUA_OK)) { /* an error occurred? */ L->ci = old_ci; L->allowhook = old_allowhooks; status = luaD_closeprotected(L, old_top, status); luaD_seterrorobj(L, status, restorestack(L, old_top)); luaD_shrinkstack(L); /* restore stack size in case of overflow */ } L->errfunc = old_errfunc; return status; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rcx, %r14 movq %rdi, %rbx movq 0x20(%rdi), %r12 movb 0xa(%rdi), %r13b movq 0xa8(%rdi), %r15 movq %r8, 0xa8(%rdi) callq 0xb2aa movl %eax, %ebp testb %al, %al jne 0xc3c6 movq %r15, 0xa8(%rbx) movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %r12, 0x20(%rbx) movb %r13b, 0xa(%rbx) movzbl %bpl, %edx movq %rbx, %rdi movq %r14, %rsi callq 0xc2f1 movl %eax, %ebp addq 0x30(%rbx), %r14 cmpb $0x4, %al jne 0xc3fc movq 0x18(%rbx), %rax movq 0x108(%rax), %rax movq %rax, (%r14) movb 0x8(%rax), %al orb $0x40, %al jmp 0xc40a movq 0x10(%rbx), %rax movq -0x10(%rax), %rcx movq %rcx, (%r14) movb -0x8(%rax), %al movb %al, 0x8(%r14) addq $0x10, %r14 movq %r14, 0x10(%rbx) movq %rbx, %rdi callq 0xb551 jmp 0xc3ae
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaD_protectedparser
TStatus luaD_protectedparser (lua_State *L, ZIO *z, const char *name, const char *mode) { struct SParser p; TStatus status; incnny(L); /* cannot yield during parsing */ p.z = z; p.name = name; p.mode = mode; p.dyd.actvar.arr = NULL; p.dyd.actvar.size = 0; p.dyd.gt.arr = NULL; p.dyd.gt.size = 0; p.dyd.label.arr = NULL; p.dyd.label.size = 0; luaZ_initbuffer(L, &p.buff); status = luaD_pcall(L, f_parser, &p, savestack(L, L->top.p), L->errfunc); luaZ_freebuffer(L, &p.buff); luaM_freearray(L, p.dyd.actvar.arr, cast_sizet(p.dyd.actvar.size)); luaM_freearray(L, p.dyd.gt.arr, cast_sizet(p.dyd.gt.size)); luaM_freearray(L, p.dyd.label.arr, cast_sizet(p.dyd.label.size)); decnny(L); return status; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x68, %rsp movq %rdi, %rbx addl $0x10000, 0xb0(%rdi) # imm = 0x10000 leaq 0x8(%rsp), %r14 movq %rsi, (%r14) movq %rdx, 0x58(%r14) movq %rcx, 0x50(%r14) xorl %r15d, %r15d movl %r15d, 0x2c(%r14) movq %r15, 0x30(%r14) movl %r15d, 0x3c(%r14) movq %r15, 0x40(%r14) movl %r15d, 0x4c(%r14) movq %r15, 0x8(%r14) xorps %xmm0, %xmm0 movups %xmm0, 0x18(%r14) movq 0x10(%rdi), %rcx movq 0xa8(%rdi), %r8 subq 0x30(%rdi), %rcx leaq 0x83(%rip), %rsi # 0xc503 movq %r14, %rdx callq 0xc37c movl %eax, %ebp movq 0x8(%r14), %rsi movq 0x18(%r14), %rdx movq %rbx, %rdi xorl %ecx, %ecx callq 0x11247 movq %rax, 0x8(%r14) movq %r15, 0x18(%r14) movq 0x20(%r14), %rsi movslq 0x2c(%r14), %rax shlq $0x3, %rax leaq (%rax,%rax,2), %rdx movq %rbx, %rdi callq 0x112b5 movq 0x30(%r14), %rsi movslq 0x3c(%r14), %rax shlq $0x3, %rax leaq (%rax,%rax,2), %rdx movq %rbx, %rdi callq 0x112b5 movq 0x40(%r14), %rsi movslq 0x4c(%r14), %rax shlq $0x3, %rax leaq (%rax,%rax,2), %rdx movq %rbx, %rdi callq 0x112b5 addl $0xffff0000, 0xb0(%rbx) # imm = 0xFFFF0000 movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
f_parser
static void f_parser (lua_State *L, void *ud) { LClosure *cl; struct SParser *p = cast(struct SParser *, ud); const char *mode = p->mode ? p->mode : "bt"; int c = zgetc(p->z); /* read first character */ if (c == LUA_SIGNATURE[0]) { int fixed = 0; if (strchr(mode, 'B') != NULL) fixed = 1; else checkmode(L, mode, "binary"); cl = luaU_undump(L, p->z, p->name, fixed); } else { checkmode(L, mode, "text"); cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); } lua_assert(cl->nupvalues == cl->p->sizeupvalues); luaF_initupvals(L, cl); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rsi, %r14 movq %rdi, %rbx movq 0x50(%rsi), %rax testq %rax, %rax leaq 0x1d632(%rip), %r15 # 0x29b50 cmovneq %rax, %r15 movq (%rsi), %rdi subq $0x1, (%rdi) jae 0xc534 callq 0x22428 movl %eax, %ebp jmp 0xc543 movq 0x8(%rdi), %rax leaq 0x1(%rax), %rcx movq %rcx, 0x8(%rdi) movzbl (%rax), %ebp cmpl $0x1b, %ebp jne 0xc584 movq %r15, %rdi movl $0x42, %esi callq 0x5140 movl $0x1, %ecx testq %rax, %rax jne 0xc573 leaq 0x1d5ed(%rip), %rdx # 0x29b53 movq %rbx, %rdi movq %r15, %rsi callq 0xc6f2 xorl %ecx, %ecx movq (%r14), %rsi movq 0x58(%r14), %rdx movq %rbx, %rdi callq 0x1d04c jmp 0xc5b0 leaq 0x1d5cf(%rip), %rdx # 0x29b5a movq %rbx, %rdi movq %r15, %rsi callq 0xc6f2 leaq 0x8(%r14), %rdx leaq 0x20(%r14), %rcx movq (%r14), %rsi movq 0x58(%r14), %r8 movq %rbx, %rdi movl %ebp, %r9d callq 0x1385f movq %rbx, %rdi movq %rax, %rsi addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0xd02c
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
unroll
static void unroll (lua_State *L, void *ud) { CallInfo *ci; UNUSED(ud); while ((ci = L->ci) != &L->base_ci) { /* something in the stack */ if (!isLua(ci)) /* C function? */ finishCcall(L, ci); /* complete its execution */ else { /* Lua function */ luaV_finishOp(L); /* finish interrupted instruction */ luaV_execute(L, ci); /* execute down to higher C 'boundary' */ } } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax leaq 0x60(%rdi), %r15 movq 0x20(%rdi), %r14 cmpq %r15, %r14 je 0xc6e3 movq %rdi, %rbx movl 0x3c(%r14), %eax testw %ax, %ax js 0xc602 movq %rbx, %rdi callq 0x1ea24 movq %rbx, %rdi movq %r14, %rsi callq 0x1eb29 jmp 0xc65f btl $0x11, %eax jb 0xc650 movq 0x20(%r14), %r12 movl $0x1, %ebp btl $0x15, %eax jae 0xc62e testl $0x7000, %eax # imm = 0x7000 jne 0xc66e andb $-0x21, 0x3e(%r14) movq 0x28(%r14), %rax movq %rax, 0xa8(%rbx) movq 0x10(%rbx), %rax movq 0x20(%rbx), %rcx cmpq %rax, 0x8(%rcx) jae 0xc640 movq %rax, 0x8(%rcx) movq 0x30(%r14), %rdx movq %rbx, %rdi movl %ebp, %esi callq *%r12 movl %eax, %edx jmp 0xc654 movl 0x38(%r14), %edx movq %rbx, %rdi movq %r14, %rsi callq 0xb730 movq 0x20(%rbx), %r14 cmpq %r15, %r14 jne 0xc5e4 jmp 0xc6e3 movl %eax, %ebp shrl $0xc, %ebp movl %ebp, %r13d movslq 0x38(%r14), %rsi addq 0x30(%rbx), %rsi andb $0x7, %r13b shrl $0x13, %eax andb $0x1, %al movb %al, 0xa(%rbx) andl $0x7, %ebp movq %rbx, %rdi movl %ebp, %edx movl $0x1, %ecx callq 0xd26c cmpb $0x4, %r13b jne 0xc6b8 movq 0x18(%rbx), %rcx movq 0x108(%rcx), %rcx movq %rcx, (%rax) movb 0x8(%rcx), %cl orb $0x40, %cl jmp 0xc6c6 movq 0x10(%rbx), %rcx movq -0x10(%rcx), %rdx movq %rdx, (%rax) movb -0x8(%rcx), %cl movb %cl, 0x8(%rax) addq $0x10, %rax movq %rax, 0x10(%rbx) movq %rbx, %rdi callq 0xb551 andb $-0x71, 0x3d(%r14) jmp 0xc61e addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldo.c
luaU_dump
int luaU_dump (lua_State *L, const Proto *f, lua_Writer w, void *data, int strip) { DumpState D; D.h = luaH_new(L); /* aux. table to keep strings already dumped */ sethvalue2s(L, L->top.p, D.h); /* anchor it */ L->top.p++; D.L = L; D.writer = w; D.offset = 0; D.data = data; D.strip = strip; D.status = 0; D.nstr = 0; dumpHeader(&D); dumpByte(&D, f->sizeupvalues); dumpFunction(&D, f); dumpBlock(&D, NULL, 0); /* signal end of dump */ return D.status; }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x50, %rsp movl %r8d, %ebp movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r12 callq 0x1ad47 movq %rax, 0x40(%rsp) movq 0x10(%r12), %rcx movq %rax, (%rcx) movb $0x45, 0x8(%rcx) addq $0x10, 0x10(%r12) movq %r12, 0x18(%rsp) movq %r15, 0x20(%rsp) xorl %eax, %eax movq %rax, 0x30(%rsp) movq %r14, 0x28(%rsp) movl %ebp, 0x38(%rsp) movl $0x0, 0x3c(%rsp) movq %rax, 0x48(%rsp) leaq 0x1d3e8(%rip), %rsi # 0x29b89 movl $0x4, %edx movq %r12, %rdi movq %r14, %rcx callq *%r15 movl %eax, 0x3c(%rsp) addq $0x4, 0x30(%rsp) movb $0x55, 0x10(%rsp) testl %eax, %eax jne 0xc7e3 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) movb $0x0, 0x10(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc810 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc83b movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x1d366(%rip), %rsi # 0x29b8e movl $0x6, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) addq $0x6, 0x30(%rsp) movl $0xffffa988, 0x10(%rsp) # imm = 0xFFFFA988 movb $0x4, 0xf(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc870 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0xf(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc899 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x4, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) addq $0x4, 0x30(%rsp) movl $0x12345678, 0x10(%rsp) # imm = 0x12345678 movb $0x4, 0xf(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc8ce movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0xf(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc8f7 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x4, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) addq $0x4, 0x30(%rsp) movq $-0x5678, 0x10(%rsp) # imm = 0xA988 movb $0x8, 0xf(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc92d movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0xf(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc956 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x8, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) addq $0x8, 0x30(%rsp) movabsq $-0x3f88d80000000000, %rax # imm = 0xC077280000000000 movq %rax, 0x10(%rsp) movb $0x8, 0xf(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc992 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0xf(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc9bb movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x8, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) addq $0x8, 0x30(%rsp) movb 0x10(%rbx), %al movb %al, 0x10(%rsp) cmpl $0x0, 0x3c(%rsp) jne 0xc9ea movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx leaq 0x10(%rsp), %rsi movl $0x1, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) incq 0x30(%rsp) leaq 0x18(%rsp), %r14 movq %r14, %rdi movq %rbx, %rsi callq 0xca28 cmpl $0x0, 0x24(%r14) jne 0xca17 movq 0x18(%rsp), %rdi movq 0x28(%rsp), %rcx xorl %esi, %esi xorl %edx, %edx callq *0x20(%rsp) movl %eax, 0x3c(%rsp) movl 0x3c(%rsp), %eax addq $0x50, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldump.c
dumpFunction
static void dumpFunction (DumpState *D, const Proto *f) { dumpInt(D, f->linedefined); dumpInt(D, f->lastlinedefined); dumpByte(D, f->numparams); dumpByte(D, f->flag); dumpByte(D, f->maxstacksize); dumpCode(D, f); dumpConstants(D, f); dumpUpvalues(D, f); dumpProtos(D, f); dumpString(D, D->strip ? NULL : f->source); dumpDebug(D, f); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movslq 0x2c(%rsi), %rsi callq 0xcef2 movslq 0x30(%rbx), %rsi movq %r14, %rdi callq 0xcef2 movb 0xa(%rbx), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xca76 movq (%r14), %rdi movq 0x10(%r14), %rcx movq %rsp, %rsi movl $0x1, %edx callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) movb 0xb(%rbx), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xca9e movq (%r14), %rdi movq 0x10(%r14), %rcx movq %rsp, %rsi movl $0x1, %edx callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) movb 0xc(%rbx), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcac6 movq (%r14), %rdi movq 0x10(%r14), %rcx movq %rsp, %rsi movl $0x1, %edx callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) movslq 0x18(%rbx), %rsi movq %r14, %rdi callq 0xcef2 movq %r14, %rdi callq 0xcf6e cmpl $0x0, 0x24(%r14) jne 0xcb03 movl 0x18(%rbx), %r15d shlq $0x2, %r15 movq 0x40(%rbx), %rsi movq (%r14), %rdi movq 0x10(%r14), %rcx movq %r15, %rdx callq *0x8(%r14) movl %eax, 0x24(%r14) addq %r15, 0x18(%r14) movslq 0x14(%rbx), %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testq %r15, %r15 jle 0xcbcc shlq $0x4, %r15 xorl %r13d, %r13d movq 0x38(%rbx), %rbp movzbl 0x8(%rbp,%r13), %r12d andl $0x3f, %r12d movb %r12b, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcb56 movq (%r14), %rdi movq 0x10(%r14), %rcx movl $0x1, %edx movq %rsp, %rsi callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) cmpl $0x12, %r12d jg 0xcb6a cmpl $0x3, %r12d je 0xcb93 cmpl $0x4, %r12d je 0xcb84 jmp 0xcbbf cmpl $0x14, %r12d je 0xcb84 cmpl $0x13, %r12d jne 0xcbbf movsd (%rbp,%r13), %xmm0 movsd %xmm0, (%rsp) jmp 0xcb9c movq (%rbp,%r13), %rsi movq %r14, %rdi callq 0xce11 jmp 0xcbbf movq (%rbp,%r13), %rax movq %rax, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcbbf movq (%r14), %rdi movq 0x10(%r14), %rcx movl $0x8, %edx movq %rsp, %rsi callq *0x8(%r14) movl %eax, 0x24(%r14) addq $0x8, 0x18(%r14) addq $0x10, %r13 cmpq %r13, %r15 jne 0xcb22 movslq 0x10(%rbx), %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testq %r15, %r15 jle 0xcc85 shlq $0x4, %r15 xorl %r13d, %r13d movq %rsp, %r12 movq 0x50(%rbx), %rax movb 0x8(%rax,%r13), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcc1c movq (%r14), %rdi movq 0x10(%r14), %rcx movl $0x1, %edx movq %r12, %rsi callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) movq 0x50(%rbx), %rax movb 0x9(%rax,%r13), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcc4a movq (%r14), %rdi movq 0x10(%r14), %rcx movl $0x1, %edx movq %r12, %rsi callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) movq 0x50(%rbx), %rax movb 0xa(%rax,%r13), %al movb %al, (%rsp) cmpl $0x0, 0x24(%r14) jne 0xcc78 movq (%r14), %rdi movq 0x10(%r14), %rcx movl $0x1, %edx movq %r12, %rsi callq *0x8(%r14) movl %eax, 0x24(%r14) incq 0x18(%r14) addq $0x10, %r13 cmpq %r13, %r15 jne 0xcbee movslq 0x20(%rbx), %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testq %r15, %r15 jle 0xccb4 xorl %r12d, %r12d movq 0x48(%rbx), %rax movq (%rax,%r12,8), %rsi movq %r14, %rdi callq 0xca28 incq %r12 cmpq %r12, %r15 jne 0xcc9c xorl %r15d, %r15d cmpl $0x0, 0x20(%r14) je 0xccc2 xorl %esi, %esi jmp 0xccc6 movq 0x70(%rbx), %rsi movq %r14, %rdi callq 0xce11 cmpl $0x0, 0x20(%r14) jne 0xccd9 movl 0x1c(%rbx), %r15d movslq %r15d, %rsi movq %r14, %rdi callq 0xcef2 movq 0x58(%rbx), %rsi testq %rsi, %rsi je 0xcd0d cmpl $0x0, 0x24(%r14) jne 0xcd0d movl %r15d, %r15d movq (%r14), %rdi movq 0x10(%r14), %rcx movq %r15, %rdx callq *0x8(%r14) movl %eax, 0x24(%r14) addq %r15, 0x18(%r14) xorl %ebp, %ebp cmpl $0x0, 0x20(%r14) jne 0xcd19 movl 0x28(%rbx), %ebp movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testl %r15d, %r15d jle 0xcd5c movq %r14, %rdi callq 0xcf6e cmpl $0x0, 0x24(%r14) jne 0xcd5c movl %ebp, %r15d shlq $0x3, %r15 movq 0x60(%rbx), %rsi movq (%r14), %rdi movq 0x10(%r14), %rcx movq %r15, %rdx callq *0x8(%r14) movl %eax, 0x24(%r14) addq %r15, 0x18(%r14) xorl %ebp, %ebp cmpl $0x0, 0x20(%r14) jne 0xcd68 movl 0x24(%rbx), %ebp movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testl %r15d, %r15d jle 0xcdc0 movl %ebp, %r15d shlq $0x4, %r15 xorl %r12d, %r12d movq 0x68(%rbx), %rax movq (%rax,%r12), %rsi movq %r14, %rdi callq 0xce11 movq 0x68(%rbx), %rax movslq 0x8(%rax,%r12), %rsi movq %r14, %rdi callq 0xcef2 movq 0x68(%rbx), %rax movslq 0xc(%rax,%r12), %rsi movq %r14, %rdi callq 0xcef2 addq $0x10, %r12 cmpq %r12, %r15 jne 0xcd85 xorl %ebp, %ebp cmpl $0x0, 0x20(%r14) jne 0xcdcc movl 0x10(%rbx), %ebp movslq %ebp, %r15 movq %r14, %rdi movq %r15, %rsi callq 0xcef2 testl %r15d, %r15d jle 0xce02 movl %ebp, %r15d shlq $0x4, %r15 xorl %r12d, %r12d movq 0x50(%rbx), %rax movq (%rax,%r12), %rsi movq %r14, %rdi callq 0xce11 addq $0x10, %r12 cmpq %r12, %r15 jne 0xcde9 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldump.c
dumpString
static void dumpString (DumpState *D, TString *ts) { if (ts == NULL) dumpSize(D, 0); else { TValue idx; int tag = luaH_getstr(D->h, ts, &idx); if (!tagisempty(tag)) { /* string already saved? */ dumpSize(D, 1); /* reuse a saved string */ dumpSize(D, cast_sizet(ivalue(&idx))); /* index of saved string */ } else { /* must write and save the string */ TValue key, value; /* to save the string in the hash */ size_t size; const char *s = getlstr(ts, size); dumpSize(D, size + 2); dumpVector(D, s, size + 1); /* include ending '\0' */ D->nstr++; /* one more saved string */ setsvalue(D->L, &key, ts); /* the string is the key */ setivalue(&value, D->nstr); /* its index is the value */ luaH_set(D->L, D->h, &key, &value); /* h[ts] = nstr */ /* integer value does not need barrier */ } } }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x38, %rsp movq %rdi, %rbx testq %rsi, %rsi je 0xce58 movq %rsi, %r14 movq 0x28(%rbx), %rdi leaq 0x8(%rsp), %rdx callq 0x1af59 testb $0xf, %al je 0xce6d movl $0x1, %esi movq %rbx, %rdi callq 0xcef2 movq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0xcef2 jmp 0xcee6 movq %rbx, %rdi xorl %esi, %esi addq $0x38, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0xcef2 movsbq 0xb(%r14), %r15 testq %r15, %r15 js 0xce7d leaq 0x18(%r14), %r12 jmp 0xce85 movq 0x10(%r14), %r15 movq 0x18(%r14), %r12 leaq 0x2(%r15), %rsi movq %rbx, %rdi callq 0xcef2 cmpl $0x0, 0x24(%rbx) jne 0xceb1 incq %r15 movq (%rbx), %rdi movq 0x10(%rbx), %rcx movq %r12, %rsi movq %r15, %rdx callq *0x8(%rbx) movl %eax, 0x24(%rbx) addq %r15, 0x18(%rbx) movq 0x30(%rbx), %rax incq %rax movq %rax, 0x30(%rbx) leaq 0x28(%rsp), %rdx movq %r14, (%rdx) movb 0x8(%r14), %cl orb $0x40, %cl movb %cl, 0x8(%rdx) leaq 0x18(%rsp), %rcx movq %rax, (%rcx) movb $0x3, 0x8(%rcx) movq (%rbx), %rdi movq 0x28(%rbx), %rsi callq 0x1b943 addq $0x38, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldump.c
dumpVarint
static void dumpVarint (DumpState *D, size_t x) { lu_byte buff[DIBS]; unsigned n = 1; buff[DIBS - 1] = x & 0x7f; /* fill least-significant byte */ while ((x >>= 7) != 0) /* fill other bytes in reverse order */ buff[DIBS - (++n)] = cast_byte((x & 0x7f) | 0x80); dumpVector(D, buff + DIBS - n, n); }
pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx movl %esi, %eax andb $0x7f, %al movb %al, 0x17(%rsp) movl $0x1, %r14d cmpq $0x80, %rsi jb 0xcf40 movq $-0x1, %r14 movq %rsi, %rax shrq $0x7, %rax movl %eax, %ecx orb $-0x80, %cl leal 0x9(%r14), %edx movb %cl, 0xe(%rsp,%rdx) decq %r14 cmpq $0x3fff, %rsi # imm = 0x3FFF movq %rax, %rsi ja 0xcf1d negq %r14 cmpl $0x0, 0x24(%rbx) jne 0xcf66 leaq 0xe(%rsp), %rsi subq %r14, %rsi addq $0xa, %rsi movq (%rbx), %rdi movq 0x10(%rbx), %rcx movq %r14, %rdx callq *0x8(%rbx) movl %eax, 0x24(%rbx) addq %r14, 0x18(%rbx) addq $0x18, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/ldump.c
dumpAlign
static void dumpAlign (DumpState *D, unsigned align) { unsigned padding = align - cast_uint(D->offset % align); if (padding < align) { /* padding == align means no padding */ static lua_Integer paddingContent = 0; lua_assert(align <= sizeof(lua_Integer)); dumpBlock(D, &paddingContent, padding); } lua_assert(D->offset % align == 0); }
movl 0x18(%rdi), %eax andl $0x3, %eax je 0xcfae pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx cmpl $0x0, 0x24(%rdi) jne 0xcfa7 movl $0x4, %r14d subl %eax, %r14d movq (%rbx), %rdi movq 0x10(%rbx), %rcx leaq 0x2d3be(%rip), %rsi # 0x3a358 movq %r14, %rdx callq *0x8(%rbx) movl %eax, 0x24(%rbx) addq %r14, 0x18(%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq nop
/mmanyen[P]CLua/build_O1/_deps/lua/ldump.c
luaF_newLclosure
LClosure *luaF_newLclosure (lua_State *L, int nupvals) { GCObject *o = luaC_newobj(L, LUA_VLCL, sizeLclosure(nupvals)); LClosure *c = gco2lcl(o); c->p = NULL; c->nupvalues = cast_byte(nupvals); while (nupvals--) c->upvals[nupvals] = NULL; return c; }
pushq %r15 pushq %r14 pushq %rbx movl %esi, %r15d movl %esi, %ebx leaq 0x20(,%rbx,8), %rdx movl $0x6, %esi callq 0xd734 movq %rax, %r14 movq $0x0, 0x18(%rax) movb %r15b, 0xa(%rax) testl %r15d, %r15d je 0xd023 decl %r15d movslq %r15d, %rax shlq $0x3, %rax shlq $0x3, %r15 subq %r15, %rax leaq (%rax,%r14), %rdi addq $0x20, %rdi shlq $0x3, %rbx xorl %esi, %esi movq %rbx, %rdx callq 0x51d0 movq %r14, %rax popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
luaF_initupvals
void luaF_initupvals (lua_State *L, LClosure *cl) { int i; for (i = 0; i < cl->nupvalues; i++) { GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); UpVal *uv = gco2upv(o); uv->v.p = &uv->u.value; /* make it closed */ setnilvalue(uv->v.p); cl->upvals[i] = uv; luaC_objbarrier(L, cl, uv); } }
cmpb $0x0, 0xa(%rsi) je 0xd08e pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 xorl %r15d, %r15d movl $0x28, %edx movq %r14, %rdi movl $0x9, %esi callq 0xd734 leaq 0x18(%rax), %rcx movq %rcx, 0x10(%rax) movb $0x0, 0x20(%rax) movq %rax, 0x20(%rbx,%r15,8) testb $0x20, 0x9(%rbx) je 0xd07d testb $0x18, 0x9(%rax) je 0xd07d movq %r14, %rdi movq %rbx, %rsi movq %rax, %rdx callq 0xd508 incq %r15 movzbl 0xa(%rbx), %eax cmpq %rax, %r15 jb 0xd040 popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
luaF_findupval
UpVal *luaF_findupval (lua_State *L, StkId level) { UpVal **pp = &L->openupval; UpVal *p; lua_assert(isintwups(L) || L->openupval == NULL); while ((p = *pp) != NULL && uplevel(p) >= level) { /* search for it */ lua_assert(!isdead(G(L), p)); if (uplevel(p) == level) /* corresponding upvalue? */ return p; /* return it */ pp = &p->u.open.next; } /* not found: create a new upvalue after 'pp' */ return newupval(L, level, pp); }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %rbx leaq 0x38(%rdi), %r15 movq 0x38(%rdi), %rcx testq %rcx, %rcx je 0xd0d1 movq 0x10(%rcx), %rdx cmpq %r14, %rdx jb 0xd0d1 movq %rcx, %rax cmpq %r14, %rdx je 0xd121 movq 0x18(%rax), %rcx testq %rcx, %rcx je 0xd0ca movq 0x10(%rcx), %rdx cmpq %r14, %rdx jae 0xd0b0 addq $0x18, %rax movq %rax, %r15 movl $0x28, %edx movq %rbx, %rdi movl $0x9, %esi callq 0xd734 movq (%r15), %rcx movq %r14, 0x10(%rax) movq %rcx, 0x18(%rax) movq %r15, 0x20(%rax) testq %rcx, %rcx je 0xd102 movq %rax, %rdx addq $0x18, %rdx movq %rdx, 0x20(%rcx) movq %rax, (%r15) cmpq %rbx, 0x50(%rbx) jne 0xd121 movq 0x18(%rbx), %rcx movq 0xf8(%rcx), %rdx movq %rdx, 0x50(%rbx) movq %rbx, 0xf8(%rcx) popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
luaF_newtbcupval
void luaF_newtbcupval (lua_State *L, StkId level) { lua_assert(level > L->tbclist.p); if (l_isfalse(s2v(level))) return; /* false doesn't need to be closed */ checkclosemth(L, level); /* value must have a close method */ while (cast_uint(level - L->tbclist.p) > MAXDELTA) { L->tbclist.p += MAXDELTA; /* create a dummy node at maximum delta */ L->tbclist.p->tbclist.delta = 0; } level->tbclist.delta = cast(unsigned short, level - L->tbclist.p); L->tbclist.p = level; }
pushq %r14 pushq %rbx pushq %rax movb 0x8(%rsi), %al cmpb $0x1, %al sete %cl testb $0xf, %al sete %al orb %cl, %al jne 0xd18d movq %rsi, %r14 movq %rdi, %rbx movl $0x18, %edx callq 0x1cb50 testb $0xf, 0x8(%rax) je 0xd195 movabsq $0xffff00000, %rax # imm = 0xFFFF00000 movq 0x40(%rbx), %rcx movq %r14, %rdx subq %rcx, %rdx testq %rax, %rdx je 0xd181 leaq 0xffff0(%rcx), %rdx movq %rdx, 0x40(%rbx) movw $0x0, 0xffffa(%rcx) jmp 0xd15c shrl $0x4, %edx movw %dx, 0xa(%r14) movq %r14, 0x40(%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq movq 0x20(%rbx), %rsi subq (%rsi), %r14 shrq $0x4, %r14 movq %rbx, %rdi movl %r14d, %edx xorl %ecx, %ecx callq 0x9fee testq %rax, %rax leaq 0x1c853(%rip), %rdx # 0x29a0a cmovneq %rax, %rdx leaq 0x1c9d3(%rip), %rsi # 0x29b95 movq %rbx, %rdi xorl %eax, %eax callq 0xa859
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
luaF_closeupval
void luaF_closeupval (lua_State *L, StkId level) { UpVal *uv; StkId upl; /* stack index pointed by 'uv' */ while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) { TValue *slot = &uv->u.value; /* new position for value */ lua_assert(uplevel(uv) < L->top.p); luaF_unlinkupval(uv); /* remove upvalue from 'openupval' list */ setobj(L, slot, uv->v.p); /* move value to upvalue slot */ uv->v.p = slot; /* now current value lives here */ if (!iswhite(uv)) { /* neither white nor dead? */ nw2black(uv); /* closed upvalues cannot be gray */ luaC_barrier(L, uv, slot); } } }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq 0x38(%rdi), %rsi testq %rsi, %rsi je 0xd264 movq %rdi, %r14 cmpq %rbx, 0x10(%rsi) jb 0xd264 movq 0x18(%rsi), %rax movq 0x20(%rsi), %rcx movq %rax, (%rcx) movq 0x18(%rsi), %rax testq %rax, %rax je 0xd21e movq 0x20(%rsi), %rcx movq %rcx, 0x20(%rax) leaq 0x18(%rsi), %rax movq 0x10(%rsi), %rcx movq (%rcx), %rdx movq %rdx, 0x18(%rsi) movb 0x8(%rcx), %cl movb %cl, 0x20(%rsi) movq %rax, 0x10(%rsi) movb 0x9(%rsi), %dl testb $0x18, %dl jne 0xd25b orb $0x20, %dl movb %dl, 0x9(%rsi) testb $0x40, %cl je 0xd25b movq (%rax), %rdx testb $0x18, 0x9(%rdx) je 0xd25b movq %r14, %rdi callq 0xd508 movq 0x38(%r14), %rsi testq %rsi, %rsi jne 0xd1fc addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
luaF_close
StkId luaF_close (lua_State *L, StkId level, TStatus status, int yy) { ptrdiff_t levelrel = savestack(L, level); luaF_closeupval(L, level); /* first, close the upvalues */ while (L->tbclist.p >= level) { /* traverse tbc's down to that level */ StkId tbc = L->tbclist.p; /* get variable index */ poptbclist(L); /* remove it from list */ prepcallclosemth(L, tbc, status, yy); /* close variable */ level = restorestack(L, levelrel); } return level; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %ecx, 0x4(%rsp) movl %edx, (%rsp) movq %rsi, %rbx movq %rdi, %r14 movq %rsi, %rbp subq 0x30(%rdi), %rbp callq 0xd1e9 movq 0x40(%r14), %r12 cmpq %rbx, %r12 jb 0xd383 movzbl (%rsp), %r15d movzwl 0xa(%r12), %ecx shll $0x4, %ecx movq %r12, %rax subq %rcx, %rax movq 0x30(%r14), %rcx cmpq %rcx, %rax jbe 0xd2c9 cmpw $0x0, 0xa(%rax) jne 0xd2c9 addq $-0xffff0, %rax # imm = 0xFFF00010 jmp 0xd2b5 movq %rax, 0x40(%r14) cmpb $0x6, (%rsp) je 0xd2e1 testl %r15d, %r15d jne 0xd2e5 leaq 0x10(%r12), %rax movq %rax, 0x10(%r14) xorl %ebx, %ebx jmp 0xd2f8 leaq 0x10(%r12), %rbx movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0xb1ec movq 0x10(%r14), %r13 movq %r14, %rdi movq %r12, %rsi movl $0x18, %edx callq 0x1cb50 movq (%rax), %rcx movq %rcx, (%r13) movb 0x8(%rax), %al movb %al, 0x8(%r13) movq (%r12), %rax movq %rax, 0x10(%r13) movb 0x8(%r12), %al movb %al, 0x18(%r13) testq %rbx, %rbx je 0xd344 leaq 0x30(%r13), %rax movq (%rbx), %rcx movq %rcx, 0x20(%r13) movb 0x8(%rbx), %cl movb %cl, 0x28(%r13) jmp 0xd348 leaq 0x20(%r13), %rax movq %rax, 0x10(%r14) cmpl $0x0, 0x4(%rsp) je 0xd362 movq %r14, %rdi movq %r13, %rsi xorl %edx, %edx callq 0xbf14 jmp 0xd36f movq %r14, %rdi movq %r13, %rsi xorl %edx, %edx callq 0xbf7d movq 0x30(%r14), %rbx addq %rbp, %rbx movq 0x40(%r14), %r12 cmpq %rbx, %r12 jae 0xd2a2 movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/lfunc.c
reallymarkobject
static void reallymarkobject (global_State *g, GCObject *o) { g->GCmarked += objsize(o); switch (o->tt) { case LUA_VSHRSTR: case LUA_VLNGSTR: { set2black(o); /* nothing to visit */ break; } case LUA_VUPVAL: { UpVal *uv = gco2upv(o); if (upisopen(uv)) set2gray(uv); /* open upvalues are kept gray */ else set2black(uv); /* closed upvalues are visited here */ markvalue(g, uv->v.p); /* mark its content */ break; } case LUA_VUSERDATA: { Udata *u = gco2u(o); if (u->nuvalue == 0) { /* no user values? */ markobjectN(g, u->metatable); /* mark its metatable */ set2black(u); /* nothing else to mark */ break; } /* else... */ } /* FALLTHROUGH */ case LUA_VLCL: case LUA_VCCL: case LUA_VTABLE: case LUA_VTHREAD: case LUA_VPROTO: { linkobjgclist(o, g->gray); /* to be visited later */ break; } default: lua_assert(0); break; } }
pushq %rbp pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 movq %rbx, %rdi callq 0xe110 addq %rax, 0x20(%r14) movzbl 0x8(%rbx), %eax cmpl $0x9, %eax jne 0xd5a7 movq 0x10(%rbx), %rax leaq 0x18(%rbx), %rcx movb 0x9(%rbx), %dl andb $-0x39, %dl leal 0x20(%rdx), %esi cmpq %rcx, %rax movzbl %dl, %ecx movzbl %sil, %edx cmovnel %ecx, %edx movb %dl, 0x9(%rbx) testb $0x40, 0x8(%rax) je 0xd5f2 movq (%rax), %rbx testb $0x18, 0x9(%rbx) jne 0xd560 jmp 0xd5f2 cmpl $0x26, %eax ja 0xd5f2 movl %eax, %eax movabsq $0x4000000560, %rcx # imm = 0x4000000560 btq %rax, %rcx jae 0xd5dd movq %rbx, %rdi callq 0xd684 movq 0x88(%r14), %rcx movq %rcx, (%rax) movq %rbx, 0x88(%r14) andb $-0x39, 0x9(%rbx) jmp 0xd5f2 movl $0x100010, %ecx # imm = 0x100010 btq %rax, %rcx jae 0xd5f7 movb 0x9(%rbx), %al andb $-0x39, %al orb $0x20, %al movb %al, 0x9(%rbx) popq %rbx popq %r14 popq %rbp retq cmpq $0x7, %rax jne 0xd5f2 movzwl 0xa(%rbx), %ebp testw %bp, %bp jne 0xd5be movq 0x18(%rbx), %rsi testq %rsi, %rsi je 0xd61d testb $0x18, 0x9(%rsi) je 0xd61d movq %r14, %rdi callq 0xd556 movb 0x9(%rbx), %al andb $-0x39, %al orb $0x20, %al movb %al, 0x9(%rbx) testw %bp, %bp jne 0xd5be jmp 0xd5f2
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
getgclist
static GCObject **getgclist (GCObject *o) { switch (o->tt) { case LUA_VTABLE: return &gco2t(o)->gclist; case LUA_VLCL: return &gco2lcl(o)->gclist; case LUA_VCCL: return &gco2ccl(o)->gclist; case LUA_VTHREAD: return &gco2th(o)->gclist; case LUA_VPROTO: return &gco2p(o)->gclist; case LUA_VUSERDATA: { Udata *u = gco2u(o); lua_assert(u->nuvalue > 0); return &u->gclist; } default: lua_assert(0); return 0; } }
movzbl 0x8(%rdi), %ecx xorl %eax, %eax leal -0x5(%rcx), %edx cmpl $0x5, %edx ja 0xd6a8 leaq 0x1c523(%rip), %rcx # 0x29bbc movslq (%rcx,%rdx,4), %rdx addq %rcx, %rdx jmpq *%rdx addq $0x28, %rdi jmp 0xd6c3 cmpl $0x26, %ecx jne 0xd6c6 addq $0x10, %rdi jmp 0xd6c3 addq $0x78, %rdi jmp 0xd6c3 addq $0x20, %rdi jmp 0xd6c3 addq $0x48, %rdi movq %rdi, %rax retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_fix
void luaC_fix (lua_State *L, GCObject *o) { global_State *g = G(L); lua_assert(g->allgc == o); /* object must be 1st in 'allgc' list! */ set2gray(o); /* they will be gray forever */ setage(o, G_OLD); /* and old forever */ g->allgc = o->next; /* remove object from 'allgc' list */ o->next = g->fixedgc; /* link it to 'fixedgc' list */ g->fixedgc = o; }
movq 0x18(%rdi), %rax movb 0x9(%rsi), %cl andb $-0x40, %cl orb $0x4, %cl movb %cl, 0x9(%rsi) movq (%rsi), %rcx movq %rcx, 0x70(%rax) movq 0xb8(%rax), %rcx movq %rcx, (%rsi) movq %rsi, 0xb8(%rax) retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_newobj
GCObject *luaC_newobj (lua_State *L, lu_byte tt, size_t sz) { return luaC_newobjdt(L, tt, sz, 0); }
pushq %r14 pushq %rbx pushq %rax movl %esi, %ebx movq 0x18(%rdi), %r14 movl %esi, %eax andl $0xf, %eax movq %rdx, %rsi movl %eax, %edx callq 0x11387 movb 0x6a(%r14), %cl andb $0x18, %cl movb %cl, 0x9(%rax) movb %bl, 0x8(%rax) movq 0x70(%r14), %rcx movq %rcx, (%rax) movq %rax, 0x70(%r14) addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_checkfinalizer
void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { global_State *g = G(L); if (tofinalize(o) || /* obj. is already marked... */ gfasttm(g, mt, TM_GC) == NULL || /* or has no finalizer... */ (g->gcstp & GCSTPCLS)) /* or closing state? */ return; /* nothing to be done */ else { /* move 'o' to 'finobj' list */ GCObject **p; if (issweepphase(g)) { makewhite(g, o); /* "sweep" object 'o' */ if (g->sweepgc == &o->next) /* should not remove 'sweepgc' object */ g->sweepgc = sweeptolive(L, g->sweepgc); /* change 'sweepgc' */ } else correctpointers(g, o); /* search for pointer pointing to 'o' */ for (p = &g->allgc; *p != o; p = &(*p)->next) { /* empty */ } *p = o->next; /* remove 'o' from 'allgc' list */ o->next = g->finobj; /* link it in 'finobj' list */ g->finobj = o; l_setbit(o->marked, FINALIZEDBIT); /* mark it as such */ } }
testq %rdx, %rdx je 0xd88b pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx movb 0x9(%rsi), %al andb $0x40, %al jne 0xd880 testb $0x4, 0xa(%rdx) jne 0xd880 movq %rdi, %r14 movq 0x18(%rdi), %r15 movq 0x120(%r15), %rax movq %rdx, %rdi movl $0x2, %esi movq %rax, %rdx callq 0x1cb25 testq %rax, %rax je 0xd880 testb $0x4, 0x6e(%r15) jne 0xd880 movb 0x6b(%r15), %al addb $-0x3, %al cmpb $0x3, %al ja 0xd80a movb 0x9(%rbx), %al andb $-0x39, %al movb 0x6a(%r15), %cl andb $0x18, %cl orb %al, %cl movb %cl, 0x9(%rbx) movq 0x78(%r15), %r12 cmpq %rbx, %r12 jne 0xd856 movq %r12, %rax movl $0x1, %edx movq %r14, %rdi movq %rax, %rsi callq 0xe19a cmpq %r12, %rax je 0xd7ef movq %rax, 0x78(%r15) jmp 0xd856 cmpq %rbx, 0xc0(%r15) jne 0xd81d movq (%rbx), %rax movq %rax, 0xc0(%r15) cmpq %rbx, 0xc8(%r15) jne 0xd830 movq (%rbx), %rax movq %rax, 0xc8(%r15) cmpq %rbx, 0xd0(%r15) jne 0xd843 movq (%rbx), %rax movq %rax, 0xd0(%r15) cmpq %rbx, 0xd8(%r15) jne 0xd856 movq (%rbx), %rax movq %rax, 0xd8(%r15) leaq 0x70(%r15), %rcx movq %rcx, %rax movq (%rcx), %rcx cmpq %rbx, %rcx jne 0xd85a movq (%rbx), %rcx movq %rcx, (%rax) movq 0x80(%r15), %rax movq %rax, (%rbx) movq %rbx, 0x80(%r15) orb $0x40, 0x9(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_changemode
void luaC_changemode (lua_State *L, int newmode) { global_State *g = G(L); if (g->gckind == KGC_GENMAJOR) /* doing major collections? */ g->gckind = KGC_INC; /* already incremental but in name */ if (newmode != g->gckind) { /* does it need to change? */ if (newmode == KGC_INC) /* entering incremental mode? */ minor2inc(L, g, KGC_INC); /* entering incremental mode */ else { lua_assert(newmode == KGC_GENMINOR); entergen(L, g); } } }
movl %esi, %eax movq 0x18(%rdi), %rsi cmpb $0x2, 0x6c(%rsi) jne 0xd89c movb $0x0, 0x6c(%rsi) movzbl 0x6c(%rsi), %ecx cmpl %eax, %ecx jne 0xd8a5 retq testl %eax, %eax je 0xd8ae jmp 0xd939 xorl %edx, %edx jmp 0xd8b2
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
minor2inc
static void minor2inc (lua_State *L, global_State *g, lu_byte kind) { g->GCmajorminor = g->GCmarked; /* number of live bytes */ g->gckind = kind; g->reallyold = g->old1 = g->survival = NULL; g->finobjrold = g->finobjold1 = g->finobjsur = NULL; entersweep(L); /* continue as an incremental cycle */ /* set a debt equal to the step size */ luaE_setdebt(g, applygcparam(g, STEPSIZE, 100)); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movq 0x20(%rsi), %rax movq %rax, 0x28(%rsi) movb %dl, 0x6c(%rsi) xorps %xmm0, %xmm0 movups %xmm0, 0xc0(%rsi) xorl %eax, %eax movq %rax, 0xd0(%rsi) movups %xmm0, 0xe0(%rsi) movq %rax, 0xf0(%rsi) movq 0x18(%rdi), %r15 movb $0x3, 0x6b(%r15) leaq 0x70(%r15), %r12 movq %r12, %rax movl $0x1, %edx movq %r14, %rdi movq %rax, %rsi callq 0xe19a cmpq %r12, %rax je 0xd8fc movq %rax, 0x78(%r15) movzbl 0x69(%rbx), %edi movl $0x64, %esi callq 0x121ab movq %rbx, %rdi movq %rax, %rsi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x1661c
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
entergen
static void entergen (lua_State *L, global_State *g) { luaC_runtilstate(L, GCSpause, 1); /* prepare to start a new cycle */ luaC_runtilstate(L, GCSpropagate, 1); /* start new cycle */ atomic(L); /* propagates all and then do the atomic stuff */ atomic2gen(L, g); setminordebt(g); /* set debt assuming next cycle will be minor */ }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 movq 0x18(%rdi), %r15 cmpb $0x8, 0x6b(%r15) je 0xd95e movq %r14, %rdi movl $0x1, %esi callq 0xdaf6 jmp 0xd948 movq 0x18(%r14), %r15 cmpb $0x0, 0x6b(%r15) je 0xd978 movq %r14, %rdi movl $0x1, %esi callq 0xdaf6 jmp 0xd962 movq %r14, %rdi callq 0xe324 movq %r14, %rdi movq %rbx, %rsi callq 0xe4eb movzbl 0x64(%rbx), %edi movq 0x28(%rbx), %rsi callq 0x121ab movq %rbx, %rdi movq %rax, %rsi popq %rbx popq %r14 popq %r15 jmp 0x1661c
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
separatetobefnz
static void separatetobefnz (global_State *g, int all) { GCObject *curr; GCObject **p = &g->finobj; GCObject **lastnext = findlast(&g->tobefnz); while ((curr = *p) != g->finobjold1) { /* traverse all finalizable objects */ lua_assert(tofinalize(curr)); if (!(iswhite(curr) || all)) /* not being collected? */ p = &curr->next; /* don't bother with it */ else { if (curr == g->finobjsur) /* removing 'finobjsur'? */ g->finobjsur = curr->next; /* correct it */ *p = curr->next; /* remove 'curr' from 'finobj' list */ curr->next = *lastnext; /* link at the end of 'tobefnz' list */ *lastnext = curr; lastnext = &curr->next; } } }
leaq 0xb0(%rdi), %rcx movq %rcx, %rax movq (%rcx), %rcx testq %rcx, %rcx jne 0xda56 movq 0x80(%rdi), %rdx cmpq 0xe8(%rdi), %rdx je 0xdabc leaq 0x80(%rdi), %rcx testl %esi, %esi jne 0xda8b movb 0x9(%rdx), %r8b andb $0x18, %r8b jne 0xda8b movq %rdx, %rcx jmp 0xdab0 cmpq 0xe0(%rdi), %rdx jne 0xda9e movq (%rdx), %r8 movq %r8, 0xe0(%rdi) movq (%rdx), %r8 movq %r8, (%rcx) movq (%rax), %r8 movq %r8, (%rdx) movq %rdx, (%rax) movq %rdx, %rax movq (%rcx), %rdx cmpq 0xe8(%rdi), %rdx jne 0xda78 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
singlestep
static l_mem singlestep (lua_State *L, int fast) { global_State *g = G(L); l_mem stepresult; lua_assert(!g->gcstopem); /* collector is not reentrant */ g->gcstopem = 1; /* no emergency collections while collecting */ switch (g->gcstate) { case GCSpause: { restartcollection(g); g->gcstate = GCSpropagate; stepresult = 1; break; } case GCSpropagate: { if (fast || g->gray == NULL) { g->gcstate = GCSenteratomic; /* finish propagate phase */ stepresult = 1; } else stepresult = propagatemark(g); /* traverse one gray object */ break; } case GCSenteratomic: { atomic(L); if (checkmajorminor(L, g)) stepresult = step2minor; else { entersweep(L); stepresult = atomicstep; } break; } case GCSswpallgc: { /* sweep "regular" objects */ sweepstep(L, g, GCSswpfinobj, &g->finobj, fast); stepresult = GCSWEEPMAX; break; } case GCSswpfinobj: { /* sweep objects with finalizers */ sweepstep(L, g, GCSswptobefnz, &g->tobefnz, fast); stepresult = GCSWEEPMAX; break; } case GCSswptobefnz: { /* sweep objects to be finalized */ sweepstep(L, g, GCSswpend, NULL, fast); stepresult = GCSWEEPMAX; break; } case GCSswpend: { /* finish sweeps */ checkSizes(L, g); g->gcstate = GCScallfin; stepresult = GCSWEEPMAX; break; } case GCScallfin: { /* call finalizers */ if (g->tobefnz && !g->gcemergency) { g->gcstopem = 0; /* ok collections during finalizers */ GCTM(L); /* call one finalizer */ stepresult = CWUFIN; } else { /* emergency mode or no more finalizers */ g->gcstate = GCSpause; /* finish collection */ stepresult = step2pause; } break; } default: lua_assert(0); return 0; } g->gcstopem = 0; return stepresult; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq 0x18(%rdi), %rbx movb $0x1, 0x6d(%rbx) movzbl 0x6b(%rbx), %ecx xorl %eax, %eax cmpq $0x8, %rcx ja 0xdcc6 movq %rdi, %r14 leaq 0x1c0b4(%rip), %rdx # 0x29bd4 movslq (%rdx,%rcx,4), %rcx addq %rdx, %rcx jmpq *%rcx testl %esi, %esi je 0xdd0c movb $0x1, 0x6b(%rbx) jmp 0xdc59 cmpb $0x0, 0x6f(%rbx) jne 0xdb64 movl 0x3c(%rbx), %eax leal 0x3(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx sarl $0x2, %ecx cmpl %ecx, 0x38(%rbx) jge 0xdb64 movl %eax, %esi shrl $0x1f, %esi addl %eax, %esi sarl %esi movq %r14, %rdi callq 0x16f0c movb $0x7, 0x6b(%rbx) jmp 0xdcbd movq %r14, %rdi callq 0xe324 cmpb $0x2, 0x6c(%rbx) jne 0xdcd2 movq 0x10(%rbx), %r15 subq 0x18(%rbx), %r15 movq %r15, %rsi subq 0x28(%rbx), %rsi movzbl 0x65(%rbx), %edi callq 0x121ab subq 0x20(%rbx), %r15 cmpq %rax, %r15 jle 0xdcd2 movq %r14, %rdi movq %rbx, %rsi callq 0xe4eb movzbl 0x64(%rbx), %edi movq 0x28(%rbx), %rsi callq 0x121ab movq %rbx, %rdi movq %rax, %rsi callq 0x1661c movq $-0x1, %rax jmp 0xdcc2 cmpq $0x0, 0xb0(%rbx) je 0xdbe7 cmpb $0x0, 0x6f(%rbx) je 0xdd2c movb $0x8, 0x6b(%rbx) movq $-0x3, %rax jmp 0xdcc2 xorps %xmm0, %xmm0 movups %xmm0, 0x98(%rbx) movups %xmm0, 0x88(%rbx) xorl %eax, %eax movq %rax, 0xa8(%rbx) movq %rax, 0x20(%rbx) testb $0x18, 0x591(%rbx) je 0xdc2d leaq 0x588(%rbx), %rsi movq %rbx, %rdi callq 0xd556 testb $0x40, 0x48(%rbx) je 0xdc45 movq 0x40(%rbx), %rsi testb $0x18, 0x9(%rsi) je 0xdc45 movq %rbx, %rdi callq 0xd556 movq %rbx, %rdi callq 0xe598 movq %rbx, %rdi callq 0xe720 movb $0x0, 0x6b(%rbx) movl $0x1, %eax jmp 0xdcc2 movq 0x78(%rbx), %rax testq %rax, %rax jne 0xdc99 leaq 0x80(%rbx), %rax movb $0x4, 0x6b(%rbx) jmp 0xdcb9 movq 0x78(%rbx), %rax testq %rax, %rax jne 0xdc99 leaq 0xb0(%rbx), %rax movb $0x5, 0x6b(%rbx) jmp 0xdcb9 movq 0x78(%rbx), %rax testq %rax, %rax je 0xdd24 testl %esi, %esi movl $0x14, %ecx movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF cmoveq %rcx, %rdx movq %r14, %rdi movq %rax, %rsi callq 0xe19a movq %rax, 0x78(%rbx) movl $0x14, %eax movb $0x0, 0x6d(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq 0x20(%rbx), %rax movq %rax, 0x28(%rbx) movq 0x18(%r14), %r15 movb $0x3, 0x6b(%r15) leaq 0x70(%r15), %r12 movq %r12, %rax movl $0x1, %edx movq %r14, %rdi movq %rax, %rsi callq 0xe19a cmpq %r12, %rax je 0xdcea movq %rax, 0x78(%r15) movq $-0x2, %rax jmp 0xdcc2 cmpq $0x0, 0x88(%rbx) je 0xdb31 movq %rbx, %rdi callq 0xe7e1 jmp 0xdcc2 movb $0x6, 0x6b(%rbx) xorl %eax, %eax jmp 0xdcb9 movb $0x0, 0x6d(%rbx) movq %r14, %rdi callq 0xf10a movl $0xa, %eax jmp 0xdcc2
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_step
void luaC_step (lua_State *L) { global_State *g = G(L); lua_assert(!g->gcemergency); if (!gcrunning(g)) { /* not running? */ if (g->gcstp & GCSTPUSR) /* stopped by the user? */ luaE_setdebt(g, 20000); } else { luai_tracegc(L, 1); /* for internal debugging */ switch (g->gckind) { case KGC_INC: case KGC_GENMAJOR: incstep(L, g); break; case KGC_GENMINOR: youngcollection(L, g); setminordebt(g); break; } luai_tracegc(L, 0); /* for internal debugging */ } }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq 0x18(%rdi), %rbx movb 0x6e(%rbx), %al testb %al, %al je 0xdd6d testb $0x1, %al je 0xde1c movl $0x4e20, %esi # imm = 0x4E20 movq %rbx, %rdi jmp 0xdff8 movq %rdi, %r14 movzbl 0x6c(%rbx), %eax cmpl $0x2, %eax je 0xdd8a cmpl $0x1, %eax je 0xde2b testl %eax, %eax jne 0xde1c movzbl 0x69(%rbx), %edi movl $0x64, %esi callq 0x121ab movq %rax, %r15 movzbl 0x68(%rbx), %edi leaq 0x7(%rax), %rsi testq %rax, %rax cmovnsq %rax, %rsi sarq $0x3, %rsi callq 0x121ab movq %rax, %r12 xorl %ebp, %ebp testq %rax, %rax sete %bpl movq %rax, %r13 movq %r14, %rdi movl %ebp, %esi callq 0xdaf6 cmpq $-0x3, %rax je 0xddfc cmpq $-0x1, %rax je 0xde1c testq %r12, %r12 setne %cl cmpq $-0x2, %rax sete %dl testb %dl, %cl jne 0xddfc testq %r12, %r12 sete %cl subq %rax, %r13 testq %r13, %r13 setg %al orb %cl, %al jne 0xddc2 cmpb $0x8, 0x6b(%rbx) jne 0xdfc5 movq %rbx, %rdi addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0xf250 addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq $0x0, 0x18(%rsp) movq 0x20(%rbx), %r13 leaq 0xd8(%rbx), %rbp movq 0xd8(%rbx), %rsi testq %rsi, %rsi je 0xde65 movq 0xd0(%rbx), %rdx movq %rbx, %rdi callq 0xf27b movq $0x0, 0xd8(%rbx) leaq 0x80(%rbx), %rax movq %rax, 0x8(%rsp) movq 0x80(%rbx), %rsi movq 0xf0(%rbx), %rdx movq %rbx, %rdi callq 0xf27b leaq 0xb0(%rbx), %rax movq %rax, 0x10(%rsp) movq 0xb0(%rbx), %rsi movq %rbx, %rdi xorl %edx, %edx callq 0xf27b movq %r14, %rdi callq 0xe324 movb $0x3, 0x6b(%rbx) leaq 0x70(%rbx), %rdx movq 0xc0(%rbx), %rcx leaq 0x18(%rsp), %r12 movq %r14, %rdi movq %rbx, %rsi movq %rbp, %r8 movq %r12, %r9 callq 0xf2c5 movq %rax, %r15 movq 0xc8(%rbx), %rcx movq %r14, %rdi movq %rbx, %rsi movq %rax, %rdx movq %rbp, %r8 movq %r12, %r9 callq 0xf2c5 movq 0x70(%rbx), %rax movq 0xc8(%rbx), %rcx movq %rcx, 0xd0(%rbx) movq (%r15), %rcx movq %rcx, 0xc8(%rbx) movq %rax, 0xc0(%rbx) leaq 0x20(%rsp), %rbp movq $0x0, (%rbp) movq 0xe0(%rbx), %rcx movq %r14, %rdi movq %rbx, %rsi movq 0x8(%rsp), %rdx movq %rbp, %r8 movq %r12, %r9 callq 0xf2c5 movq %rax, %r15 movq 0xe8(%rbx), %rcx movq %r14, %rdi movq %rbx, %rsi movq %rax, %rdx movq %rbp, %r8 movq %r12, %r9 callq 0xf2c5 movq 0x80(%rbx), %rax movq 0xe8(%rbx), %rcx movq %rcx, 0xf0(%rbx) movq (%r15), %rcx movq %rcx, 0xe8(%rbx) movq %rax, 0xe0(%rbx) movq %r14, %rdi movq %rbx, %rsi movq 0x10(%rsp), %rdx xorl %ecx, %ecx movq %rbp, %r8 movq %r12, %r9 callq 0xf2c5 addq (%r12), %r13 movq %r13, 0x20(%rbx) movzbl 0x66(%rbx), %edi movq 0x28(%rbx), %rsi callq 0x121ab testq %rax, %rax je 0xdfb8 cmpq %rax, 0x20(%rbx) jge 0xdfcd movq %r14, %rdi movq %rbx, %rsi callq 0xefe2 jmp 0xdfe5 movq %rbx, %rdi movq %r15, %rsi jmp 0xdff8 movq %r14, %rdi movq %rbx, %rsi movl $0x2, %edx callq 0xd8b2 movq $0x0, 0x20(%rbx) movzbl 0x64(%rbx), %edi movq 0x28(%rbx), %rsi callq 0x121ab movq %rbx, %rdi movq %rax, %rsi addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x1661c
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaC_fullgc
void luaC_fullgc (lua_State *L, int isemergency) { global_State *g = G(L); lua_assert(!g->gcemergency); g->gcemergency = cast_byte(isemergency); /* set flag */ switch (g->gckind) { case KGC_GENMINOR: fullgen(L, g); break; case KGC_INC: fullinc(L, g); break; case KGC_GENMAJOR: g->gckind = KGC_INC; fullinc(L, g); g->gckind = KGC_GENMAJOR; break; } g->gcemergency = 0; }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %r14 movq 0x18(%rdi), %rbx movb %sil, 0x6f(%rbx) movzbl 0x6c(%rbx), %eax testl %eax, %eax je 0xe05b cmpl $0x2, %eax je 0xe046 cmpl $0x1, %eax jne 0xe066 movq %r14, %rdi movq %rbx, %rsi xorl %edx, %edx callq 0xd8b2 movq %r14, %rdi movq %rbx, %rsi callq 0xd939 jmp 0xe066 movb $0x0, 0x6c(%rbx) movq %r14, %rdi movq %rbx, %rsi callq 0xe072 movb $0x2, 0x6c(%rbx) jmp 0xe066 movq %r14, %rdi movq %rbx, %rsi callq 0xe072 movb $0x0, 0x6f(%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
fullinc
static void fullinc (lua_State *L, global_State *g) { if (keepinvariant(g)) /* black objects? */ entersweep(L); /* sweep everything to turn them back to white */ /* finish any pending sweep phase to start a new cycle */ luaC_runtilstate(L, GCSpause, 1); luaC_runtilstate(L, GCScallfin, 1); /* run up to finalizers */ luaC_runtilstate(L, GCSpause, 1); /* finish collection */ setpause(g); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 cmpb $0x2, 0x6b(%rsi) ja 0xe0af movq 0x18(%r14), %r15 movb $0x3, 0x6b(%r15) leaq 0x70(%r15), %r12 movq %r12, %rax movl $0x1, %edx movq %r14, %rdi movq %rax, %rsi callq 0xe19a cmpq %r12, %rax je 0xe096 movq %rax, 0x78(%r15) movq 0x18(%r14), %r15 cmpb $0x8, 0x6b(%r15) je 0xe0c9 movq %r14, %rdi movl $0x1, %esi callq 0xdaf6 jmp 0xe0b3 movq 0x18(%r14), %r15 cmpb $0x7, 0x6b(%r15) je 0xe0e3 movq %r14, %rdi movl $0x1, %esi callq 0xdaf6 jmp 0xe0cd movq 0x18(%r14), %r15 cmpb $0x8, 0x6b(%r15) je 0xe0fd movq %r14, %rdi movl $0x1, %esi callq 0xdaf6 jmp 0xe0e7 movq %rbx, %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0xf250
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
objsize
static l_mem objsize (GCObject *o) { lu_mem res; switch (o->tt) { case LUA_VTABLE: { res = luaH_size(gco2t(o)); break; } case LUA_VLCL: { LClosure *cl = gco2lcl(o); res = sizeLclosure(cl->nupvalues); break; } case LUA_VCCL: { CClosure *cl = gco2ccl(o); res = sizeCclosure(cl->nupvalues); break; break; } case LUA_VUSERDATA: { Udata *u = gco2u(o); res = sizeudata(u->nuvalue, u->len); break; } case LUA_VPROTO: { res = luaF_protosize(gco2p(o)); break; } case LUA_VTHREAD: { res = luaE_threadsize(gco2th(o)); break; } case LUA_VSHRSTR: { TString *ts = gco2ts(o); res = sizestrshr(cast_uint(ts->shrlen)); break; } case LUA_VLNGSTR: { TString *ts = gco2ts(o); res = luaS_sizelngstr(ts->u.lnglen, ts->shrlen); break; } case LUA_VUPVAL: { res = sizeof(UpVal); break; } default: res = 0; lua_assert(0); } return cast(l_mem, res); }
movzbl 0x8(%rdi), %ecx leal -0x4(%rcx), %eax cmpl $0x10, %eax ja 0xe137 leaq 0x1bad5(%rip), %rcx # 0x29bf8 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movsbl 0xb(%rdi), %eax incl %eax addq $0x18, %rax retq cmpl $0x26, %ecx jne 0xe148 movzbl 0xa(%rdi), %eax shll $0x4, %eax addq $0x20, %rax retq xorl %eax, %eax retq movq 0x10(%rdi), %rax movsbl 0xb(%rdi), %esi movq %rax, %rdi jmp 0x17157 jmp 0xd3d3 movzbl 0xa(%rdi), %eax leaq 0x20(,%rax,8), %rax retq jmp 0x1ad7b jmp 0x16711 movzwl 0xa(%rdi), %eax movl %eax, %ecx shll $0x4, %ecx addq $0x28, %rcx testl %eax, %eax movl $0x20, %eax cmovneq %rcx, %rax addq 0x10(%rdi), %rax retq movl $0x28, %eax retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
freeobj
static void freeobj (lua_State *L, GCObject *o) { assert_code(l_mem newmem = gettotalbytes(G(L)) - objsize(o)); switch (o->tt) { case LUA_VPROTO: luaF_freeproto(L, gco2p(o)); break; case LUA_VUPVAL: freeupval(L, gco2upv(o)); break; case LUA_VLCL: { LClosure *cl = gco2lcl(o); luaM_freemem(L, cl, sizeLclosure(cl->nupvalues)); break; } case LUA_VCCL: { CClosure *cl = gco2ccl(o); luaM_freemem(L, cl, sizeCclosure(cl->nupvalues)); break; } case LUA_VTABLE: luaH_free(L, gco2t(o)); break; case LUA_VTHREAD: luaE_freethread(L, gco2th(o)); break; case LUA_VUSERDATA: { Udata *u = gco2u(o); luaM_freemem(L, o, sizeudata(u->nuvalue, u->len)); break; } case LUA_VSHRSTR: { TString *ts = gco2ts(o); luaS_remove(L, ts); /* remove it from hash table */ luaM_freemem(L, ts, sizestrshr(cast_uint(ts->shrlen))); break; } case LUA_VLNGSTR: { TString *ts = gco2ts(o); if (ts->shrlen == LSTRMEM) /* must free external string? */ (*ts->falloc)(ts->ud, ts->contents, ts->u.lnglen + 1, 0); luaM_freemem(L, ts, luaS_sizelngstr(ts->u.lnglen, ts->shrlen)); break; } default: lua_assert(0); } lua_assert(gettotalbytes(G(L)) == newmem); }
pushq %r14 pushq %rbx pushq %rax movq %rsi, %rbx movq %rdi, %r14 movzbl 0x8(%rsi), %ecx leal -0x4(%rcx), %eax cmpl $0x10, %eax ja 0xe24a leaq 0x1ba15(%rip), %rcx # 0x29c3c movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax movq %r14, %rdi movq %rbx, %rsi callq 0x171b1 movsbl 0xb(%rbx), %edx incl %edx addq $0x18, %rdx jmp 0xe312 cmpl $0x26, %ecx jne 0xe25f movzbl 0xa(%rbx), %edx shll $0x4, %edx addq $0x20, %rdx jmp 0xe312 addq $0x8, %rsp popq %rbx popq %r14 retq cmpb $-0x3, 0xb(%rbx) jne 0xe281 movq 0x28(%rbx), %rdi movq 0x10(%rbx), %rdx movq 0x18(%rbx), %rsi incq %rdx xorl %ecx, %ecx callq *0x20(%rbx) movq 0x10(%rbx), %rdi movsbl 0xb(%rbx), %esi callq 0x17157 movq %r14, %rdi movq %rbx, %rsi movq %rax, %rdx jmp 0xe318 movq %r14, %rdi movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0xd412 movzbl 0xa(%rbx), %eax leaq 0x20(,%rax,8), %rdx jmp 0xe312 movq %r14, %rdi movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x1adb1 movq %r14, %rdi movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x168b0 movzwl 0xa(%rbx), %eax movl %eax, %ecx shll $0x4, %ecx addq $0x28, %rcx testl %eax, %eax movl $0x20, %edx cmovneq %rcx, %rdx addq 0x10(%rbx), %rdx jmp 0xe312 leaq 0x18(%rbx), %rax cmpq %rax, 0x10(%rbx) je 0xe30d movq %rbx, %rdi callq 0xd1cc movl $0x28, %edx movq %r14, %rdi movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x112b5
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
atomic
static void atomic (lua_State *L) { global_State *g = G(L); GCObject *origweak, *origall; GCObject *grayagain = g->grayagain; /* save original list */ g->grayagain = NULL; lua_assert(g->ephemeron == NULL && g->weak == NULL); lua_assert(!iswhite(mainthread(g))); g->gcstate = GCSatomic; markobject(g, L); /* mark running thread */ /* registry and global metatables may be changed by API */ markvalue(g, &g->l_registry); markmt(g); /* mark global metatables */ propagateall(g); /* empties 'gray' list */ /* remark occasional upvalues of (maybe) dead threads */ remarkupvals(g); propagateall(g); /* propagate changes */ g->gray = grayagain; propagateall(g); /* traverse 'grayagain' list */ convergeephemerons(g); /* at this point, all strongly accessible objects are marked. */ /* Clear values from weak tables, before checking finalizers */ clearbyvalues(g, g->weak, NULL); clearbyvalues(g, g->allweak, NULL); origweak = g->weak; origall = g->allweak; separatetobefnz(g, 0); /* separate objects to be finalized */ markbeingfnz(g); /* mark objects that will be finalized */ propagateall(g); /* remark, to propagate 'resurrection' */ convergeephemerons(g); /* at this point, all resurrected objects are marked. */ /* remove dead objects from weak tables */ clearbykeys(g, g->ephemeron); /* clear keys from all ephemeron */ clearbykeys(g, g->allweak); /* clear keys from all 'allweak' */ /* clear values from resurrected weak tables */ clearbyvalues(g, g->weak, origweak); clearbyvalues(g, g->allweak, origall); luaS_clearcache(g); g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */ lua_assert(g->gray == NULL); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq 0x18(%rdi), %rbx movq 0x90(%rbx), %r14 movq $0x0, 0x90(%rbx) movb $0x2, 0x6b(%rbx) testb $0x18, 0x9(%rdi) je 0xe357 movq %rdi, %rsi movq %rbx, %rdi callq 0xd556 testb $0x40, 0x48(%rbx) je 0xe36f movq 0x40(%rbx), %rsi testb $0x18, 0x9(%rsi) je 0xe36f movq %rbx, %rdi callq 0xd556 movq %rbx, %rdi callq 0xe598 cmpq $0x0, 0x88(%rbx) je 0xe38b movq %rbx, %rdi callq 0xe7e1 jmp 0xe377 movq 0xf8(%rbx), %rax testq %rax, %rax je 0xe403 leaq 0xf8(%rbx), %r15 testb $0x18, 0x9(%rax) je 0xe3e3 movq 0x50(%rax), %rcx movq %rcx, (%r15) movq %rax, 0x50(%rax) movq 0x38(%rax), %r12 testq %r12, %r12 je 0xe3f1 testb $0x18, 0x9(%r12) jne 0xe3dc movq 0x10(%r12), %rax testb $0x40, 0x8(%rax) je 0xe3dc movq (%rax), %rsi testb $0x18, 0x9(%rsi) je 0xe3dc movq %rbx, %rdi callq 0xd556 movq 0x18(%r12), %r12 jmp 0xe3b3 cmpq $0x0, 0x38(%rax) je 0xe3a4 addq $0x50, %rax movq %rax, %r15 movq (%r15), %rax testq %rax, %rax jne 0xe39e jmp 0xe403 movq %rbx, %rdi callq 0xe7e1 cmpq $0x0, 0x88(%rbx) jne 0xe3fb movq %r14, 0x88(%rbx) testq %r14, %r14 je 0xe42b movq %rbx, %rdi callq 0xe7e1 cmpq $0x0, 0x88(%rbx) jne 0xe419 movq %rbx, %rdi callq 0xe5cd movq 0x98(%rbx), %rsi movq %rbx, %rdi xorl %edx, %edx callq 0xe647 movq 0xa8(%rbx), %rsi movq %rbx, %rdi xorl %edx, %edx callq 0xe647 movq 0x98(%rbx), %r15 movq 0xa8(%rbx), %r14 movq %rbx, %rdi xorl %esi, %esi callq 0xda4f movq %rbx, %rdi callq 0xe720 cmpq $0x0, 0x88(%rbx) je 0xe489 movq %rbx, %rdi callq 0xe7e1 jmp 0xe475 movq %rbx, %rdi callq 0xe5cd movq 0xa0(%rbx), %rsi movq %rbx, %rdi callq 0xe755 movq 0xa8(%rbx), %rsi movq %rbx, %rdi callq 0xe755 movq 0x98(%rbx), %rsi movq %rbx, %rdi movq %r15, %rdx callq 0xe647 movq 0xa8(%rbx), %rsi movq %rbx, %rdi movq %r14, %rdx callq 0xe647 movq %rbx, %rdi callq 0x17008 xorb $0x18, 0x6a(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
atomic2gen
static void atomic2gen (lua_State *L, global_State *g) { cleargraylists(g); /* sweep all elements making them old */ g->gcstate = GCSswpallgc; sweep2old(L, &g->allgc); /* everything alive now is old */ g->reallyold = g->old1 = g->survival = g->allgc; g->firstold1 = NULL; /* there are no OLD1 objects anywhere */ /* repeat for 'finobj' lists */ sweep2old(L, &g->finobj); g->finobjrold = g->finobjold1 = g->finobjsur = g->finobj; sweep2old(L, &g->tobefnz); g->gckind = KGC_GENMINOR; g->GCmajorminor = g->GCmarked; /* "base" for number of bytes */ g->GCmarked = 0; /* to count the number of added old1 bytes */ finishgencycle(L, g); }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 xorps %xmm0, %xmm0 movups %xmm0, 0x98(%rsi) movups %xmm0, 0x88(%rsi) xorl %r15d, %r15d movq %r15, 0xa8(%rsi) movb $0x3, 0x6b(%rsi) addq $0x70, %rsi callq 0xef5f movq 0x70(%rbx), %rax movq %rax, 0xc0(%rbx) movq %rax, 0xc8(%rbx) movq %rax, 0xd0(%rbx) movq %r15, 0xd8(%rbx) leaq 0x80(%rbx), %rsi movq %r14, %rdi callq 0xef5f movq 0x80(%rbx), %rax movq %rax, 0xe0(%rbx) movq %rax, 0xe8(%rbx) movq %rax, 0xf0(%rbx) leaq 0xb0(%rbx), %rsi movq %r14, %rdi callq 0xef5f movb $0x1, 0x6c(%rbx) movq 0x20(%rbx), %rax movq %rax, 0x28(%rbx) movq %r15, 0x20(%rbx) movq %r14, %rdi movq %rbx, %rsi popq %rbx popq %r14 popq %r15 jmp 0xefe2
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
traverseephemeron
static int traverseephemeron (global_State *g, Table *h, int inv) { int hasclears = 0; /* true if table has white keys */ int hasww = 0; /* true if table has entry "white-key -> white-value" */ unsigned int i; unsigned int nsize = sizenode(h); int marked = traversearray(g, h); /* traverse array part */ /* traverse hash part; if 'inv', traverse descending (see 'convergeephemerons') */ for (i = 0; i < nsize; i++) { Node *n = inv ? gnode(h, nsize - 1 - i) : gnode(h, i); if (isempty(gval(n))) /* entry is empty? */ clearkey(n); /* clear its key */ else if (iscleared(g, gckeyN(n))) { /* key is not marked (yet)? */ hasclears = 1; /* table must be cleared */ if (valiswhite(gval(n))) /* value not marked yet? */ hasww = 1; /* white-white entry */ } else if (valiswhite(gval(n))) { /* value not marked yet? */ marked = 1; reallymarkobject(g, gcvalue(gval(n))); /* mark it now */ } } /* link table into proper list */ if (g->gcstate == GCSpropagate) linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */ else if (hasww) /* table has white->white entries? */ linkgclist(h, g->ephemeron); /* have to propagate again */ else if (hasclears) /* table has white keys? */ linkgclist(h, g->allweak); /* may have to clean white keys */ else genlink(g, obj2gco(h)); /* check whether collector still needs to see it */ return marked; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movl %edx, %r15d movq %rsi, %rbx movb 0xb(%rsi), %cl movl $0x1, %r12d shlq %cl, %r12 movq %rdi, 0x10(%rsp) callq 0xeef4 movl %eax, 0xc(%rsp) xorl %r13d, %r13d xorl %ebp, %ebp movl $0x0, 0x8(%rsp) testl %r15d, %r15d je 0xed8a leal -0x1(%r12), %eax leaq (%rax,%rax,2), %r14 shlq $0x3, %r14 addq 0x18(%rbx), %r14 jmp 0xed91 movq 0x18(%rbx), %r14 addq %r13, %r14 testb $0xf, 0x8(%r14) movb 0x9(%r14), %al je 0xeda4 testb $0x40, %al jne 0xedaf xorl %esi, %esi jmp 0xedb3 testb $0x40, %al je 0xee03 movb $0xb, 0x9(%r14) jmp 0xee03 movq 0x10(%r14), %rsi movq 0x10(%rsp), %rdi callq 0xee81 movb 0x8(%r14), %cl testl %eax, %eax je 0xede3 movl $0x1, %ebp testb $0x40, %cl je 0xee03 movq (%r14), %rax testb $0x18, 0x9(%rax) movl 0x8(%rsp), %eax cmovnel %ebp, %eax movl %eax, 0x8(%rsp) jmp 0xee03 testb $0x40, %cl je 0xee03 movq (%r14), %rsi testb $0x18, 0x9(%rsi) je 0xee03 movq 0x10(%rsp), %rdi callq 0xd556 movl $0x1, 0xc(%rsp) addq $0x18, %r13 decq %r12 jne 0xed72 movq 0x10(%rsp), %rdi cmpb $0x0, 0x6b(%rdi) je 0xee36 cmpl $0x0, 0x8(%rsp) je 0xee4a movq 0xa0(%rdi), %rax movq %rax, 0x28(%rbx) movq %rbx, 0xa0(%rdi) jmp 0xee60 movq 0x90(%rdi), %rax movq %rax, 0x28(%rbx) movq %rbx, 0x90(%rdi) jmp 0xee60 testl %ebp, %ebp je 0xee77 movq 0xa8(%rdi), %rax movq %rax, 0x28(%rbx) movq %rbx, 0xa8(%rdi) andb $-0x39, 0x9(%rbx) movl 0xc(%rsp), %eax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rsi callq 0xeeac jmp 0xee64
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
genlink
static void genlink (global_State *g, GCObject *o) { lua_assert(isblack(o)); if (getage(o) == G_TOUCHED1) { /* touched in this cycle? */ linkobjgclist(o, g->grayagain); /* link it back in 'grayagain' */ } /* everything else do not need to be linked back */ else if (getage(o) == G_TOUCHED2) setage(o, G_OLD); /* advance age */ }
pushq %rbp pushq %r14 pushq %rbx movq %rsi, %rbx movzbl 0x9(%rsi), %ebp movl %ebp, %eax andl $0x7, %eax cmpl $0x6, %eax je 0xeee6 cmpl $0x5, %eax jne 0xeeef movq %rdi, %r14 movq %rbx, %rdi callq 0xd684 movq 0x90(%r14), %rcx movq %rcx, (%rax) movq %rbx, 0x90(%r14) movb $-0x39, %al jmp 0xeee8 movb $-0x4, %al andb %al, %bpl movb %bpl, 0x9(%rbx) popq %rbx popq %r14 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
traversearray
static int traversearray (global_State *g, Table *h) { unsigned asize = h->asize; int marked = 0; /* true if some object is marked in this traversal */ unsigned i; for (i = 0; i < asize; i++) { GCObject *o = gcvalarr(h, i); if (o != NULL && iswhite(o)) { marked = 1; reallymarkobject(g, o); } } return marked; }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movl 0xc(%rsi), %r15d testq %r15, %r15 je 0xef51 movq %rsi, %rbx movq %rdi, %r14 xorl %r12d, %r12d xorl %eax, %eax movq 0x10(%rbx), %rcx testb $0x40, 0x4(%rcx,%r12) jne 0xef20 xorl %esi, %esi jmp 0xef2f leaq (,%r12,8), %rdx subq %rdx, %rcx movq -0x8(%rcx), %rsi testq %rsi, %rsi je 0xef47 testb $0x18, 0x9(%rsi) je 0xef47 movq %r14, %rdi callq 0xd556 movl $0x1, %eax incq %r12 cmpq %r15, %r12 jne 0xef10 jmp 0xef53 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
sweep2old
static void sweep2old (lua_State *L, GCObject **p) { GCObject *curr; global_State *g = G(L); while ((curr = *p) != NULL) { if (iswhite(curr)) { /* is 'curr' dead? */ lua_assert(isdead(g, curr)); *p = curr->next; /* remove 'curr' from list */ freeobj(L, curr); /* erase 'curr' */ } else { /* all surviving objects become old */ setage(curr, G_OLD); if (curr->tt == LUA_VTHREAD) { /* threads must be watched */ lua_State *th = gco2th(curr); linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ } else if (curr->tt == LUA_VUPVAL && upisopen(gco2upv(curr))) set2gray(curr); /* open upvalues are always gray */ else /* everything else is black */ nw2black(curr); p = &curr->next; /* go to next element */ } } }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq (%rsi), %rsi testq %rsi, %rsi je 0xefdc movq %rdi, %rbx movq 0x18(%rdi), %r15 movb 0x9(%rsi), %al testb $0x18, %al je 0xef90 movq (%rsi), %rax movq %rax, (%r14) movq %rbx, %rdi callq 0xe20a movq %r14, %rsi jmp 0xefd1 andb $-0x20, %al leal 0x4(%rax), %ecx movb %cl, 0x9(%rsi) movzbl 0x8(%rsi), %edx cmpl $0x9, %edx je 0xefba cmpl $0x8, %edx jne 0xefcc movq 0x90(%r15), %rax movq %rax, 0x48(%rsi) movq %rsi, 0x90(%r15) jmp 0xefc4 leaq 0x18(%rsi), %rdx cmpq %rdx, 0x10(%rsi) je 0xefcc andb $-0x3c, %cl movb %cl, 0x9(%rsi) jmp 0xefd1 orb $0x24, %al movb %al, 0x9(%rsi) movq %rsi, %r14 movq (%rsi), %rsi testq %rsi, %rsi jne 0xef76 popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
finishgencycle
static void finishgencycle (lua_State *L, global_State *g) { correctgraylists(g); checkSizes(L, g); g->gcstate = GCSpropagate; /* skip restart */ if (!g->gcemergency) callallpendingfinalizers(L); }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %r14 movq %rdi, %rbx leaq 0x90(%rsi), %rdi callq 0xf09e movq 0x98(%r14), %rcx movq %rcx, (%rax) xorl %r15d, %r15d movq %r15, 0x98(%r14) movq %rax, %rdi callq 0xf09e movq 0xa8(%r14), %rcx movq %rcx, (%rax) movq %r15, 0xa8(%r14) movq %rax, %rdi callq 0xf09e movq 0xa0(%r14), %rcx movq %rcx, (%rax) movq %r15, 0xa0(%r14) movq %rax, %rdi callq 0xf09e cmpb $0x0, 0x6f(%r14) jne 0xf074 movl 0x3c(%r14), %eax leal 0x3(%rax), %ecx testl %eax, %eax cmovnsl %eax, %ecx sarl $0x2, %ecx cmpl %ecx, 0x38(%r14) jge 0xf074 movl %eax, %esi shrl $0x1f, %esi addl %eax, %esi sarl %esi movq %rbx, %rdi callq 0x16f0c movb $0x0, 0x6b(%r14) cmpb $0x0, 0x6f(%r14) je 0xf086 popq %rbx popq %r14 popq %r15 retq movq 0x18(%rbx), %r14 cmpq $0x0, 0xb0(%r14) je 0xf080 movq %rbx, %rdi callq 0xf10a jmp 0xf08a
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
correctgraylist
static GCObject **correctgraylist (GCObject **p) { GCObject *curr; while ((curr = *p) != NULL) { GCObject **next = getgclist(curr); if (iswhite(curr)) goto remove; /* remove all white objects */ else if (getage(curr) == G_TOUCHED1) { /* touched in this cycle? */ lua_assert(isgray(curr)); nw2black(curr); /* make it black, for next barrier */ setage(curr, G_TOUCHED2); goto remain; /* keep it in the list and go to next element */ } else if (curr->tt == LUA_VTHREAD) { lua_assert(isgray(curr)); goto remain; /* keep non-white threads on the list */ } else { /* everything else is removed */ lua_assert(isold(curr)); /* young objects should be white here */ if (getage(curr) == G_TOUCHED2) /* advance from TOUCHED2... */ setage(curr, G_OLD); /* ... to OLD */ nw2black(curr); /* make object black (to be removed) */ goto remove; } remove: *p = *next; continue; remain: p = next; continue; } return p; }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movq (%rdi), %r14 testq %r14, %r14 je 0xf0ff movq %r14, %rdi callq 0xd684 movzbl 0x9(%r14), %ecx testb $0x18, %cl je 0xf0c7 movq (%rax), %rax movq %rax, (%rbx) jmp 0xf0e7 movl %ecx, %edx andl $0x7, %edx cmpl $0x5, %edx jne 0xf0dd andb $-0x28, %cl orb $0x26, %cl movb %cl, 0x9(%r14) jmp 0xf0e4 cmpb $0x8, 0x8(%r14) jne 0xf0ec movq %rax, %rbx movq (%rbx), %r14 jmp 0xf0a8 cmpl $0x6, %edx jne 0xf0f8 andb $-0x1c, %cl movb %cl, 0x9(%r14) orb $0x20, 0x9(%r14) jmp 0xf0bf movq %rbx, %rax addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
GCTM
static void GCTM (lua_State *L) { global_State *g = G(L); const TValue *tm; TValue v; lua_assert(!g->gcemergency); setgcovalue(L, &v, udata2finalize(g)); tm = luaT_gettmbyobj(L, &v, TM_GC); if (!notm(tm)) { /* is there a finalizer? */ TStatus status; lu_byte oldah = L->allowhook; lu_byte oldgcstp = g->gcstp; g->gcstp |= GCSTPGC; /* avoid GC steps */ L->allowhook = 0; /* stop debug hooks during GC metamethod */ setobj2s(L, L->top.p++, tm); /* push finalizer... */ setobj2s(L, L->top.p++, &v); /* ... and its argument */ L->ci->callstatus |= CIST_FIN; /* will run a finalizer */ status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top.p - 2), 0); L->ci->callstatus &= ~CIST_FIN; /* not running a finalizer anymore */ L->allowhook = oldah; /* restore hooks */ g->gcstp = oldgcstp; /* restore state */ if (l_unlikely(status != LUA_OK)) { /* error while running __gc? */ luaE_warnerror(L, "__gc"); L->top.p--; /* pops error object */ } } }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx subq $0x18, %rsp movq %rdi, %rbx movq 0x18(%rdi), %r14 movq 0x70(%r14), %rcx movq 0xb0(%r14), %rax movq (%rax), %rdx movq %rdx, 0xb0(%r14) movq %rcx, (%rax) movq %rax, 0x70(%r14) movb 0x9(%rax), %cl movl %ecx, %edx andb $-0x41, %dl movb %dl, 0x9(%rax) movb 0x6b(%r14), %dl addb $-0x3, %dl cmpb $0x3, %dl ja 0xf15f andb $-0x79, %cl movb 0x6a(%r14), %dl andb $0x18, %dl orb %cl, %dl movb %dl, 0x9(%rax) jmp 0xf16e andb $0x7, %cl cmpb $0x3, %cl jne 0xf16e movq %rax, 0xd8(%r14) leaq 0x8(%rsp), %rsi movq %rax, (%rsi) movb 0x8(%rax), %al orb $0x40, %al movb %al, 0x8(%rsi) movq %rbx, %rdi movl $0x2, %edx callq 0x1cb50 testb $0xf, 0x8(%rax) je 0xf220 movb 0xa(%rbx), %bpl movb 0x6e(%r14), %r15b movl %r15d, %ecx orb $0x2, %cl movb %cl, 0x6e(%r14) movb $0x0, 0xa(%rbx) movq 0x10(%rbx), %rcx leaq 0x10(%rcx), %rdx movq %rdx, 0x10(%rbx) movq (%rax), %rdx movq %rdx, (%rcx) movb 0x8(%rax), %al movb %al, 0x8(%rcx) movq 0x10(%rbx), %rax leaq 0x10(%rax), %rcx movq %rcx, 0x10(%rbx) movq 0x8(%rsp), %rcx movq %rcx, (%rax) movb 0x10(%rsp), %cl movb %cl, 0x8(%rax) movq 0x20(%rbx), %rax orl $0x1000000, 0x3c(%rax) # imm = 0x1000000 movq 0x10(%rbx), %rcx subq 0x30(%rbx), %rcx addq $-0x20, %rcx leaq 0x45(%rip), %rsi # 0xf241 movq %rbx, %rdi xorl %edx, %edx xorl %r8d, %r8d callq 0xc37c movq 0x20(%rbx), %rcx andl $0xfeffffff, 0x3c(%rcx) # imm = 0xFEFFFFFF movb %bpl, 0xa(%rbx) movb %r15b, 0x6e(%r14) testb %al, %al jne 0xf22b addq $0x18, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq leaq 0x1a4ca(%rip), %rsi # 0x296fc movq %rbx, %rdi callq 0x16d87 addq $-0x10, 0x10(%rbx) jmp 0xf220
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
markold
static void markold (global_State *g, GCObject *from, GCObject *to) { GCObject *p; for (p = from; p != to; p = p->next) { if (getage(p) == G_OLD1) { lua_assert(!iswhite(p)); setage(p, G_OLD); /* now they are old */ if (isblack(p)) reallymarkobject(g, p); } } }
cmpq %rdx, %rsi je 0xf2c4 pushq %r15 pushq %r14 pushq %rbx movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 movb 0x9(%r14), %al movl %eax, %ecx andb $0x7, %cl cmpb $0x3, %cl jne 0xf2b7 movl %eax, %ecx andb $-0x8, %cl orb $0x4, %cl movb %cl, 0x9(%r14) testb $0x20, %al je 0xf2b7 movq %r15, %rdi movq %r14, %rsi callq 0xd556 movq (%r14), %r14 cmpq %rbx, %r14 jne 0xf28e popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
sweepgen
static GCObject **sweepgen (lua_State *L, global_State *g, GCObject **p, GCObject *limit, GCObject **pfirstold1, l_mem *paddedold) { static const lu_byte nextage[] = { G_SURVIVAL, /* from G_NEW */ G_OLD1, /* from G_SURVIVAL */ G_OLD1, /* from G_OLD0 */ G_OLD, /* from G_OLD1 */ G_OLD, /* from G_OLD (do not change) */ G_TOUCHED1, /* from G_TOUCHED1 (do not change) */ G_TOUCHED2 /* from G_TOUCHED2 (do not change) */ }; l_mem addedold = 0; int white = luaC_white(g); GCObject *curr; while ((curr = *p) != limit) { if (iswhite(curr)) { /* is 'curr' dead? */ lua_assert(!isold(curr) && isdead(g, curr)); *p = curr->next; /* remove 'curr' from list */ freeobj(L, curr); /* erase 'curr' */ } else { /* correct mark and age */ int age = getage(curr); if (age == G_NEW) { /* new objects go back to white */ int marked = curr->marked & ~maskgcbits; /* erase GC bits */ curr->marked = cast_byte(marked | G_SURVIVAL | white); } else { /* all other objects will be old, and so keep their color */ lua_assert(age != G_OLD1); /* advanced in 'markold' */ setage(curr, nextage[age]); if (getage(curr) == G_OLD1) { addedold += objsize(curr); /* bytes becoming old */ if (*pfirstold1 == NULL) *pfirstold1 = curr; /* first OLD1 object in the list */ } } p = &curr->next; /* go to next element */ } } *paddedold += addedold; return p; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %r9, 0x8(%rsp) movq %r8, 0x10(%rsp) movq %rdx, %rbp movq (%rdx), %r13 cmpq %rcx, %r13 je 0xf366 movq %rcx, %r15 movq %rdi, %r12 movb 0x6a(%rsi), %r14b andb $0x18, %r14b xorl %ebx, %ebx movzbl 0x9(%r13), %eax testb $0x18, %al je 0xf316 movq (%r13), %rax movq %rax, (%rbp) movq %r12, %rdi movq %r13, %rsi callq 0xe20a jmp 0xf35b movl %eax, %ecx andl $0x7, %ecx je 0xf34d andb $-0x20, %al leaq 0x1a972(%rip), %rdx # 0x29c98 orb (%rcx,%rdx), %al movb %al, 0x9(%r13) cmpl $0x2, %ecx ja 0xf358 movq %r13, %rdi callq 0xe110 addq %rax, %rbx movq 0x10(%rsp), %rax cmpq $0x0, (%rax) jne 0xf358 movq %r13, (%rax) jmp 0xf358 andb $-0x40, %al orb %r14b, %al orb $0x1, %al movb %al, 0x9(%r13) movq %r13, %rbp movq (%rbp), %r13 cmpq %r15, %r13 jne 0xf2f8 jmp 0xf368 xorl %ebx, %ebx movq 0x8(%rsp), %rax addq %rbx, (%rax) movq %rbp, %rax addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq nop
/mmanyen[P]CLua/build_O1/_deps/lua/lgc.c
luaL_openselectedlibs
LUALIB_API void luaL_openselectedlibs (lua_State *L, int load, int preload) { int mask; const luaL_Reg *lib; luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_PRELOAD_TABLE); for (lib = stdlibs, mask = 1; lib->name != NULL; lib++, mask <<= 1) { if (load & mask) { /* selected? */ luaL_requiref(L, lib->name, lib->func, 1); /* require library */ lua_pop(L, 1); /* remove result from the stack */ } else if (preload & mask) { /* selected? */ lua_pushcfunction(L, lib->func); lua_setfield(L, -2, lib->name); /* add library to PRELOAD table */ } } lua_assert((mask >> 1) == LUA_UTF8LIBK); lua_pop(L, 1); /* remove PRELOAD table */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %edx, %ebx movl %esi, %ebp movq %rdi, %r14 leaq 0x1a902(%rip), %rdx # 0x29c9f movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 callq 0x99b7 movl $0x1, %r12d leaq 0x1a8f4(%rip), %r15 # 0x29ca8 leaq 0x298dd(%rip), %r13 # 0x38c98 testl %ebp, %r12d je 0xf3e3 movq (%r13), %rdx movq %r14, %rdi movq %r15, %rsi movl $0x1, %ecx callq 0x9a27 movq %r14, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e jmp 0xf406 testl %ebx, %r12d je 0xf406 movq (%r13), %rsi movq %r14, %rdi xorl %edx, %edx callq 0x6fa4 movq %r14, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE movq %r15, %rdx callq 0x75d5 addl %r12d, %r12d movq 0x8(%r13), %r15 addq $0x10, %r13 testq %r15, %r15 jne 0xf3bb movq %r14, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x664e nopl (%rax)
/mmanyen[P]CLua/build_O1/_deps/lua/linit.c
luaopen_io
LUAMOD_API int luaopen_io (lua_State *L) { luaL_newlib(L, iolib); /* new module */ createmeta(L); /* create (and set) default files */ createstdfile(L, stdin, IO_INPUT, "stdin"); createstdfile(L, stdout, IO_OUTPUT, "stdout"); createstdfile(L, stderr, NULL, "stderr"); return 1; }
pushq %rbx movq %rdi, %rbx movsd 0x19f18(%rip), %xmm0 # 0x29358 movl $0x88, %esi callq 0x9c8c movq %rbx, %rdi xorl %esi, %esi movl $0xb, %edx callq 0x7355 leaq 0x298e0(%rip), %rsi # 0x38d40 movq %rbx, %rdi xorl %edx, %edx callq 0x9919 leaq 0x1a88f(%rip), %rsi # 0x29d00 movq %rbx, %rdi callq 0x8bc3 leaq 0x29980(%rip), %rsi # 0x38e00 movq %rbx, %rdi xorl %edx, %edx callq 0x9919 movq %rbx, %rdi xorl %esi, %esi movl $0x7, %edx callq 0x7355 leaq 0x299b0(%rip), %rsi # 0x38e50 movq %rbx, %rdi xorl %edx, %edx callq 0x9919 leaq 0x1a90d(%rip), %rdx # 0x29dbe movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x75d5 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e movq 0x2aafe(%rip), %rax # 0x39fd0 movq (%rax), %rsi leaq 0x1a7e7(%rip), %rdx # 0x29cc3 leaq 0x1a097(%rip), %rcx # 0x2957a movq %rbx, %rdi callq 0xf52d movq 0x2aac6(%rip), %rax # 0x39fb8 movq (%rax), %rsi leaq 0x1a7d1(%rip), %rdx # 0x29ccd leaq 0x1a7d5(%rip), %rcx # 0x29cd8 movq %rbx, %rdi callq 0xf52d movq 0x2aac6(%rip), %rax # 0x39fd8 movq (%rax), %rsi leaq 0x1a7c3(%rip), %rcx # 0x29cdf movq %rbx, %rdi xorl %edx, %edx callq 0xf52d movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
createstdfile
static void createstdfile (lua_State *L, FILE *f, const char *k, const char *fname) { LStream *p = newprefile(L); p->f = f; p->closef = &io_noclose; if (k != NULL) { lua_pushvalue(L, -1); lua_setfield(L, LUA_REGISTRYINDEX, k); /* add file to registry */ } lua_setfield(L, -2, fname); /* add file to module */ }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %rcx, %rbx movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r14 movl $0x10, %esi xorl %edx, %edx callq 0x7f05 movq %rax, %r13 movq $0x0, 0x8(%rax) leaq 0x1a7a0(%rip), %rsi # 0x29d00 movq %r14, %rdi callq 0x8c47 movq %r12, (%r13) leaq 0x11ab(%rip), %rax # 0x1071e movq %rax, 0x8(%r13) testq %r15, %r15 je 0xf599 movq %r14, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x68aa movq %r14, %rdi movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 movq %r15, %rdx callq 0x75d5 movq %r14, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE movq %rbx, %rdx popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 jmp 0x75d5
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
io_lines
static int io_lines (lua_State *L) { int toclose; if (lua_isnone(L, 1)) lua_pushnil(L); /* at least one argument */ if (lua_isnil(L, 1)) { /* no file name? */ lua_getfield(L, LUA_REGISTRYINDEX, IO_INPUT); /* get default input */ lua_replace(L, 1); /* put it at index 1 */ tofile(L); /* check that it's a valid file handle */ toclose = 0; /* do not close it after iteration */ } else { /* open a new file */ const char *filename = luaL_checkstring(L, 1); opencheck(L, filename, "r"); lua_replace(L, 1); /* put file at index 1 */ toclose = 1; /* close it after iteration */ } aux_lines(L, toclose); /* push iteration function */ if (toclose) { lua_pushnil(L); /* state */ lua_pushnil(L); /* control */ lua_pushvalue(L, 1); /* file is the to-be-closed variable (4th result) */ return 4; } else return 1; }
pushq %rbp pushq %r14 pushq %rbx movq %rdi, %rbx movl $0x1, %esi callq 0x68d4 cmpl $-0x1, %eax jne 0xf637 movq %rbx, %rdi callq 0x6d71 movl $0x1, %r14d movq %rbx, %rdi movl $0x1, %esi callq 0x68d4 movl %eax, %ebp testl %eax, %eax je 0xf692 movq %rbx, %rdi movl $0x1, %esi xorl %edx, %edx callq 0x8dfc leaq 0x1ae5d(%rip), %rdx # 0x2a4c3 movq %rbx, %rdi movq %rax, %rsi callq 0xfb9e movq %rbx, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF movl $0x1, %edx callq 0x67d5 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e jmp 0xf6d0 leaq 0x1a62a(%rip), %rdx # 0x29cc3 movq %rbx, %rdi movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 callq 0x71a1 movq %rbx, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF movl $0x1, %edx callq 0x67d5 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e movq %rbx, %rdi callq 0xfa5f xorl %r14d, %r14d movq %rbx, %rdi movl %r14d, %esi callq 0xfc57 testl %ebp, %ebp je 0xf703 movq %rbx, %rdi callq 0x6d71 movq %rbx, %rdi callq 0x6d71 movq %rbx, %rdi movl $0x1, %esi callq 0x68aa movl $0x4, %eax jmp 0xf708 movl $0x1, %eax popq %rbx popq %r14 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
io_open
static int io_open (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newfile(L); const char *md = mode; /* to traverse/check mode */ luaL_argcheck(L, l_checkmode(md), 2, "invalid mode"); errno = 0; p->f = fopen(filename, mode); return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdi, %rbx xorl %r13d, %r13d movl $0x1, %esi xorl %edx, %edx callq 0x8dfc movq %rax, %r14 leaq 0x1ad8f(%rip), %rdx # 0x2a4c3 movq %rbx, %rdi movl $0x2, %esi xorl %ecx, %ecx callq 0x8da3 movq %rax, %r15 movl $0x10, %esi movq %rbx, %rdi xorl %edx, %edx callq 0x7f05 movq %rax, %r12 movq %r13, 0x8(%rax) leaq 0x1a59d(%rip), %rsi # 0x29d00 movq %rbx, %rdi callq 0x8c47 movq %r13, (%r12) leaq 0x49a(%rip), %rax # 0xfc10 movq %rax, 0x8(%r12) movsbl (%r15), %esi testl %esi, %esi je 0xf7cc leaq 0x1a61a(%rip), %rdi # 0x29da4 movl $0x4, %edx callq 0x5380 testq %rax, %rax je 0xf7cc leaq 0x1(%r15), %rax movq %r15, %r13 addq $0x2, %r13 cmpb $0x2b, 0x1(%r15) cmovneq %rax, %r13 leaq 0x1a8f5(%rip), %rsi # 0x2a0a9 movq %r13, %rdi callq 0x5170 movq %rax, %rbp movq %r13, %rdi callq 0x5180 cmpq %rax, %rbp je 0xf7e0 leaq 0x1a5c4(%rip), %rdx # 0x29d97 movq %rbx, %rdi movl $0x2, %esi callq 0x86ba callq 0x5060 movl $0x0, (%rax) movq %r14, %rdi movq %r15, %rsi callq 0x5390 movq %rax, (%r12) testq %rax, %rax je 0xf813 movl $0x1, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi xorl %esi, %esi movq %r14, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x8acb
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
io_tmpfile
static int io_tmpfile (lua_State *L) { LStream *p = newfile(L); errno = 0; p->f = tmpfile(); return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1; }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx xorl %r15d, %r15d movl $0x10, %esi xorl %edx, %edx callq 0x7f05 movq %rax, %r14 movq %r15, 0x8(%rax) leaq 0x1a3a4(%rip), %rsi # 0x29d00 movq %rbx, %rdi callq 0x8c47 movq %r15, (%r14) leaq 0x2a2(%rip), %rax # 0xfc10 movq %rax, 0x8(%r14) callq 0x5060 movl $0x0, (%rax) callq 0x5510 movq %rax, (%r14) testq %rax, %rax je 0xf995 movl $0x1, %eax popq %rbx popq %r14 popq %r15 retq movq %rbx, %rdi xorl %esi, %esi xorl %edx, %edx popq %rbx popq %r14 popq %r15 jmp 0x8acb
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
io_type
static int io_type (lua_State *L) { LStream *p; luaL_checkany(L, 1); p = (LStream *)luaL_testudata(L, 1, LUA_FILEHANDLE); if (p == NULL) luaL_pushfail(L); /* not a file */ else if (isclosed(p)) lua_pushliteral(L, "closed file"); else lua_pushliteral(L, "file"); return 1; }
pushq %rbx movq %rdi, %rbx movl $0x1, %esi callq 0x8e84 leaq 0x1a345(%rip), %rdx # 0x29d00 movq %rbx, %rdi movl $0x1, %esi callq 0x8c66 testq %rax, %rax je 0xf9dd cmpq $0x0, 0x8(%rax) je 0xf9e7 leaq 0x1a343(%rip), %rsi # 0x29d1e jmp 0xf9ee movq %rbx, %rdi callq 0x6d71 jmp 0xf9f6 leaq 0x1a329(%rip), %rsi # 0x29d17 movq %rbx, %rdi callq 0x6e5b movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
getiofile
static FILE *getiofile (lua_State *L, const char *findex) { LStream *p; lua_getfield(L, LUA_REGISTRYINDEX, findex); p = (LStream *)lua_touserdata(L, -1); if (l_unlikely(isclosed(p))) luaL_error(L, "default %s file is closed", findex + IOPREF_LEN); return p->f; }
pushq %r15 pushq %r14 pushq %rbx movq %rsi, %rbx movq %rdi, %r14 movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 movq %rbx, %rdx callq 0x71a1 movq %r14, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x6cbc movq %rax, %r15 cmpq $0x0, 0x8(%rax) je 0xfb0d movq (%r15), %rax popq %rbx popq %r14 popq %r15 retq addq $0x4, %rbx leaq 0x1a20b(%rip), %rsi # 0x29d23 movq %r14, %rdi movq %rbx, %rdx xorl %eax, %eax callq 0x87c6 jmp 0xfb04
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
g_iofile
static int g_iofile (lua_State *L, const char *f, const char *mode) { if (!lua_isnoneornil(L, 1)) { const char *filename = lua_tostring(L, 1); if (filename) opencheck(L, filename, mode); else { tofile(L); /* check that it's a valid file handle */ lua_pushvalue(L, 1); } lua_setfield(L, LUA_REGISTRYINDEX, f); } /* return current value */ lua_getfield(L, LUA_REGISTRYINDEX, f); return 1; }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 movl $0x1, %esi callq 0x68d4 testl %eax, %eax jle 0xfb89 movq %r14, %rdi movl $0x1, %esi xorl %edx, %edx callq 0x6bb8 movq %r14, %rdi testq %rax, %rax je 0xfb67 movq %rax, %rsi movq %r15, %rdx callq 0xfb9e jmp 0xfb79 callq 0xfa5f movq %r14, %rdi movl $0x1, %esi callq 0x68aa movq %r14, %rdi movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 movq %rbx, %rdx callq 0x75d5 movq %r14, %rdi movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 movq %rbx, %rdx popq %rbx popq %r14 popq %r15 jmp 0x71a1
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
opencheck
static void opencheck (lua_State *L, const char *fname, const char *mode) { LStream *p = newfile(L); p->f = fopen(fname, mode); if (l_unlikely(p->f == NULL)) luaL_error(L, "cannot open file '%s' (%s)", fname, strerror(errno)); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 xorl %r13d, %r13d movl $0x10, %esi xorl %edx, %edx callq 0x7f05 movq %rax, %r12 movq %r13, 0x8(%rax) leaq 0x1a133(%rip), %rsi # 0x29d00 movq %r14, %rdi callq 0x8c47 movq %r13, (%r12) leaq 0x30(%rip), %rax # 0xfc10 movq %rax, 0x8(%r12) movq %rbx, %rdi movq %r15, %rsi callq 0x5390 movq %rax, (%r12) testq %rax, %rax je 0xfc03 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %r14, %rdi movq %rbx, %rsi callq 0x58be jmp 0xfbf9
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
aux_lines
static void aux_lines (lua_State *L, int toclose) { int n = lua_gettop(L) - 1; /* number of arguments to read */ luaL_argcheck(L, n <= MAXARGLINE, MAXARGLINE + 2, "too many arguments"); lua_pushvalue(L, 1); /* file */ lua_pushinteger(L, n); /* number of arguments to read */ lua_pushboolean(L, toclose); /* close/not close file when finished */ lua_rotate(L, 2, 3); /* move the three values to their positions */ lua_pushcclosure(L, io_readline, 3 + n); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movl %esi, %ebp movq %rdi, %rbx callq 0x663a movl %eax, %r14d cmpl $0xfc, %eax jge 0xfcca leal -0x1(%r14), %r15d movq %rbx, %rdi movl $0x1, %esi callq 0x68aa movslq %r15d, %rsi movq %rbx, %rdi callq 0x6d91 movq %rbx, %rdi movl %ebp, %esi callq 0x704c movq %rbx, %rdi movl $0x2, %esi movl $0x3, %edx callq 0x66f8 addl $0x2, %r14d leaq 0x2b(%rip), %rsi # 0xfce0 movq %rbx, %rdi movl %r14d, %edx addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0x6fa4 leaq 0x1a087(%rip), %rdx # 0x29d58 movq %rbx, %rdi movl $0xfc, %esi callq 0x86ba jmp 0xfc72
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
read_line
static int read_line (lua_State *L, FILE *f, int chop) { luaL_Buffer b; int c; luaL_buffinit(L, &b); do { /* may need to read several chunks to get whole line */ char *buff = luaL_prepbuffer(&b); /* preallocate buffer space */ unsigned i = 0; l_lockfile(f); /* no memory errors can happen inside the lock */ while (i < LUAL_BUFFERSIZE && (c = l_getc(f)) != EOF && c != '\n') buff[i++] = cast_char(c); /* read up to end of line or buffer limit */ l_unlockfile(f); luaL_addsize(&b, i); } while (c != EOF && c != '\n'); /* repeat until end of line */ if (!chop && c == '\n') /* want a newline and have one? */ luaL_addchar(&b, '\n'); /* add ending newline to result */ luaL_pushresult(&b); /* close buffer */ /* return ok if read something (either a newline or something else) */ return (c == '\n' || lua_rawlen(L, -1) > 0); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x428, %rsp # imm = 0x428 movl %edx, %r14d movq %rsi, %r15 leaq 0x8(%rsp), %r12 movq %rdi, (%rsp) movq %r12, %rsi callq 0x8517 movl $0x400, %esi # imm = 0x400 movq %r12, %rdi callq 0x857a movq %rax, %r13 xorl %ebx, %ebx movq %r15, %rdi callq 0x5120 movl %eax, %ebp cmpl $-0x1, %eax je 0x102b2 cmpl $0xa, %ebp je 0x102b2 movb %bpl, (%r13,%rbx) incq %rbx cmpq $0x400, %rbx # imm = 0x400 jne 0x10288 movl $0x400, %ebx # imm = 0x400 movl %ebx, %eax addq 0x18(%rsp), %rax movq %rax, 0x18(%rsp) cmpl $0xa, %ebp je 0x102c8 cmpl $-0x1, %ebp jne 0x10276 movl %ebp, %ecx xorl $0xa, %ecx orl %ecx, %r14d jne 0x102ff cmpq 0x10(%rsp), %rax jb 0x102e8 leaq 0x8(%rsp), %rdi movl $0x1, %esi callq 0x857a movq 0x8(%rsp), %rax movq 0x18(%rsp), %rcx leaq 0x1(%rcx), %rdx movq %rdx, 0x18(%rsp) movb $0xa, (%rax,%rcx) leaq 0x8(%rsp), %rdi callq 0x85e7 movl $0x1, %eax cmpl $0xa, %ebp je 0x1032c movq (%rsp), %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x6c51 movq %rax, %rcx xorl %eax, %eax testq %rcx, %rcx setne %al addq $0x428, %rsp # imm = 0x428 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
nextc
static int nextc (RN *rn) { if (l_unlikely(rn->n >= L_MAXLENNUM)) { /* buffer overflow? */ rn->buff[0] = '\0'; /* invalidate result */ return 0; /* fail */ } else { rn->buff[rn->n++] = cast_char(rn->c); /* save current char */ rn->c = l_getc(rn->f); /* read next one */ return 1; } }
pushq %rbx movq %rdi, %rbx movslq 0xc(%rdi), %rax cmpq $0xc8, %rax jge 0x103bf movb 0x8(%rbx), %cl leal 0x1(%rax), %edx movl %edx, 0xc(%rbx) movb %cl, 0x10(%rbx,%rax) movq (%rbx), %rdi callq 0x5120 movl %eax, 0x8(%rbx) movl $0x1, %eax popq %rbx retq movb $0x0, 0x10(%rbx) xorl %eax, %eax jmp 0x103bd
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
g_write
static int g_write (lua_State *L, FILE *f, int arg) { int nargs = lua_gettop(L) - arg; size_t totalbytes = 0; /* total number of bytes written */ errno = 0; for (; nargs--; arg++) { /* for each argument */ char buff[LUA_N2SBUFFSZ]; const char *s; size_t numbytes; /* bytes written in one call to 'fwrite' */ size_t len = lua_numbertocstring(L, arg, buff); /* try as a number */ if (len > 0) { /* did conversion work (value was a number)? */ s = buff; len--; } else /* must be a string */ s = luaL_checklstring(L, arg, &len); numbytes = fwrite(s, sizeof(char), len, f); totalbytes += numbytes; if (numbytes < len) { /* write error? */ int n = luaL_fileresult(L, 0, NULL); lua_pushinteger(L, cast_st2S(totalbytes)); return n + 1; /* return fail, error msg., error code, and counter */ } } return 1; /* no errors; file handle already on stack top */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movl %edx, %ebx movq %rsi, 0x18(%rsp) movq %rdi, %r15 callq 0x663a movl %eax, %ebp callq 0x5060 movl $0x0, (%rax) movl $0x1, %eax movl %ebp, 0x14(%rsp) cmpl %ebx, %ebp je 0x104cd xorl %r13d, %r13d leaq 0x20(%rsp), %r14 movq %r15, %rdi movl %ebx, %esi movq %r14, %rdx callq 0x6abb movl %eax, %ecx movq %rcx, 0x8(%rsp) testl %eax, %eax je 0x1045d decq %rcx movq %rcx, 0x8(%rsp) movq %r14, %rdi jmp 0x1046f movq %r15, %rdi movl %ebx, %esi leaq 0x8(%rsp), %rdx callq 0x8dfc movq %rax, %rdi movq 0x8(%rsp), %rdx movl $0x1, %esi movq 0x18(%rsp), %rcx callq 0x55a0 movq %rax, %r14 addq %rax, %r13 movq 0x8(%rsp), %r12 cmpq %r12, %rax jae 0x104ae movq %r15, %rdi xorl %esi, %esi xorl %edx, %edx callq 0x8acb movl %eax, %ebp movq %r15, %rdi movq %r13, %rsi callq 0x6d91 incl %ebp cmpq %r12, %r14 jb 0x104cb incl %ebx cmpl %ebx, 0x14(%rsp) leaq 0x20(%rsp), %r14 jne 0x10438 movl $0x1, %eax jmp 0x104cd movl %ebp, %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
f_tostring
static int f_tostring (lua_State *L) { LStream *p = tolstream(L); if (isclosed(p)) lua_pushliteral(L, "file (closed)"); else lua_pushfstring(L, "file (%p)", p->f); return 1; }
pushq %rbx movq %rdi, %rbx leaq 0x197bc(%rip), %rdx # 0x29d00 movl $0x1, %esi callq 0x8cd9 cmpq $0x0, 0x8(%rax) je 0x1056b movq (%rax), %rdx leaq 0x19875(%rip), %rsi # 0x29dd4 movq %rbx, %rdi xorl %eax, %eax callq 0x6ee9 jmp 0x1057a leaq 0x19854(%rip), %rsi # 0x29dc6 movq %rbx, %rdi callq 0x6e5b movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
f_seek
static int f_seek (lua_State *L) { static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; static const char *const modenames[] = {"set", "cur", "end", NULL}; FILE *f = tofile(L); int op = luaL_checkoption(L, 2, "cur", modenames); lua_Integer p3 = luaL_optinteger(L, 3, 0); l_seeknum offset = (l_seeknum)p3; luaL_argcheck(L, (lua_Integer)offset == p3, 3, "not an integer in proper range"); errno = 0; op = l_fseek(f, offset, mode[op]); if (l_unlikely(op)) return luaL_fileresult(L, 0, NULL); /* error */ else { lua_pushinteger(L, (lua_Integer)l_ftell(f)); return 1; } }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx callq 0xfa5f movq %rax, %r14 leaq 0x197d5(%rip), %rdx # 0x29deb leaq 0x288b3(%rip), %rcx # 0x38ed0 movq %rbx, %rdi movl $0x2, %esi callq 0x8d12 movl %eax, %ebp movq %rbx, %rdi movl $0x3, %esi xorl %edx, %edx callq 0x8fb7 movq %rax, %r15 callq 0x5060 movl $0x0, (%rax) movslq %ebp, %rax leaq 0x197c5(%rip), %rcx # 0x29e18 movl (%rcx,%rax,4), %edx movq %r14, %rdi movq %r15, %rsi callq 0x5370 testl %eax, %eax jne 0x10688 movq %r14, %rdi callq 0x5030 movq %rbx, %rdi movq %rax, %rsi callq 0x6d91 movl $0x1, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq movq %rbx, %rdi xorl %esi, %esi xorl %edx, %edx addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0x8acb
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
f_setvbuf
static int f_setvbuf (lua_State *L) { static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; static const char *const modenames[] = {"no", "full", "line", NULL}; FILE *f = tofile(L); int op = luaL_checkoption(L, 2, NULL, modenames); lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); int res; errno = 0; res = setvbuf(f, NULL, mode[op], (size_t)sz); return luaL_fileresult(L, res == 0, NULL); }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx callq 0xfa5f movq %rax, %r14 leaq 0x28839(%rip), %rcx # 0x38ef0 movq %rbx, %rdi movl $0x2, %esi xorl %edx, %edx callq 0x8d12 movl %eax, %ebp movl $0x400, %edx # imm = 0x400 movq %rbx, %rdi movl $0x3, %esi callq 0x8fb7 movq %rax, %r15 callq 0x5060 movl $0x0, (%rax) movslq %ebp, %rax leaq 0x19732(%rip), %rcx # 0x29e24 movl (%rcx,%rax,4), %edx movq %r14, %rdi xorl %esi, %esi movq %r15, %rcx callq 0x5050 xorl %esi, %esi testl %eax, %eax sete %sil movq %rbx, %rdi xorl %edx, %edx addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp jmp 0x8acb
/mmanyen[P]CLua/build_O1/_deps/lua/liolib.c
luaopen_math
LUAMOD_API int luaopen_math (lua_State *L) { luaL_newlib(L, mathlib); lua_pushnumber(L, PI); lua_setfield(L, -2, "pi"); lua_pushnumber(L, (lua_Number)HUGE_VAL); lua_setfield(L, -2, "huge"); lua_pushinteger(L, LUA_MAXINTEGER); lua_setfield(L, -2, "maxinteger"); lua_pushinteger(L, LUA_MININTEGER); lua_setfield(L, -2, "mininteger"); setrandfunc(L); return 1; }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx movsd 0x18bed(%rip), %xmm0 # 0x29358 movl $0x88, %esi callq 0x9c8c movq %rbx, %rdi xorl %esi, %esi movl $0x1b, %edx callq 0x7355 leaq 0x28785(%rip), %rsi # 0x38f10 movq %rbx, %rdi xorl %edx, %edx callq 0x9919 movsd 0x19693(%rip), %xmm0 # 0x29e30 movq %rbx, %rdi callq 0x6d7f leaq 0x196e4(%rip), %rdx # 0x29e90 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x75d5 movsd 0x18847(%rip), %xmm0 # 0x29008 movq %rbx, %rdi callq 0x6d7f leaq 0x196c3(%rip), %rdx # 0x29e93 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x75d5 movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF movq %rbx, %rdi movq %r14, %rsi callq 0x6d91 leaq 0x1969f(%rip), %rdx # 0x29e98 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x75d5 incq %r14 movq %rbx, %rdi movq %r14, %rsi callq 0x6d91 leaq 0x19688(%rip), %rdx # 0x29ea3 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x75d5 movl $0x20, %esi movq %rbx, %rdi xorl %edx, %edx callq 0x7f05 movq %rax, %r14 movq %rbx, %rdi callq 0x9c2f movl %eax, %edx movq %rbx, %rdi movq %r14, %rsi xorl %ecx, %ecx callq 0x10eee movq %rbx, %rdi movl $0xfffffffd, %esi # imm = 0xFFFFFFFD callq 0x664e leaq 0x2886b(%rip), %rsi # 0x390d0 movq %rbx, %rdi movl $0x1, %edx callq 0x9919 movl $0x1, %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_abs
static int math_abs (lua_State *L) { if (lua_isinteger(L, 1)) { lua_Integer n = lua_tointeger(L, 1); if (n < 0) n = (lua_Integer)(0u - (lua_Unsigned)n); lua_pushinteger(L, n); } else lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); return 1; }
pushq %rbx movq %rdi, %rbx movl $0x1, %esi callq 0x6924 movq %rbx, %rdi movl $0x1, %esi testl %eax, %eax je 0x108b4 xorl %edx, %edx callq 0x6b52 movq %rax, %rsi negq %rsi cmovsq %rax, %rsi movq %rbx, %rdi callq 0x6d91 jmp 0x108c8 callq 0x8eb7 andps 0x195c0(%rip), %xmm0 # 0x29e80 movq %rbx, %rdi callq 0x6d7f movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_toint
static int math_toint (lua_State *L) { int valid; lua_Integer n = lua_tointegerx(L, 1, &valid); if (l_likely(valid)) lua_pushinteger(L, n); else { luaL_checkany(L, 1); luaL_pushfail(L); /* value is not convertible to integer */ } return 1; }
pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx leaq 0x4(%rsp), %r14 movl $0x1, %esi movq %r14, %rdx callq 0x6b52 cmpl $0x0, (%r14) je 0x10a43 movq %rbx, %rdi movq %rax, %rsi callq 0x6d91 movl $0x1, %eax addq $0x8, %rsp popq %rbx popq %r14 retq movq %rbx, %rdi callq 0x58f2 jmp 0x10a36
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_floor
static int math_floor (lua_State *L) { if (lua_isinteger(L, 1)) lua_settop(L, 1); /* integer is its own floor */ else { lua_Number d = l_mathop(floor)(luaL_checknumber(L, 1)); pushnumint(L, d); } return 1; }
pushq %rbx movq %rdi, %rbx movl $0x1, %esi callq 0x6924 testl %eax, %eax je 0x10a6e movq %rbx, %rdi movl $0x1, %esi callq 0x664e jmp 0x10a88 movq %rbx, %rdi movl $0x1, %esi callq 0x8eb7 callq 0x54e0 movq %rbx, %rdi callq 0x10ec4 movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_log
static int math_log (lua_State *L) { lua_Number x = luaL_checknumber(L, 1); lua_Number res; if (lua_isnoneornil(L, 2)) res = l_mathop(log)(x); else { lua_Number base = luaL_checknumber(L, 2); #if !defined(LUA_USE_C89) if (base == l_mathop(2.0)) res = l_mathop(log2)(x); else #endif if (base == l_mathop(10.0)) res = l_mathop(log10)(x); else res = l_mathop(log)(x)/l_mathop(log)(base); } lua_pushnumber(L, res); return 1; }
pushq %rbx subq $0x10, %rsp movq %rdi, %rbx movl $0x1, %esi callq 0x8eb7 movsd %xmm0, (%rsp) movq %rbx, %rdi movl $0x2, %esi callq 0x68d4 testl %eax, %eax jle 0x10be0 movq %rbx, %rdi movl $0x2, %esi callq 0x8eb7 ucomisd 0x19278(%rip), %xmm0 # 0x29e48 jne 0x10bec jp 0x10bec movsd (%rsp), %xmm0 callq 0x5530 jmp 0x10c30 movsd (%rsp), %xmm0 callq 0x5270 jmp 0x10c30 movapd %xmm0, %xmm1 ucomisd 0x19258(%rip), %xmm0 # 0x29e50 movsd (%rsp), %xmm0 jne 0x10c08 jp 0x10c08 callq 0x51a0 jmp 0x10c30 movsd %xmm1, 0x8(%rsp) callq 0x5270 movsd %xmm0, (%rsp) movsd 0x8(%rsp), %xmm0 callq 0x5270 movsd (%rsp), %xmm1 divsd %xmm0, %xmm1 movapd %xmm1, %xmm0 movq %rbx, %rdi callq 0x6d7f movl $0x1, %eax addq $0x10, %rsp popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_min
static int math_min (lua_State *L) { int n = lua_gettop(L); /* number of arguments */ int imin = 1; /* index of current minimum value */ int i; luaL_argcheck(L, n >= 1, 1, "value expected"); for (i = 2; i <= n; i++) { if (lua_compare(L, i, imin, LUA_OPLT)) imin = i; } lua_pushvalue(L, imin); return 1; }
pushq %rbp pushq %r15 pushq %r14 pushq %rbx pushq %rax movq %rdi, %rbx callq 0x663a movl %eax, %r14d testl %eax, %eax jle 0x10d39 movl $0x1, %ebp cmpl $0x2, %r14d jl 0x10d1f negl %r14d movl $0x2, %r15d movq %rbx, %rdi movl %r15d, %esi movl %ebp, %edx movl $0x1, %ecx callq 0x6a1e testl %eax, %eax je 0x10d0c movl %r15d, %ebp leal (%r14,%r15), %eax incl %eax movl %r15d, %ecx incl %ecx movl %ecx, %r15d cmpl $0x1, %eax jne 0x10cf3 movq %rbx, %rdi movl %ebp, %esi callq 0x68aa movl $0x1, %eax addq $0x8, %rsp popq %rbx popq %r14 popq %r15 popq %rbp retq leaq 0x1882a(%rip), %rdx # 0x2956a movq %rbx, %rdi movl $0x1, %esi callq 0x86ba jmp 0x10cdf
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_modf
static int math_modf (lua_State *L) { if (lua_isinteger(L ,1)) { lua_settop(L, 1); /* number is its own integer part */ lua_pushnumber(L, 0); /* no fractional part */ } else { lua_Number n = luaL_checknumber(L, 1); /* integer part (rounds toward zero) */ lua_Number ip = (n < 0) ? l_mathop(ceil)(n) : l_mathop(floor)(n); pushnumint(L, ip); /* fractional part (test needed for inf/-inf) */ lua_pushnumber(L, (n == ip) ? l_mathop(0.0) : (n - ip)); } return 2; }
pushq %rbx subq $0x20, %rsp movq %rdi, %rbx movl $0x1, %esi callq 0x6924 movq %rbx, %rdi movl $0x1, %esi testl %eax, %eax je 0x10d78 callq 0x664e xorpd %xmm0, %xmm0 jmp 0x10dc4 callq 0x8eb7 xorpd %xmm1, %xmm1 ucomisd %xmm0, %xmm1 movapd %xmm0, 0x10(%rsp) jbe 0x10d94 callq 0x50b0 jmp 0x10d99 callq 0x54e0 movq %rbx, %rdi movsd %xmm0, 0x8(%rsp) callq 0x10ec4 movapd 0x10(%rsp), %xmm0 movapd %xmm0, %xmm1 movsd 0x8(%rsp), %xmm2 subsd %xmm2, %xmm1 cmpeqsd %xmm2, %xmm0 andnpd %xmm1, %xmm0 movq %rbx, %rdi callq 0x6d7f movl $0x2, %eax addq $0x20, %rsp popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_type
static int math_type (lua_State *L) { if (lua_type(L, 1) == LUA_TNUMBER) lua_pushstring(L, (lua_isinteger(L, 1)) ? "integer" : "float"); else { luaL_checkany(L, 1); luaL_pushfail(L); } return 1; }
pushq %rbx movq %rdi, %rbx movl $0x1, %esi callq 0x68d4 movq %rbx, %rdi movl $0x1, %esi cmpl $0x3, %eax jne 0x10eb0 callq 0x6924 testl %eax, %eax leaq 0x19078(%rip), %rax # 0x29f13 leaq 0x1a5b4(%rip), %rsi # 0x2b456 cmoveq %rax, %rsi movq %rbx, %rdi callq 0x6e5b jmp 0x10ebd callq 0x8e84 movq %rbx, %rdi callq 0x6d71 movl $0x1, %eax popq %rbx retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
setseed
static void setseed (lua_State *L, Rand64 *state, lua_Unsigned n1, lua_Unsigned n2) { int i; state[0] = Int2I(n1); state[1] = Int2I(0xff); /* avoid a zero state */ state[2] = Int2I(n2); state[3] = Int2I(0); for (i = 0; i < 16; i++) nextrand(state); /* discard initial values to "spread" seed */ lua_pushinteger(L, l_castU2S(n1)); lua_pushinteger(L, l_castU2S(n2)); }
pushq %r14 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdi, %r14 movq %rdx, (%rsi) movq $0xff, 0x8(%rsi) movq %rcx, 0x10(%rsi) movq $0x0, 0x18(%rsi) movl $0xff, %edi movl $0x10, %ecx xorl %eax, %eax movq %rdx, %r8 movq %rbx, %r9 movq %r9, %r10 movq %rdi, %r9 xorq %r8, %r10 xorq %rdi, %rax xorq %rax, %r8 movq %r10, %rdi xorq %r9, %rdi shlq $0x11, %r9 xorq %r10, %r9 rolq $0x2d, %rax decl %ecx jne 0x10f21 movq %r8, (%rsi) movq %rdi, 0x8(%rsi) movq %r9, 0x10(%rsi) movq %rax, 0x18(%rsi) movq %r14, %rdi movq %rdx, %rsi callq 0x6d91 movq %r14, %rdi movq %rbx, %rsi addq $0x8, %rsp popq %rbx popq %r14 jmp 0x6d91
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
math_randomseed
static int math_randomseed (lua_State *L) { RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1)); lua_Unsigned n1, n2; if (lua_isnone(L, 1)) { n1 = luaL_makeseed(L); /* "random" seed */ n2 = I2UInt(nextrand(state->s)); /* in case seed is not that random... */ } else { n1 = l_castS2U(luaL_checkinteger(L, 1)); n2 = l_castS2U(luaL_optinteger(L, 2, 0)); } setseed(L, state->s, n1, n2); return 2; /* return seeds */ }
pushq %r15 pushq %r14 pushq %rbx movq %rdi, %rbx movl $0xfff0b9d7, %esi # imm = 0xFFF0B9D7 callq 0x6cbc movq %rax, %r14 movq %rbx, %rdi movl $0x1, %esi callq 0x68d4 movq %rbx, %rdi cmpl $-0x1, %eax je 0x11170 movl $0x1, %esi callq 0x8f2d movq %rax, %r15 movq %rbx, %rdi movl $0x2, %esi xorl %edx, %edx callq 0x8fb7 movq %rax, %rcx jmp 0x111bc callq 0x9c2f movl %eax, %r15d movq (%r14), %rax movq 0x8(%r14), %rdx movq 0x10(%r14), %rsi xorq %rax, %rsi movq 0x18(%r14), %rdi xorq %rdx, %rdi leaq (%rdx,%rdx,4), %rcx rolq $0x7, %rcx leaq (%rcx,%rcx,8), %rcx xorq %rdi, %rax movq %rax, (%r14) movq %rsi, %rax xorq %rdx, %rax movq %rax, 0x8(%r14) shlq $0x11, %rdx xorq %rsi, %rdx movq %rdx, 0x10(%r14) rolq $0x2d, %rdi movq %rdi, 0x18(%r14) movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx callq 0x10eee movl $0x2, %eax popq %rbx popq %r14 popq %r15 retq nopl (%rax)
/mmanyen[P]CLua/build_O1/_deps/lua/lmathlib.c
luaM_growaux_
void *luaM_growaux_ (lua_State *L, void *block, int nelems, int *psize, unsigned size_elems, int limit, const char *what) { void *newblock; int size = *psize; if (nelems + 1 <= size) /* does one extra element still fit? */ return block; /* nothing to be done */ if (size >= limit / 2) { /* cannot double it? */ if (l_unlikely(size >= limit)) /* cannot grow even a little? */ luaG_runerror(L, "too many %s (limit is %d)", what, limit); size = limit; /* still have at least one free place */ } else { size *= 2; if (size < MINSIZEARRAY) size = MINSIZEARRAY; /* minimum size */ } lua_assert(nelems + 1 <= size && size <= limit); /* 'limit' ensures that multiplication will not overflow */ newblock = luaM_saferealloc_(L, block, cast_sizet(*psize) * size_elems, cast_sizet(size) * size_elems); *psize = size; /* update only when everything else is OK */ return newblock; }
pushq %r14 pushq %rbx pushq %rax movl %edx, %eax movslq (%rcx), %rdx cmpl %eax, %edx jle 0x111ea movq %rsi, %rax jmp 0x11229 movq %rcx, %rbx movl %r9d, %eax shrl $0x1f, %eax addl %r9d, %eax sarl %eax cmpl %eax, %edx jge 0x1120e leal (%rdx,%rdx), %eax cmpl $0x5, %eax movl $0x4, %r9d cmovgel %eax, %r9d jmp 0x11213 cmpl %r9d, %edx jge 0x11231 movl %r8d, %ecx imulq %rcx, %rdx movslq %r9d, %r14 imulq %r14, %rcx callq 0x11247 movl %r14d, (%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq movq 0x20(%rsp), %rdx leaq 0x18d08(%rip), %rsi # 0x29f45 movl %r9d, %ecx xorl %eax, %eax callq 0xa859
/mmanyen[P]CLua/build_O1/_deps/lua/lmem.c
luaM_shrinkvector_
void *luaM_shrinkvector_ (lua_State *L, void *block, int *size, int final_n, unsigned size_elem) { void *newblock; size_t oldsize = cast_sizet(*size) * size_elem; size_t newsize = cast_sizet(final_n) * size_elem; lua_assert(newsize <= oldsize); newblock = luaM_saferealloc_(L, block, oldsize, newsize); *size = final_n; return newblock; }
pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx movslq (%rdx), %rdx movl %r8d, %eax imulq %rax, %rdx movslq %ecx, %r14 imulq %r14, %rax movq %rax, %rcx callq 0x11247 movl %r14d, (%rbx) addq $0x8, %rsp popq %rbx popq %r14 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lmem.c
luaM_realloc_
void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { void *newblock; global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); newblock = firsttry(g, block, osize, nsize); if (l_unlikely(newblock == NULL && nsize > 0)) { newblock = tryagain(L, block, osize, nsize); if (newblock == NULL) /* still no memory? */ return NULL; /* do not update 'GCdebt' */ } lua_assert((nsize == 0) == (newblock == NULL)); g->GCdebt -= cast(l_mem, nsize) - cast(l_mem, osize); return newblock; }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 movq 0x18(%rdi), %r13 movq 0x8(%r13), %rdi callq *(%r13) testq %rbx, %rbx je 0x11300 testq %rax, %rax je 0x11311 subq %rbx, %r14 addq %r14, 0x18(%r13) popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx movq %rbx, %rcx callq 0x1132b testq %rax, %rax jne 0x11300 xorl %eax, %eax jmp 0x11307
/mmanyen[P]CLua/build_O1/_deps/lua/lmem.c
luaM_malloc_
void *luaM_malloc_ (lua_State *L, size_t size, int tag) { if (size == 0) return NULL; /* that's all */ else { global_State *g = G(L); void *newblock = firsttry(g, NULL, cast_sizet(tag), size); if (l_unlikely(newblock == NULL)) { newblock = tryagain(L, NULL, cast_sizet(tag), size); if (newblock == NULL) luaM_error(L); } g->GCdebt -= cast(l_mem, size); return newblock; } }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax testq %rsi, %rsi je 0x113be movq %rsi, %rbx movq %rdi, %r14 movq 0x18(%rdi), %r12 movq 0x8(%r12), %rdi movslq %edx, %r15 xorl %esi, %esi movq %r15, %rdx movq %rbx, %rcx callq *(%r12) testq %rax, %rax je 0x113cc subq %rbx, 0x18(%r12) jmp 0x113c0 xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq movq %r14, %rdi xorl %esi, %esi movq %r15, %rdx movq %rbx, %rcx callq 0x1132b testq %rax, %rax jne 0x113b7 movq %r14, %rdi movl $0x4, %esi callq 0xb220 nop
/mmanyen[P]CLua/build_O1/_deps/lua/lmem.c
setpath
static void setpath (lua_State *L, const char *fieldname, const char *envname, const char *dft) { const char *dftmark; const char *nver = lua_pushfstring(L, "%s%s", envname, LUA_VERSUFFIX); const char *path = getenv(nver); /* try versioned name */ if (path == NULL) /* no versioned environment variable? */ path = getenv(envname); /* try unversioned name */ if (path == NULL || noenv(L)) /* no environment variable? */ lua_pushexternalstring(L, dft, strlen(dft), NULL, NULL); /* use default */ else if ((dftmark = strstr(path, LUA_PATH_SEP LUA_PATH_SEP)) == NULL) lua_pushstring(L, path); /* nothing to change */ else { /* path contains a ";;": insert default path in its place */ size_t len = strlen(path); luaL_Buffer b; luaL_buffinit(L, &b); if (path < dftmark) { /* is there a prefix before ';;'? */ luaL_addlstring(&b, path, ct_diff2sz(dftmark - path)); /* add it */ luaL_addchar(&b, *LUA_PATH_SEP); } luaL_addstring(&b, dft); /* add default */ if (dftmark < path + len - 2) { /* is there a suffix after ';;'? */ luaL_addchar(&b, *LUA_PATH_SEP); luaL_addlstring(&b, dftmark + 2, ct_diff2sz((path + len - 2) - dftmark)); } luaL_pushresult(&b); } setprogdir(L); lua_setfield(L, -3, fieldname); /* package[fieldname] = path value */ lua_pop(L, 1); /* pop versioned variable name ('nver') */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x428, %rsp # imm = 0x428 movq %rcx, %r15 movq %rdx, %r13 movq %rsi, %r14 movq %rdi, %rbx leaq 0x18bad(%rip), %rsi # 0x2a1b2 leaq 0x18bab(%rip), %rcx # 0x2a1b7 xorl %eax, %eax callq 0x6ee9 movq %rax, %rdi callq 0x53e0 movq %rax, %r12 testq %rax, %rax jne 0x1162e movq %r13, %rdi callq 0x53e0 movq %rax, %r12 testq %r12, %r12 je 0x11667 leaq 0x18b85(%rip), %rdx # 0x2a1bf movq %rbx, %rdi movl $0xfff0b9d8, %esi # imm = 0xFFF0B9D8 callq 0x71a1 movq %rbx, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF callq 0x6b9e movl %eax, %ebp movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e testl %ebp, %ebp je 0x116b1 movq %r15, %rdi callq 0x5180 movq %rbx, %rdi movq %r15, %rsi movq %rax, %rdx xorl %ecx, %ecx xorl %r8d, %r8d callq 0x6e09 movq %rbx, %rdi movl $0xfffffffd, %esi # imm = 0xFFFFFFFD movq %r14, %rdx callq 0x75d5 movq %rbx, %rdi movl $0xfffffffe, %esi # imm = 0xFFFFFFFE callq 0x664e addq $0x428, %rsp # imm = 0x428 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x18b04(%rip), %rsi # 0x2a1bc movq %r12, %rdi callq 0x50f0 testq %rax, %rax je 0x117a5 movq %rax, %r13 movq %r12, %rdi callq 0x5180 movq %rax, %rbp leaq 0x8(%rsp), %rsi movq %rbx, %rdi callq 0x8517 cmpq %r13, %r12 jae 0x11737 movq %rbp, (%rsp) movq %r13, %rdx subq %r12, %rdx leaq 0x8(%rsp), %rbp movq %rbp, %rdi movq %r12, %rsi callq 0x913a movq 0x10(%rbp), %rax cmpq 0x8(%rbp), %rax jb 0x1171c leaq 0x8(%rsp), %rdi movl $0x1, %esi callq 0x857a movq 0x8(%rsp), %rax movq 0x18(%rsp), %rcx leaq 0x1(%rcx), %rdx movq %rdx, 0x18(%rsp) movb $0x3b, (%rax,%rcx) movq (%rsp), %rbp leaq 0x8(%rsp), %rdi movq %r15, %rsi callq 0x8537 leaq (%r12,%rbp), %r15 addq $-0x2, %r15 cmpq %r15, %r13 jae 0x11796 movq 0x18(%rsp), %rax cmpq 0x10(%rsp), %rax jb 0x1176c leaq 0x8(%rsp), %rdi movl $0x1, %esi callq 0x857a leaq 0x8(%rsp), %rdi movq (%rdi), %rax movq 0x10(%rdi), %rcx leaq 0x1(%rcx), %rdx movq %rdx, 0x10(%rdi) movb $0x3b, (%rax,%rcx) subq %r13, %r15 addq $0x2, %r13 movq %r13, %rsi movq %r15, %rdx callq 0x913a leaq 0x8(%rsp), %rdi callq 0x85e7 jmp 0x11682 movq %rbx, %rdi movq %r12, %rsi callq 0x6e5b jmp 0x11682
/mmanyen[P]CLua/build_O1/_deps/lua/loadlib.c
ll_loadlib
static int ll_loadlib (lua_State *L) { const char *path = luaL_checkstring(L, 1); const char *init = luaL_checkstring(L, 2); int stat = lookforfunc(L, path, init); if (l_likely(stat == 0)) /* no errors? */ return 1; /* return the loaded function */ else { /* error; error message is on stack top */ luaL_pushfail(L); lua_insert(L, -2); lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); return 3; /* return fail, error message, and where */ } }
pushq %rbp pushq %r14 pushq %rbx movq %rdi, %rbx movl $0x1, %ebp movl $0x1, %esi xorl %edx, %edx callq 0x8dfc movq %rax, %r14 movq %rbx, %rdi movl $0x2, %esi xorl %edx, %edx callq 0x8dfc movq %rbx, %rdi movq %r14, %rsi movq %rax, %rdx callq 0x11906 testl %eax, %eax jne 0x11852 movl %ebp, %eax popq %rbx popq %r14 popq %rbp retq movq %rbx, %rdi movl %eax, %esi callq 0x5908 movl $0x3, %ebp jmp 0x1184b
/mmanyen[P]CLua/build_O1/_deps/lua/loadlib.c
findfile
static const char *findfile (lua_State *L, const char *name, const char *pname, const char *dirsep) { const char *path; lua_getfield(L, lua_upvalueindex(1), pname); path = lua_tostring(L, -1); if (l_unlikely(path == NULL)) luaL_error(L, "'package.%s' must be a string", pname); return searchpath(L, name, path, ".", dirsep); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r15 movq %rsi, %rbx movq %rdi, %r14 movl $0xfff0b9d7, %esi # imm = 0xFFF0B9D7 callq 0x71a1 movq %r14, %rdi movl $0xffffffff, %esi # imm = 0xFFFFFFFF xorl %edx, %edx callq 0x6bb8 movq %rax, %r12 testq %rax, %rax je 0x11d8e leaq 0x18642(%rip), %rcx # 0x2a3b0 leaq 0x1a2dc(%rip), %r8 # 0x2c051 movq %r14, %rdi movq %rbx, %rsi movq %r12, %rdx addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x1199e leaq 0x183a8(%rip), %rsi # 0x2a13d movq %r14, %rdi movq %r15, %rdx xorl %eax, %eax callq 0x87c6 jmp 0x11d67
/mmanyen[P]CLua/build_O1/_deps/lua/loadlib.c
intarith
static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, lua_Integer v2) { switch (op) { case LUA_OPADD: return intop(+, v1, v2); case LUA_OPSUB:return intop(-, v1, v2); case LUA_OPMUL:return intop(*, v1, v2); case LUA_OPMOD: return luaV_mod(L, v1, v2); case LUA_OPIDIV: return luaV_idiv(L, v1, v2); case LUA_OPBAND: return intop(&, v1, v2); case LUA_OPBOR: return intop(|, v1, v2); case LUA_OPBXOR: return intop(^, v1, v2); case LUA_OPSHL: return luaV_shiftl(v1, v2); case LUA_OPSHR: return luaV_shiftr(v1, v2); case LUA_OPUNM: return intop(-, 0, v1); case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); default: lua_assert(0); return 0; } }
xorl %eax, %eax cmpl $0xd, %esi ja 0x12387 movl %esi, %esi leaq 0x17ec2(%rip), %r8 # 0x2a220 movslq (%r8,%rsi,4), %rsi addq %r8, %rsi jmpq *%rsi addq %rdx, %rcx jmp 0x12390 negq %rdx jmp 0x12384 imulq %rdx, %rcx jmp 0x12390 andq %rdx, %rcx jmp 0x12390 notq %rdx jmp 0x12384 subq %rcx, %rdx movq %rdx, %rax retq orq %rdx, %rcx jmp 0x12390 xorq %rdx, %rcx movq %rcx, %rax retq movq %rdx, %rsi movq %rcx, %rdx jmp 0x1e97f movq %rdx, %rsi movq %rcx, %rdx jmp 0x1e940 negq %rcx movq %rdx, %rdi movq %rcx, %rsi jmp 0x1e9fa
/mmanyen[P]CLua/build_O1/_deps/lua/lobject.c
luaO_str2num
size_t luaO_str2num (const char *s, TValue *o) { lua_Integer i; lua_Number n; const char *e; if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */ setivalue(o, i); } else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */ setfltvalue(o, n); } else return 0; /* conversion failed */ return ct_diff2sz(e - s) + 1; /* success; return string size */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xe0, %rsp movq %rsi, %r14 movq %rdi, %rbx leaq 0x19775(%rip), %rcx # 0x2bc20 movq %rdi, %rax movzbl (%rax), %edx incq %rax testb $0x8, 0x1(%rdx,%rcx) jne 0x124ae cmpl $0x2b, %edx je 0x124d1 cmpl $0x2d, %edx jne 0x124ce movl $0x8, %edi xorl %edx, %edx jmp 0x124d8 decq %rax movl $0x7, %edi movb $0x1, %dl movzbl (%rax), %r11d cmpq $0x30, %r11 jne 0x1253e movzbl 0x1(%rax), %esi orl $0x20, %esi cmpl $0x78, %esi jne 0x1253e movzbl 0x2(%rax), %edi addq $0x2, %rax testb $0x10, 0x1(%rdi,%rcx) je 0x12546 xorl %esi, %esi movsbq %dil, %r8 testb $0x2, 0x1(%r8,%rcx) je 0x12511 addb $-0x30, %dil jmp 0x12519 orb $0x20, %dil addb $-0x57, %dil movzbl %dil, %edi movq %rsi, %r8 shlq $0x4, %r8 movzbl %dil, %esi addq %r8, %rsi movzbl 0x1(%rax), %edi incq %rax testb $0x10, 0x1(%rdi,%rcx) jne 0x124ff movb $0x1, %dil jmp 0x125b4 testb $0x2, 0x1(%r11,%rcx) jne 0x1254c xorl %edi, %edi xorl %esi, %esi jmp 0x125b4 movl $0x1, %r10d movabsq $0xccccccccccccccb, %r8 # imm = 0xCCCCCCCCCCCCCCB leaq 0x1(%r8), %r9 xorl %esi, %esi movsbl %r11b, %r11d addl $-0x30, %r11d cmpq %r8, %rsi jbe 0x12587 cmpq %r9, %rsi setne %bpl cmpl %edi, %r11d setg %r15b orb %bpl, %r15b je 0x12587 xorl %r11d, %r11d jmp 0x12598 leaq (%rsi,%rsi,4), %rsi movl %r11d, %r10d leaq (%r10,%rsi,2), %rsi movb $0x1, %r11b xorl %r10d, %r10d testb %r11b, %r11b je 0x125e8 movzbl 0x1(%rax), %r11d incq %rax testb $0x2, 0x1(%r11,%rcx) jne 0x12562 testl %r10d, %r10d sete %dil decq %rax movzbl 0x1(%rax), %r8d incq %rax testb $0x8, 0x1(%r8,%rcx) jne 0x125b7 testb %r8b, %r8b setne %cl xorb $0x1, %dil orb %cl, %dil jne 0x125e4 movq %rsi, %rcx negq %rcx testb %dl, %dl cmovneq %rsi, %rcx jmp 0x125ea xorl %eax, %eax jmp 0x125ea xorl %eax, %eax movb $0x3, %dl testq %rax, %rax jne 0x12638 leaq 0x17dc7(%rip), %rsi # 0x2a3bf movq %rbx, %rdi callq 0x5500 testq %rax, %rax je 0x1260d movzbl (%rax), %ebp orl $0x20, %ebp jmp 0x1260f xorl %ebp, %ebp cmpl $0x6e, %ebp jne 0x12618 xorl %eax, %eax jmp 0x1262c leaq 0x8(%rsp), %rsi movq %rbx, %rdi movl %ebp, %edx callq 0x12e04 testq %rax, %rax je 0x12659 testq %rax, %rax je 0x12655 movb $0x13, %dl movq 0x8(%rsp), %rcx movq %rcx, (%r14) movb %dl, 0x8(%r14) subq %rbx, %rax incq %rax addq $0xe0, %rsp popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq xorl %eax, %eax jmp 0x12645 movq %rbx, %rdi movl $0x2e, %esi callq 0x5140 testq %rax, %rax je 0x12614 movq %rax, %r15 movq %rbx, %rdi callq 0x5180 cmpq $0xc8, %rax ja 0x12614 leaq 0x10(%rsp), %r12 movq %r12, %rdi movq %rbx, %rsi callq 0x52f0 callq 0x5590 movq (%rax), %rax movb (%rax), %al subq %rbx, %r15 movb %al, 0x10(%rsp,%r15) leaq 0x8(%rsp), %rsi movq %r12, %rdi movl %ebp, %edx callq 0x12e04 movq %rax, %rcx subq %r12, %rax addq %rbx, %rax testq %rcx, %rcx cmoveq %rcx, %rax jmp 0x1262c
/mmanyen[P]CLua/build_O1/_deps/lua/lobject.c
luaO_tostringbuff
unsigned luaO_tostringbuff (const TValue *obj, char *buff) { int len; lua_assert(ttisnumber(obj)); if (ttisinteger(obj)) len = lua_integer2str(buff, LUA_N2SBUFFSZ, ivalue(obj)); else len = tostringbuffFloat(fltvalue(obj), buff); lua_assert(len < LUA_N2SBUFFSZ); return cast_uint(len); }
pushq %rbp pushq %rbx pushq %rax movq %rsi, %rbx cmpb $0x3, 0x8(%rdi) jne 0x12759 movq (%rdi), %rcx leaq 0x17c5c(%rip), %rdx # 0x2a3a0 movl $0x40, %esi movq %rbx, %rdi xorl %eax, %eax addq $0x8, %rsp popq %rbx popq %rbp jmp 0x54b0 movsd (%rdi), %xmm0 movsd %xmm0, (%rsp) leaq 0x17c5c(%rip), %rdx # 0x2a3c5 movl $0x40, %esi movq %rbx, %rdi movb $0x1, %al callq 0x54b0 movl %eax, %ebp movq %rbx, %rdi xorl %esi, %esi callq 0x5250 movsd (%rsp), %xmm1 ucomisd %xmm1, %xmm0 jne 0x12791 jnp 0x127ad movapd %xmm1, %xmm0 leaq 0x17c2f(%rip), %rdx # 0x2a3cb movl $0x40, %esi movq %rbx, %rdi movb $0x1, %al callq 0x54b0 movl %eax, %ebp leaq 0x17c1d(%rip), %rsi # 0x2a3d1 movq %rbx, %rdi callq 0x5170 cmpb $0x0, (%rbx,%rax) jne 0x127da callq 0x5590 movq (%rax), %rax movb (%rax), %al movslq %ebp, %rcx movb %al, (%rbx,%rcx) leal 0x2(%rcx), %ebp movb $0x30, 0x1(%rbx,%rcx) movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/lobject.c
addstr2buff
static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { size_t left = buff->buffsize - buff->blen; /* space left in the buffer */ if (buff->err) /* do nothing else after an error */ return; if (slen > left) { /* new string doesn't fit into current buffer? */ if (slen > ((MAX_SIZE/2) - buff->blen)) { /* overflow? */ memcpy(buff->b + buff->blen, str, left); /* copy what it can */ buff->blen = buff->buffsize; buff->err = 2; /* doesn't add anything else */ return; } else { size_t newsize = buff->buffsize + slen; /* limited to MAX_SIZE/2 */ char *newb = (buff->b == buff->space) /* still using static space? */ ? luaM_reallocvector(buff->L, NULL, 0, newsize, char) : luaM_reallocvector(buff->L, buff->b, buff->buffsize, newsize, char); if (newb == NULL) { /* allocation error? */ buff->err = 1; /* signal a memory error */ return; } if (buff->b == buff->space) /* new buffer (not reallocated)? */ memcpy(newb, buff->b, buff->blen); /* copy previous content */ buff->b = newb; /* set new (larger) buffer... */ buff->buffsize = newsize; /* ...and its new size */ } } memcpy(buff->b + buff->blen, str, slen); /* copy new content */ buff->blen += slen; }
cmpl $0x0, 0x20(%rdi) je 0x12b60 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movq 0x10(%rdi), %rdx movq 0x18(%rdi), %rdi movq %rdx, %rax subq %rdi, %rax cmpq %r15, %rax jae 0x12c10 movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF subq %rdi, %rcx cmpq %r15, %rcx jae 0x12bbd addq 0x8(%rbx), %rdi movq %r14, %rsi movq %rax, %rdx callq 0x52a0 movq 0x10(%rbx), %rax movq %rax, 0x18(%rbx) movl $0x2, 0x20(%rbx) jmp 0x12c27 leaq (%rdx,%r15), %r12 movq (%rbx), %rdi movq 0x8(%rbx), %rsi leaq 0x24(%rbx), %rbp cmpq %rbp, %rsi jne 0x12bd5 xorl %esi, %esi xorl %edx, %edx movq %r12, %rcx callq 0x112d5 movq %rax, %r13 testq %rax, %rax je 0x12c04 movq 0x8(%rbx), %rsi cmpq %rbp, %rsi jne 0x12bfa movq 0x18(%rbx), %rdx movq %r13, %rdi callq 0x52a0 movq %r13, 0x8(%rbx) movq %r12, 0x10(%rbx) jmp 0x12c0b movl $0x1, 0x20(%rbx) testq %r13, %r13 je 0x12c27 movq 0x8(%rbx), %rdi addq 0x18(%rbx), %rdi movq %r14, %rsi movq %r15, %rdx callq 0x52a0 addq %r15, 0x18(%rbx) addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/mmanyen[P]CLua/build_O1/_deps/lua/lobject.c
luaO_chunkid
void luaO_chunkid (char *out, const char *source, size_t srclen) { size_t bufflen = LUA_IDSIZE; /* free space in buffer */ if (*source == '=') { /* 'literal' source */ if (srclen <= bufflen) /* small enough? */ memcpy(out, source + 1, srclen * sizeof(char)); else { /* truncate it */ addstr(out, source + 1, bufflen - 1); *out = '\0'; } } else if (*source == '@') { /* file name */ if (srclen <= bufflen) /* small enough? */ memcpy(out, source + 1, srclen * sizeof(char)); else { /* add '...' before rest of name */ addstr(out, RETS, LL(RETS)); bufflen -= LL(RETS); memcpy(out, source + 1 + srclen - bufflen, bufflen * sizeof(char)); } } else { /* string; format as [string "source"] */ const char *nl = strchr(source, '\n'); /* find first new line (if any) */ addstr(out, PRE, LL(PRE)); /* add prefix */ bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ if (srclen < bufflen && nl == NULL) { /* small one-line source? */ addstr(out, source, srclen); /* keep it */ } else { if (nl != NULL) srclen = ct_diff2sz(nl - source); /* stop at first newline */ if (srclen > bufflen) srclen = bufflen; addstr(out, source, srclen); addstr(out, RETS, LL(RETS)); } memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); } }
pushq %r15 pushq %r14 pushq %rbx movq %rdx, %r15 movq %rsi, %r14 movq %rdi, %rbx movzbl (%rsi), %eax cmpl $0x40, %eax je 0x12d23 cmpl $0x3d, %eax jne 0x12d3f incq %r14 cmpq $0x3c, %r15 jbe 0x12d2c movups (%r14), %xmm0 movups 0x10(%r14), %xmm1 movups 0x20(%r14), %xmm2 movups 0x2b(%r14), %xmm3 movups %xmm3, 0x2b(%rbx) movups %xmm2, 0x20(%rbx) movups %xmm1, 0x10(%rbx) movups %xmm0, (%rbx) movb $0x0, 0x3b(%rbx) jmp 0x12dfe cmpq $0x3c, %r15 ja 0x12d88 incq %r14 movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx popq %rbx popq %r14 popq %r15 jmp 0x52a0 movq %r14, %rdi movl $0xa, %esi callq 0x5140 movabsq $0x20676e697274735b, %rcx # imm = 0x20676E697274735B movq %rcx, (%rbx) movb $0x22, 0x8(%rbx) addq $0x9, %rbx cmpq $0x2d, %r15 setb %cl testq %rax, %rax sete %dl andb %cl, %dl cmpb $0x1, %dl jne 0x12dbb movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx callq 0x52a0 addq %r15, %rbx jmp 0x12df5 movb $0x2e, 0x2(%rbx) movw $0x2e2e, (%rbx) # imm = 0x2E2E movups -0x38(%r14,%r15), %xmm0 movups -0x28(%r14,%r15), %xmm1 movups -0x18(%r14,%r15), %xmm2 movups -0xf(%r14,%r15), %xmm3 movups %xmm0, 0x3(%rbx) movups %xmm1, 0x13(%rbx) movups %xmm2, 0x23(%rbx) movups %xmm3, 0x2c(%rbx) jmp 0x12dfe movq %rax, %rcx subq %r14, %rcx testq %rax, %rax cmoveq %r15, %rcx cmpq $0x2d, %rcx movl $0x2d, %r15d cmovbq %rcx, %r15 movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx callq 0x52a0 addq %r15, %rbx addq $0x3, %rbx movw $0x2e2e, -0x3(%rbx) # imm = 0x2E2E movb $0x2e, -0x1(%rbx) movb $0x0, 0x2(%rbx) movw $0x5d22, (%rbx) # imm = 0x5D22 popq %rbx popq %r14 popq %r15 retq
/mmanyen[P]CLua/build_O1/_deps/lua/lobject.c