From 59bcd137ae09456d9315b5c9b0cce520230423a7 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 27 Jul 2011 15:09:01 -0300 Subject: reducing even more use of C stack by the parser: struct 'FuncState' does not need field 'L' + number of labels/gotos in a chunk may be limited to SHRT_MAX. (Also removed some non-needed 'unsigned's.) --- lparser.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lparser.h') diff --git a/lparser.h b/lparser.h index de37e125..24abb050 100644 --- a/lparser.h +++ b/lparser.h @@ -1,5 +1,5 @@ /* -** $Id: lparser.h,v 1.67 2011/02/07 17:14:50 roberto Exp roberto $ +** $Id: lparser.h,v 1.68 2011/02/23 13:13:10 roberto Exp roberto $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -55,7 +55,7 @@ typedef struct expdesc { /* description of active local variable */ typedef struct Vardesc { - unsigned short idx; /* variable index in stack */ + short idx; /* variable index in stack */ } Vardesc; @@ -98,18 +98,17 @@ typedef struct FuncState { Table *h; /* table to find (and reuse) elements in `k' */ struct FuncState *prev; /* enclosing function */ struct LexState *ls; /* lexical state */ - struct lua_State *L; /* copy of the Lua state */ struct BlockCnt *bl; /* chain of current blocks */ int pc; /* next position to code (equivalent to `ncode') */ - int lasttarget; /* `pc' of last `jump target' */ + int lasttarget; /* 'label' of last 'jump label' */ int jpc; /* list of pending jumps to `pc' */ - int freereg; /* first free register */ int nk; /* number of elements in `k' */ int np; /* number of elements in `p' */ - int firstlocal; /* index of first local var of this function */ - short nlocvars; /* number of elements in `locvars' */ + int firstlocal; /* index of first local var (in Dyndata array) */ + short nlocvars; /* number of elements in 'f->locvars' */ lu_byte nactvar; /* number of active local variables */ lu_byte nups; /* number of upvalues */ + lu_byte freereg; /* first free register */ } FuncState; -- cgit v1.2.3-55-g6feb