[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT roadmap 2008 question
- From: Mike Pall <mikelu-0910@...>
- Date: Fri, 30 Oct 2009 08:45:15 +0100
tankxx wrote:
> The calling convention is so well designed that using the function
> slot inplace. May you post the code snippets about frame handling that
> corresponding ldo.c?
> I want to dig into the details about all kinds of frame links. :)
Well, it's heavily-macroized assembler ... but here you go:
|->gate_lf: // Call gate for fixarg Lua functions.
| // RA = new base, RB = LFUNC, RC = nargs+1, (BASE = old base), PC = return
| // DISPATCH initialized
| mov BASE, RA
| mov PROTO:RB, LFUNC:RB->pt
| mov [BASE-4], PC // Store caller PC. <=== !!
| movzx RA, byte PROTO:RB->framesize
| mov PC, PROTO:RB->bc
| mov KBASE, PROTO:RB->k
| mov L:RB, SAVE_L
| lea RA, [BASE+RA*8] // Top of frame.
| lea RC, [BASE+NARGS:RC*8-4] // Points to tag of 1st free slot.
| cmp RA, L:RB->maxstack
| ja ->gate_lf_growstack
| mov RB, LJ_TNIL
|1: // Clear free slots until top of frame.
| mov [RC], RB
| mov [RC+8], RB
| add RC, 16
| cmp RC, RA
| jb <1
| ins_next
--Mike
- References:
- LuaJIT roadmap 2008 question, tankxx
- Re: LuaJIT roadmap 2008 question, tankxx
- Re: LuaJIT roadmap 2008 question, Alex Davies
- Re: LuaJIT roadmap 2008 question, Alex Davies
- Re: LuaJIT roadmap 2008 question, Mike Pall
- Re: LuaJIT roadmap 2008 question, tankxx
- Re: LuaJIT roadmap 2008 question, Mike Pall
- Re: LuaJIT roadmap 2008 question, CHU Run-min
- Re: LuaJIT roadmap 2008 question, Mike Pall
- Re: LuaJIT roadmap 2008 question, tankxx