'lineinfo' in prototypes saved as differences instead of absolute

values, so that the array can use bytes instead of ints, reducing
its size. (A new array 'abslineinfo' is used when line differences
do not fit in a byte.)
This commit is contained in:
Roberto Ierusalimschy
2017-06-27 08:35:31 -03:00
parent 60a7492d24
commit b42430fd3a
11 changed files with 195 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ldebug.h,v 2.13 2015/03/11 16:10:41 roberto Exp roberto $
** $Id: ldebug.h,v 2.14 2015/05/22 17:45:56 roberto Exp roberto $
** Auxiliary functions from Debug Interface module
** See Copyright Notice in lua.h
*/
@@ -13,11 +13,15 @@
#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1)
#define getfuncline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : -1)
#define resethookcount(L) (L->hookcount = L->basehookcount)
/*
** mark for entries in 'lineinfo' array that has absolute information in
** 'abslineinfo' array
*/
#define ABSLINEINFO (-0x80)
LUAI_FUNC int luaG_getfuncline (Proto *f, int pc);
LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
const char *opname);
LUAI_FUNC l_noret luaG_concaterror (lua_State *L, const TValue *p1,