diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-25 16:59:43 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-11-25 16:59:43 -0200 |
commit | 33b8a010324863ddb495768ebe9e92403c5116c8 (patch) | |
tree | 4007dcc42001b36e739a3af6366547b88dd8ad7b /lopcodes.h | |
parent | d29ce757376dd309f097e8ff30dd2a9b14567575 (diff) | |
download | lua-33b8a010324863ddb495768ebe9e92403c5116c8.tar.gz lua-33b8a010324863ddb495768ebe9e92403c5116c8.tar.bz2 lua-33b8a010324863ddb495768ebe9e92403c5116c8.zip |
new way to code CALLs + passing multiple arguments between function calls
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.32 1999/03/10 14:09:45 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.33 1999/06/17 17:04:03 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,12 +20,12 @@ typedef enum { | |||
20 | ENDCODE,/* - - (return) */ | 20 | ENDCODE,/* - - (return) */ |
21 | RETCODE,/* b - (return) */ | 21 | RETCODE,/* b - (return) */ |
22 | 22 | ||
23 | CALL,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ | 23 | CALL,/* b c v_n-v_1 f(at c) r_b-r_1 f(v1,...,v_n) */ |
24 | 24 | ||
25 | TAILCALL,/* b c v_c...v_1 f (return) f(v1,...,v_c) */ | 25 | TAILCALL,/* b c v_c-v_1 f (return) f(v1,...,v_c) */ |
26 | 26 | ||
27 | PUSHNIL,/* b - nil_0...nil_b */ | 27 | PUSHNIL,/* b - nil_0-nil_b */ |
28 | POP,/* b a_b...a_1 - */ | 28 | POP,/* b a_b-a_1 - */ |
29 | 29 | ||
30 | PUSHNUMBERW,/* w - (float)w */ | 30 | PUSHNUMBERW,/* w - (float)w */ |
31 | PUSHNUMBER,/* b - (float)b */ | 31 | PUSHNUMBER,/* b - (float)b */ |
@@ -61,12 +61,12 @@ SETGLOBAL,/* b x - VAR[CNST[b]]=x */ | |||
61 | 61 | ||
62 | SETTABLEPOP,/* - v i t - t[i]=v */ | 62 | SETTABLEPOP,/* - v i t - t[i]=v */ |
63 | 63 | ||
64 | SETTABLE,/* b v a_b...a_1 i t a_b...a_1 i t t[i]=v */ | 64 | SETTABLE,/* b v a_b-a_1 i t a_b-a_1 i t t[i]=v */ |
65 | 65 | ||
66 | SETLISTW,/* w c v_c...v_1 t t t[i+w*FPF]=v_i */ | 66 | SETLISTW,/* w c v_c-v_1 t t t[i+w*FPF]=v_i */ |
67 | SETLIST,/* b c v_c...v_1 t t t[i+b*FPF]=v_i */ | 67 | SETLIST,/* b c v_c-v_1 t t t[i+b*FPF]=v_i */ |
68 | 68 | ||
69 | SETMAP,/* b v_b k_b ...v_0 k_0 t t t[k_i]=v_i */ | 69 | SETMAP,/* b v_b k_b - v_0 k_0 t t t[k_i]=v_i */ |
70 | 70 | ||
71 | NEQOP,/* - y x (x~=y)? 1 : nil */ | 71 | NEQOP,/* - y x (x~=y)? 1 : nil */ |
72 | EQOP,/* - y x (x==y)? 1 : nil */ | 72 | EQOP,/* - y x (x==y)? 1 : nil */ |
@@ -96,16 +96,14 @@ IFTUPJMP,/* b x - (x!=nil)? PC-=b */ | |||
96 | IFFUPJMPW,/* w x - (x==nil)? PC-=w */ | 96 | IFFUPJMPW,/* w x - (x==nil)? PC-=w */ |
97 | IFFUPJMP,/* b x - (x==nil)? PC-=b */ | 97 | IFFUPJMP,/* b x - (x==nil)? PC-=b */ |
98 | 98 | ||
99 | CLOSUREW,/* w c v_c...v_1 closure(CNST[w], v_c...v_1) */ | 99 | CLOSUREW,/* w c v_c-v_1 closure(CNST[w], v_c-v_1) */ |
100 | CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */ | 100 | CLOSURE,/* b c v_c-v_1 closure(CNST[b], v_c-v_1) */ |
101 | 101 | ||
102 | SETLINEW,/* w - - LINE=w */ | 102 | SETLINEW,/* w - - LINE=w */ |
103 | SETLINE,/* b - - LINE=b */ | 103 | SETLINE,/* b - - LINE=b */ |
104 | 104 | ||
105 | LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */ | 105 | LONGARGW,/* w (add w*(1<<16) to arg of next instruction) */ |
106 | LONGARG,/* b (add b*(1<<16) to arg of next instruction) */ | 106 | LONGARG /* b (add b*(1<<16) to arg of next instruction) */ |
107 | |||
108 | CHECKSTACK /* b (assert #temporaries == b; only for internal debuging!) */ | ||
109 | 107 | ||
110 | } OpCode; | 108 | } OpCode; |
111 | 109 | ||