From e04f7ed4509af1577c10ead8e5d7d55c65754bf8 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 18 Dec 2001 18:52:30 -0200 Subject: first version of Lua "stackless" --- lstate.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 158f7f8a..150bc4db 100644 --- a/lstate.h +++ b/lstate.h @@ -69,6 +69,24 @@ typedef struct stringtable { } stringtable; +/* +** informations about a call +*/ +typedef struct CallInfo { + StkId base; /* base for called function */ + const Instruction *savedpc; + lua_Hook linehook; + /* extra information for debugging */ + const Instruction **pc; + int lastpc; /* last pc traced */ + int line; /* current line */ + int refi; /* current index in `lineinfo' */ +} CallInfo; + +#define ci_func(ci) (clvalue((ci)->base - 1)) + + + /* ** `global state', shared by all threads of this state */ @@ -98,6 +116,9 @@ struct lua_State { StkId stack_last; /* last free slot in the stack */ StkId stack; /* stack base */ int stacksize; + CallInfo *end_ci; /* points after end of ci array*/ + CallInfo *base_ci; /* array of CallInfo's */ + int size_ci; /* size of array `base_ci' */ global_State *_G; lua_Hook callhook; lua_Hook linehook; @@ -106,7 +127,6 @@ struct lua_State { UpVal *openupval; /* list of open upvalues in this stack */ lua_State *next; /* circular double linked list of states */ lua_State *previous; - CallInfo basefunc; }; -- cgit v1.2.3-55-g6feb