comments etc

pull/168/head
Dibyendu Majumdar 5 years ago
parent 01eb83dcfe
commit 631e237ef9

@ -38,7 +38,8 @@ typedef enum BinOpr {
/** RAVI change */
typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_TO_INTEGER,
OPR_TO_NUMBER, OPR_TO_INTARRAY, OPR_TO_NUMARRAY, OPR_TO_TABLE, OPR_TO_STRING, OPR_TO_CLOSURE, OPR_TO_TYPE, OPR_NOUNOPR } UnOpr;
OPR_TO_NUMBER, OPR_TO_INTARRAY, OPR_TO_NUMARRAY, OPR_TO_TABLE, OPR_TO_STRING,
OPR_TO_CLOSURE, OPR_TO_TYPE, OPR_NOUNOPR } UnOpr;
/* get (pointer to) instruction of given 'expdesc' */
#define getinstruction(fs,e) ((fs)->f->code[(e)->u.info])

@ -41,6 +41,7 @@
** 0 - Lua function
** 1 - light C function
** 2 - regular C function (closure)
** 4 - fast light C dunction (Ravi extension)
*/
/* Variant tags for functions */
@ -145,6 +146,7 @@ typedef struct lua_TValue {
#define novariant(x) ((x) & 0x0F)
/* type tag of a TValue (bits 0-3 for tags + variant bits 4-6) */
/* 7F is 0111 1111 */
#define ttype(o) (rttype(o) & 0x7F)
/* type tag of a TValue with no variants (bits 0-3) */
@ -239,6 +241,9 @@ typedef struct lua_TValue {
#define setfvalue(obj,x) \
{ TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); }
/* The Fast C function call type is encoded as two
bytes. The Hi Byte holds a function tag. The Lo Byte
holds the Lua typecode */
#define setfvalue_fastcall(obj, x, tag) \
{ \
TValue *io = (obj); \
@ -637,7 +642,9 @@ typedef struct Table {
*/
#define luaO_nilobject (&luaO_nilobject_)
/* Internal assembler functions. Never call these directly from C. */
/* Internal assembler functions. Never call these directly from C.
Note that such functions do not follow calling conventions and
are only used by ASM VM to implement bytecodes */
typedef void(*ASMFunction)(void);

@ -26,6 +26,24 @@
** 'tobefnz': all objects ready to be finalized;
** 'fixedgc': all objects that are not to be collected (currently
** only small strings, such as reserved words).
**
** Moreover, there is another set of lists that control gray objects.
** These lists are linked by fields 'gclist'. (All objects that
** can become gray have such a field. The field is not the same
** in all objects, but it always has this name.) Any gray object
** must belong to one of these lists, and all objects in these lists
** must be gray:
**
** 'gray': regular gray objects, still waiting to be visited.
** 'grayagain': objects that must be revisited at the atomic phase.
** That includes
** - black objects got in a write barrier;
** - all kinds of weak tables during propagation phase;
** - all threads.
** 'weak': tables with weak values to be cleared;
** 'ephemeron': ephemeron tables with white->white entries;
** 'allweak': tables with weak keys and/or weak values to be cleared.
** The last three lists are used only during the atomic phase.
*/
@ -160,7 +178,7 @@ typedef struct global_State {
TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */
/* RAVI additions */
ravi_State *ravi_state;
ASMFunction dispatch[NUM_OPCODES];
ASMFunction dispatch[NUM_OPCODES]; /* Dispatch table for ASM VM - wip */
ravi_Writeline ravi_writeline;
ravi_Writestring ravi_writestring;
ravi_Writestringerror ravi_writestringerror;
@ -172,6 +190,7 @@ typedef struct global_State {
#endif
} global_State;
/* Offset of the ASM VM dispatch table */
#define DISPATCH_OFFSET ((int)offsetof(global_State, dispatch))
/*

@ -549,6 +549,8 @@ struct lua_Debug {
LUA_API void (ravi_pushcfastcall)(lua_State *L, void *ptr, int tag);
/* Allowed tags - subject to change. Max value is 128. Note that
each tag requires special handling in ldo.c */
#define RAVI_TFCF_EXP 1
#define RAVI_TFCF_LOG 2
#define RAVI_TFCF_D_D 3

Loading…
Cancel
Save