no more linehook field in CallInfo
This commit is contained in:
4
ldo.c
4
ldo.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
|
** $Id: ldo.c,v 1.154 2002/01/11 20:27:41 roberto Exp $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -148,12 +148,12 @@ StkId luaD_precall (lua_State *L, StkId func) {
|
|||||||
if (!cl->isC) { /* Lua function? prepare its call */
|
if (!cl->isC) { /* Lua function? prepare its call */
|
||||||
StkId base = func+1;
|
StkId base = func+1;
|
||||||
Proto *p = cl->p;
|
Proto *p = cl->p;
|
||||||
ci->linehook = L->linehook;
|
|
||||||
ci->savedpc = p->code; /* starting point */
|
ci->savedpc = p->code; /* starting point */
|
||||||
if (p->is_vararg) /* varargs? */
|
if (p->is_vararg) /* varargs? */
|
||||||
adjust_varargs(L, base, p->numparams);
|
adjust_varargs(L, base, p->numparams);
|
||||||
if (base > L->stack_last - p->maxstacksize)
|
if (base > L->stack_last - p->maxstacksize)
|
||||||
luaD_stackerror(L);
|
luaD_stackerror(L);
|
||||||
|
ci->line = 0;
|
||||||
ci->top = base + p->maxstacksize;
|
ci->top = base + p->maxstacksize;
|
||||||
while (L->top < ci->top)
|
while (L->top < ci->top)
|
||||||
setnilvalue(L->top++);
|
setnilvalue(L->top++);
|
||||||
|
|||||||
1
lstate.h
1
lstate.h
@@ -82,7 +82,6 @@ typedef struct stringtable {
|
|||||||
typedef struct CallInfo {
|
typedef struct CallInfo {
|
||||||
StkId base; /* base for called function */
|
StkId base; /* base for called function */
|
||||||
const Instruction *savedpc;
|
const Instruction *savedpc;
|
||||||
lua_Hook linehook;
|
|
||||||
StkId top; /* top for this function (when it's a Lua function) */
|
StkId top; /* top for this function (when it's a Lua function) */
|
||||||
const Instruction **pc;
|
const Instruction **pc;
|
||||||
/* extra information for line tracing */
|
/* extra information for line tracing */
|
||||||
|
|||||||
18
lvm.c
18
lvm.c
@@ -66,10 +66,17 @@ static void traceexec (lua_State *L, lua_Hook linehook) {
|
|||||||
int *lineinfo = ci_func(ci)->l.p->lineinfo;
|
int *lineinfo = ci_func(ci)->l.p->lineinfo;
|
||||||
int pc = cast(int, *ci->pc - ci_func(ci)->l.p->code) - 1;
|
int pc = cast(int, *ci->pc - ci_func(ci)->l.p->code) - 1;
|
||||||
int newline;
|
int newline;
|
||||||
if (pc == 0) { /* may be first time? */
|
if (ci->line == -1) return; /* no linehooks for this function */
|
||||||
ci->line = 1;
|
else if (ci->line == 0) { /* first linehook? */
|
||||||
ci->refi = 0;
|
if (pc == 0) { /* function is starting now? */
|
||||||
ci->lastpc = pc+1; /* make sure it will call linehook */
|
ci->line = 1;
|
||||||
|
ci->refi = 0;
|
||||||
|
ci->lastpc = pc+1; /* make sure it will call linehook */
|
||||||
|
}
|
||||||
|
else { /* function started without hooks: */
|
||||||
|
ci->line = -1; /* keep it that way */
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi);
|
newline = luaG_getline(lineinfo, pc, ci->line, &ci->refi);
|
||||||
/* calls linehook when enters a new line or jumps back (loop) */
|
/* calls linehook when enters a new line or jumps back (loop) */
|
||||||
@@ -315,7 +322,7 @@ StkId luaV_execute (lua_State *L) {
|
|||||||
base = L->ci->base;
|
base = L->ci->base;
|
||||||
cl = &clvalue(base - 1)->l;
|
cl = &clvalue(base - 1)->l;
|
||||||
k = cl->p->k;
|
k = cl->p->k;
|
||||||
linehook = L->ci->linehook;
|
linehook = L->linehook;
|
||||||
L->ci->pc = &pc;
|
L->ci->pc = &pc;
|
||||||
pc = L->ci->savedpc;
|
pc = L->ci->savedpc;
|
||||||
L->ci->savedpc = NULL;
|
L->ci->savedpc = NULL;
|
||||||
@@ -513,7 +520,6 @@ StkId luaV_execute (lua_State *L) {
|
|||||||
int nresults;
|
int nresults;
|
||||||
lua_assert(ttype(ci->base-1) == LUA_TFUNCTION);
|
lua_assert(ttype(ci->base-1) == LUA_TFUNCTION);
|
||||||
base = ci->base; /* restore previous values */
|
base = ci->base; /* restore previous values */
|
||||||
linehook = ci->linehook;
|
|
||||||
cl = &clvalue(base - 1)->l;
|
cl = &clvalue(base - 1)->l;
|
||||||
k = cl->p->k;
|
k = cl->p->k;
|
||||||
pc = ci->savedpc;
|
pc = ci->savedpc;
|
||||||
|
|||||||
Reference in New Issue
Block a user