diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-10 15:37:44 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-10 15:37:44 -0300 |
commit | 73aa465a8ed8dee6c6a27a6f8b2f51227b70789d (patch) | |
tree | 496a63ffffe0312f1d0b9882d97944fa38ed7801 /lopcodes.h | |
parent | 3d0577f4b98908be3f2d697ab75c5fbbd3f6999b (diff) | |
download | lua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.tar.gz lua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.tar.bz2 lua-73aa465a8ed8dee6c6a27a6f8b2f51227b70789d.zip |
some name changes
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 98 |
1 files changed, 49 insertions, 49 deletions
@@ -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 | /*---------------------------------------------------------------------- |
89 | name args stack before stack after side effects | 89 | name args stack before stack after side effects |
90 | ------------------------------------------------------------------------*/ | 90 | ------------------------------------------------------------------------*/ |
91 | ENDCODE,/* - - (return) */ | 91 | OP_END,/* - - (return) */ |
92 | RETCODE,/* U - (return) */ | 92 | OP_RETURN,/* U - (return) */ |
93 | 93 | ||
94 | CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */ | 94 | OP_CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */ |
95 | TAILCALL,/* A B v_a-v_1 f (return) f(v1,...,v_a) */ | 95 | OP_TAILCALL,/* A B v_a-v_1 f (return) f(v1,...,v_a) */ |
96 | 96 | ||
97 | PUSHNIL,/* U - nil_1-nil_u */ | 97 | OP_PUSHNIL,/* U - nil_1-nil_u */ |
98 | POP,/* U a_u-a_1 - */ | 98 | OP_POP,/* U a_u-a_1 - */ |
99 | 99 | ||
100 | PUSHINT,/* S - (real)s */ | 100 | OP_PUSHINT,/* S - (Number)s */ |
101 | PUSHSTRING,/* K - KSTR[k] */ | 101 | OP_PUSHSTRING,/* K - KSTR[k] */ |
102 | PUSHNUM,/* N - KNUM[u] */ | 102 | OP_PUSHNUM,/* N - KNUM[u] */ |
103 | PUSHNEGNUM,/* N - -KNUM[u] */ | 103 | OP_PUSHNEGNUM,/* N - -KNUM[u] */ |
104 | 104 | ||
105 | PUSHUPVALUE,/* U - Closure[u] */ | 105 | OP_PUSHUPVALUE,/* U - Closure[u] */ |
106 | 106 | ||
107 | PUSHLOCAL,/* L - LOC[u] */ | 107 | OP_PUSHLOCAL,/* L - LOC[u] */ |
108 | GETGLOBAL,/* K - VAR[KSTR[k]] */ | 108 | OP_GETGLOBAL,/* K - VAR[KSTR[k]] */ |
109 | 109 | ||
110 | GETTABLE,/* - i t t[i] */ | 110 | OP_GETTABLE,/* - i t t[i] */ |
111 | GETDOTTED,/* K t t[KSTR[k]] */ | 111 | OP_GETDOTTED,/* K t t[KSTR[k]] */ |
112 | PUSHSELF,/* K t t t[KSTR[k]] */ | 112 | OP_PUSHSELF,/* K t t t[KSTR[k]] */ |
113 | 113 | ||
114 | CREATETABLE,/* U - newarray(size = u) */ | 114 | OP_CREATETABLE,/* U - newarray(size = u) */ |
115 | 115 | ||
116 | SETLOCAL,/* L x - LOC[u]=x */ | 116 | OP_SETLOCAL,/* L x - LOC[u]=x */ |
117 | SETGLOBAL,/* K x - VAR[KSTR[k]]=x */ | 117 | OP_SETGLOBAL,/* K x - VAR[KSTR[k]]=x */ |
118 | SETTABLEPOP,/* - v i t - t[i]=v */ | 118 | OP_SETTABLEPOP,/* - v i t - t[i]=v */ |
119 | SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */ | 119 | OP_SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */ |
120 | 120 | ||
121 | SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ | 121 | OP_SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ |
122 | SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ | 122 | OP_SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ |
123 | 123 | ||
124 | ADDOP,/* - y x x+y */ | 124 | OP_ADD,/* - y x x+y */ |
125 | ADDI,/* S x x+s */ | 125 | OP_ADDI,/* S x x+s */ |
126 | SUBOP,/* - y x x-y */ | 126 | OP_SUB,/* - y x x-y */ |
127 | MULTOP,/* - y x x*y */ | 127 | OP_MULT,/* - y x x*y */ |
128 | DIVOP,/* - y x x/y */ | 128 | OP_DIV,/* - y x x/y */ |
129 | POWOP,/* - y x x^y */ | 129 | OP_POW,/* - y x x^y */ |
130 | CONCOP,/* U v_u-v_1 v1..-..v_u */ | 130 | OP_CONC,/* U v_u-v_1 v1..-..v_u */ |
131 | MINUSOP,/* - x -x */ | 131 | OP_MINUS,/* - x -x */ |
132 | NOTOP,/* - x (x==nil)? 1 : nil */ | 132 | OP_NOT,/* - x (x==nil)? 1 : nil */ |
133 | 133 | ||
134 | IFNEQJMP,/* J y x - (x~=y)? PC+=s */ | 134 | OP_IFNEQJMP,/* J y x - (x~=y)? PC+=s */ |
135 | IFEQJMP,/* J y x - (x==y)? PC+=s */ | 135 | OP_IFEQJMP,/* J y x - (x==y)? PC+=s */ |
136 | IFLTJMP,/* J y x - (x<y)? PC+=s */ | 136 | OP_IFLTJMP,/* J y x - (x<y)? PC+=s */ |
137 | IFLEJMP,/* J y x - (x<y)? PC+=s */ | 137 | OP_IFLEJMP,/* J y x - (x<y)? PC+=s */ |
138 | IFGTJMP,/* J y x - (x>y)? PC+=s */ | 138 | OP_IFGTJMP,/* J y x - (x>y)? PC+=s */ |
139 | IFGEJMP,/* J y x - (x>=y)? PC+=s */ | 139 | OP_IFGEJMP,/* J y x - (x>=y)? PC+=s */ |
140 | 140 | ||
141 | IFTJMP,/* J x - (x!=nil)? PC+=s */ | 141 | OP_IFTJMP,/* J x - (x!=nil)? PC+=s */ |
142 | IFFJMP,/* J x - (x==nil)? PC+=s */ | 142 | OP_IFFJMP,/* J x - (x==nil)? PC+=s */ |
143 | ONTJMP,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */ | 143 | OP_ONTJMP,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */ |
144 | ONFJMP,/* J x (x==nil)? x : - (x==nil)? PC+=s */ | 144 | OP_ONFJMP,/* J x (x==nil)? x : - (x==nil)? PC+=s */ |
145 | JMP,/* J - - PC+=s */ | 145 | OP_JMP,/* J - - PC+=s */ |
146 | 146 | ||
147 | PUSHNILJMP,/* - - nil PC++; */ | 147 | OP_PUSHNILJMP,/* - - nil PC++; */ |
148 | 148 | ||
149 | CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_1-v_b) */ | 149 | OP_CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_1-v_b) */ |
150 | 150 | ||
151 | SETLINE/* U - - LINE=u */ | 151 | OP_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) */ |