diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-05 15:17:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-05 15:17:01 -0300 |
commit | 762d059a13d83eb367238a6115bbb4f5f13fcb49 (patch) | |
tree | f35fdf0675b791865d0d4800522b172903b34803 /ldebug.h | |
parent | 572a69b6afbd368beab8844bc876b0f9690b5253 (diff) | |
download | lua-762d059a13d83eb367238a6115bbb4f5f13fcb49.tar.gz lua-762d059a13d83eb367238a6115bbb4f5f13fcb49.tar.bz2 lua-762d059a13d83eb367238a6115bbb4f5f13fcb49.zip |
new implementation for the Virtual Machine
Diffstat (limited to 'ldebug.h')
-rw-r--r-- | ldebug.h | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.h,v 1.10 2001/02/12 19:54:50 roberto Exp roberto $ | 2 | ** $Id: ldebug.h,v 1.11 2001/02/23 17:17:25 roberto Exp roberto $ |
3 | ** Auxiliary functions from Debug Interface module | 3 | ** Auxiliary functions from Debug Interface module |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -12,11 +12,32 @@ | |||
12 | #include "luadebug.h" | 12 | #include "luadebug.h" |
13 | 13 | ||
14 | 14 | ||
15 | enum OpMode {iABC, iABc, iAsBc}; /* basic instruction format */ | ||
16 | |||
17 | /* | ||
18 | ** masks for instruction properties | ||
19 | */ | ||
20 | enum OpModeMask { | ||
21 | OpModeAreg = 2, /* A is a register */ | ||
22 | OpModeBreg, /* B is a register */ | ||
23 | OpModeCreg, /* C is a register/constant */ | ||
24 | OpModesetA, /* instruction set register A */ | ||
25 | OpModeK, /* Bc is a constant */ | ||
26 | OpModeT /* operator is a test */ | ||
27 | }; | ||
28 | |||
29 | extern const unsigned char luaG_opmodes[]; | ||
30 | |||
31 | #define getOpMode(m) ((enum OpMode)(luaG_opmodes[m] & 3)) | ||
32 | #define testOpMode(m, b) (luaG_opmodes[m] & (1 << (b))) | ||
33 | |||
34 | |||
15 | void luaG_typeerror (lua_State *L, StkId o, const l_char *op); | 35 | void luaG_typeerror (lua_State *L, StkId o, const l_char *op); |
16 | void luaG_binerror (lua_State *L, StkId p1, int t, const l_char *op); | 36 | void luaG_concaterror (lua_State *L, StkId p1, StkId p2); |
37 | void luaG_aritherror (lua_State *L, StkId p1, TObject *p2); | ||
17 | int luaG_getline (int *lineinfo, int pc, int refline, int *refi); | 38 | int luaG_getline (int *lineinfo, int pc, int refline, int *refi); |
18 | void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2); | 39 | void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2); |
19 | int luaG_checkcode (lua_State *L, const Proto *pt); | 40 | int luaG_checkcode (const Proto *pt); |
20 | 41 | ||
21 | 42 | ||
22 | #endif | 43 | #endif |