summaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-10 15:37:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-10 15:37:44 -0300
commit73aa465a8ed8dee6c6a27a6f8b2f51227b70789d (patch)
tree496a63ffffe0312f1d0b9882d97944fa38ed7801 /lopcodes.h
parent3d0577f4b98908be3f2d697ab75c5fbbd3f6999b (diff)
downloadlua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.tar.gz
lua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.tar.bz2
lua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.zip
some name changes
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h98
1 files changed, 49 insertions, 49 deletions
diff --git a/lopcodes.h b/lopcodes.h
index cd19ff3d..a155956d 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.44 2000/03/03 18:53:17 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.47 2000/03/09 13:57:37 roberto Exp roberto $
3** Opcodes for Lua virtual machine 3** Opcodes for Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -20,7 +20,7 @@
20 type 3: 1st unsigned argument in the higher 16 bits (`A') 20 type 3: 1st unsigned argument in the higher 16 bits (`A')
21 2nd unsigned argument in the middle 8 bits (`B') 21 2nd unsigned argument in the middle 8 bits (`B')
22 22
23 The signed argument is represented in excess 2^23; that is, the real value 23 The signed argument is represented in excess 2^23; that is, the Number value
24 is the usigned value minus 2^23. 24 is the usigned value minus 2^23.
25===========================================================================*/ 25===========================================================================*/
26 26
@@ -88,73 +88,73 @@ typedef enum {
88/*---------------------------------------------------------------------- 88/*----------------------------------------------------------------------
89name args stack before stack after side effects 89name args stack before stack after side effects
90------------------------------------------------------------------------*/ 90------------------------------------------------------------------------*/
91ENDCODE,/* - - (return) */ 91OP_END,/* - - (return) */
92RETCODE,/* U - (return) */ 92OP_RETURN,/* U - (return) */
93 93
94CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */ 94OP_CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */
95TAILCALL,/* A B v_a-v_1 f (return) f(v1,...,v_a) */ 95OP_TAILCALL,/* A B v_a-v_1 f (return) f(v1,...,v_a) */
96 96
97PUSHNIL,/* U - nil_1-nil_u */ 97OP_PUSHNIL,/* U - nil_1-nil_u */
98POP,/* U a_u-a_1 - */ 98OP_POP,/* U a_u-a_1 - */
99 99
100PUSHINT,/* S - (real)s */ 100OP_PUSHINT,/* S - (Number)s */
101PUSHSTRING,/* K - KSTR[k] */ 101OP_PUSHSTRING,/* K - KSTR[k] */
102PUSHNUM,/* N - KNUM[u] */ 102OP_PUSHNUM,/* N - KNUM[u] */
103PUSHNEGNUM,/* N - -KNUM[u] */ 103OP_PUSHNEGNUM,/* N - -KNUM[u] */
104 104
105PUSHUPVALUE,/* U - Closure[u] */ 105OP_PUSHUPVALUE,/* U - Closure[u] */
106 106
107PUSHLOCAL,/* L - LOC[u] */ 107OP_PUSHLOCAL,/* L - LOC[u] */
108GETGLOBAL,/* K - VAR[KSTR[k]] */ 108OP_GETGLOBAL,/* K - VAR[KSTR[k]] */
109 109
110GETTABLE,/* - i t t[i] */ 110OP_GETTABLE,/* - i t t[i] */
111GETDOTTED,/* K t t[KSTR[k]] */ 111OP_GETDOTTED,/* K t t[KSTR[k]] */
112PUSHSELF,/* K t t t[KSTR[k]] */ 112OP_PUSHSELF,/* K t t t[KSTR[k]] */
113 113
114CREATETABLE,/* U - newarray(size = u) */ 114OP_CREATETABLE,/* U - newarray(size = u) */
115 115
116SETLOCAL,/* L x - LOC[u]=x */ 116OP_SETLOCAL,/* L x - LOC[u]=x */
117SETGLOBAL,/* K x - VAR[KSTR[k]]=x */ 117OP_SETGLOBAL,/* K x - VAR[KSTR[k]]=x */
118SETTABLEPOP,/* - v i t - t[i]=v */ 118OP_SETTABLEPOP,/* - v i t - t[i]=v */
119SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */ 119OP_SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */
120 120
121SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ 121OP_SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */
122SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ 122OP_SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */
123 123
124ADDOP,/* - y x x+y */ 124OP_ADD,/* - y x x+y */
125ADDI,/* S x x+s */ 125OP_ADDI,/* S x x+s */
126SUBOP,/* - y x x-y */ 126OP_SUB,/* - y x x-y */
127MULTOP,/* - y x x*y */ 127OP_MULT,/* - y x x*y */
128DIVOP,/* - y x x/y */ 128OP_DIV,/* - y x x/y */
129POWOP,/* - y x x^y */ 129OP_POW,/* - y x x^y */
130CONCOP,/* U v_u-v_1 v1..-..v_u */ 130OP_CONC,/* U v_u-v_1 v1..-..v_u */
131MINUSOP,/* - x -x */ 131OP_MINUS,/* - x -x */
132NOTOP,/* - x (x==nil)? 1 : nil */ 132OP_NOT,/* - x (x==nil)? 1 : nil */
133 133
134IFNEQJMP,/* J y x - (x~=y)? PC+=s */ 134OP_IFNEQJMP,/* J y x - (x~=y)? PC+=s */
135IFEQJMP,/* J y x - (x==y)? PC+=s */ 135OP_IFEQJMP,/* J y x - (x==y)? PC+=s */
136IFLTJMP,/* J y x - (x<y)? PC+=s */ 136OP_IFLTJMP,/* J y x - (x<y)? PC+=s */
137IFLEJMP,/* J y x - (x<y)? PC+=s */ 137OP_IFLEJMP,/* J y x - (x<y)? PC+=s */
138IFGTJMP,/* J y x - (x>y)? PC+=s */ 138OP_IFGTJMP,/* J y x - (x>y)? PC+=s */
139IFGEJMP,/* J y x - (x>=y)? PC+=s */ 139OP_IFGEJMP,/* J y x - (x>=y)? PC+=s */
140 140
141IFTJMP,/* J x - (x!=nil)? PC+=s */ 141OP_IFTJMP,/* J x - (x!=nil)? PC+=s */
142IFFJMP,/* J x - (x==nil)? PC+=s */ 142OP_IFFJMP,/* J x - (x==nil)? PC+=s */
143ONTJMP,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */ 143OP_ONTJMP,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */
144ONFJMP,/* J x (x==nil)? x : - (x==nil)? PC+=s */ 144OP_ONFJMP,/* J x (x==nil)? x : - (x==nil)? PC+=s */
145JMP,/* J - - PC+=s */ 145OP_JMP,/* J - - PC+=s */
146 146
147PUSHNILJMP,/* - - nil PC++; */ 147OP_PUSHNILJMP,/* - - nil PC++; */
148 148
149CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_1-v_b) */ 149OP_CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_1-v_b) */
150 150
151SETLINE/* U - - LINE=u */ 151OP_SETLINE/* U - - LINE=u */
152 152
153} OpCode; 153} OpCode;
154 154
155 155
156 156
157#define ISJUMP(o) (IFNEQJMP <= (o) && (o) <= JMP) 157#define ISJUMP(o) (OP_IFNEQJMP <= (o) && (o) <= OP_JMP)
158 158
159 159
160#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */ 160#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */