From 762d059a13d83eb367238a6115bbb4f5f13fcb49 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 5 Jun 2001 15:17:01 -0300 Subject: new implementation for the Virtual Machine --- ldebug.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'ldebug.h') diff --git a/ldebug.h b/ldebug.h index 9bdc7c03..7dd7ed23 100644 --- a/ldebug.h +++ b/ldebug.h @@ -1,5 +1,5 @@ /* -** $Id: ldebug.h,v 1.10 2001/02/12 19:54:50 roberto Exp roberto $ +** $Id: ldebug.h,v 1.11 2001/02/23 17:17:25 roberto Exp roberto $ ** Auxiliary functions from Debug Interface module ** See Copyright Notice in lua.h */ @@ -12,11 +12,32 @@ #include "luadebug.h" +enum OpMode {iABC, iABc, iAsBc}; /* basic instruction format */ + +/* +** masks for instruction properties +*/ +enum OpModeMask { + OpModeAreg = 2, /* A is a register */ + OpModeBreg, /* B is a register */ + OpModeCreg, /* C is a register/constant */ + OpModesetA, /* instruction set register A */ + OpModeK, /* Bc is a constant */ + OpModeT /* operator is a test */ +}; + +extern const unsigned char luaG_opmodes[]; + +#define getOpMode(m) ((enum OpMode)(luaG_opmodes[m] & 3)) +#define testOpMode(m, b) (luaG_opmodes[m] & (1 << (b))) + + void luaG_typeerror (lua_State *L, StkId o, const l_char *op); -void luaG_binerror (lua_State *L, StkId p1, int t, const l_char *op); +void luaG_concaterror (lua_State *L, StkId p1, StkId p2); +void luaG_aritherror (lua_State *L, StkId p1, TObject *p2); int luaG_getline (int *lineinfo, int pc, int refline, int *refi); void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2); -int luaG_checkcode (lua_State *L, const Proto *pt); +int luaG_checkcode (const Proto *pt); #endif -- cgit v1.2.3-55-g6feb