[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT roadmap 2008 question
- From: CHU Run-min <churunmin@...>
- Date: Sun, 1 Nov 2009 18:23:42 +0800
in lj_gc.c
/* Traverse the frame structure of a stack. */
static TValue *gc_traverse_frames(global_State *g, lua_State *th)
{
TValue *frame, *top = th->top-1;
/* Note: extra vararg frame not skipped, marks function twice (harmless). */
for (frame = th->base-1; frame > th->stack; frame = frame_prev(frame)) {
GCfunc *fn = frame_func(frame);
TValue *ftop = frame;
if (isluafunc(fn)) ftop += funcproto(fn)->framesize;
if (ftop > top) top = ftop;
gc_markobj(g, frame_gc(frame)); /* Need to mark hidden function (or L). */
}
top++; /* Correct bias of -1 (frame == base-1). */
if (top > th->maxstack) top = th->maxstack;
return top;
}
I found it doesn't consider C func's frame size. In standard Lua
implementation, the func's frame size is recorded in CallInfo' top
field. But in LJ2, there is no space to record the frame size of C
func.
It seems harmful, isn't it? Or my misunderstanding. May Mike Pall
reveal the mystery about this?