diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-29 15:35:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-29 15:35:46 -0200 |
commit | 4e0bf95622151cf09a2708b465d6df682ad43284 (patch) | |
tree | 884d5b225780be9629121046eea600b7451348e6 | |
parent | 498a934abf763ef1e436663ae40afea4f3a5075a (diff) | |
download | lua-4e0bf95622151cf09a2708b465d6df682ad43284.tar.gz lua-4e0bf95622151cf09a2708b465d6df682ad43284.tar.bz2 lua-4e0bf95622151cf09a2708b465d6df682ad43284.zip |
variant opcodes for PUSHSELF
-rw-r--r-- | lopcodes.h | 10 | ||||
-rw-r--r-- | lua.stx | 4 | ||||
-rw-r--r-- | lvm.c | 8 |
3 files changed, 17 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.11 1997/10/24 17:17:24 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.12 1997/10/24 18:40:29 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 | */ |
@@ -79,6 +79,14 @@ GETDOTTED7,/* - t t[CONST[7]] */ | |||
79 | GETDOTTEDW,/* w t t[CONST[w]] */ | 79 | GETDOTTEDW,/* w t t[CONST[w]] */ |
80 | 80 | ||
81 | PUSHSELF,/* b t t t[CNST[b]] */ | 81 | PUSHSELF,/* b t t t[CNST[b]] */ |
82 | PUSHSELF0,/* - t t t[CNST[0]] */ | ||
83 | PUSHSELF1,/* - t t t[CNST[1]] */ | ||
84 | PUSHSELF2,/* - t t t[CNST[2]] */ | ||
85 | PUSHSELF3,/* - t t t[CNST[3]] */ | ||
86 | PUSHSELF4,/* - t t t[CNST[4]] */ | ||
87 | PUSHSELF5,/* - t t t[CNST[5]] */ | ||
88 | PUSHSELF6,/* - t t t[CNST[6]] */ | ||
89 | PUSHSELF7,/* - t t t[CNST[7]] */ | ||
82 | PUSHSELFW,/* w t t t[CNST[w]] */ | 90 | PUSHSELFW,/* w t t t[CNST[w]] */ |
83 | 91 | ||
84 | CREATEARRAY,/* b - newarray(size = b) */ | 92 | CREATEARRAY,/* b - newarray(size = b) */ |
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | /* | 2 | /* |
3 | ** $Id: lua.stx,v 1.28 1997/12/28 22:48:15 roberto Exp roberto $ | 3 | ** $Id: lua.stx,v 1.29 1997/12/29 17:28:45 roberto Exp roberto $ |
4 | ** Syntax analizer and code generator | 4 | ** Syntax analizer and code generator |
5 | ** See Copyright Notice in lua.h | 5 | ** See Copyright Notice in lua.h |
6 | */ | 6 | */ |
@@ -833,7 +833,7 @@ functioncall : funcvalue funcParams | |||
833 | funcvalue : sexp1 { $$ = 0; } | 833 | funcvalue : sexp1 { $$ = 0; } |
834 | | sexp1 ':' NAME | 834 | | sexp1 ':' NAME |
835 | { | 835 | { |
836 | code_oparg(PUSHSELF, 0, string_constant($3, L->currState), 1); | 836 | code_oparg(PUSHSELF, 8, string_constant($3, L->currState), 1); |
837 | $$ = 1; | 837 | $$ = 1; |
838 | } | 838 | } |
839 | ; | 839 | ; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.18 1997/12/17 20:48:58 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.19 1997/12/23 19:24:19 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -363,7 +363,11 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) | |||
363 | aux = next_word(pc); goto pushself; | 363 | aux = next_word(pc); goto pushself; |
364 | 364 | ||
365 | case PUSHSELF: | 365 | case PUSHSELF: |
366 | aux = *pc++; | 366 | aux = *pc++; goto pushself; |
367 | |||
368 | case PUSHSELF0: case PUSHSELF1: case PUSHSELF2: case PUSHSELF3: | ||
369 | case PUSHSELF4: case PUSHSELF5: case PUSHSELF6: case PUSHSELF7: | ||
370 | aux -= PUSHSELF0; | ||
367 | pushself: { | 371 | pushself: { |
368 | TObject receiver = *(S->top-1); | 372 | TObject receiver = *(S->top-1); |
369 | *S->top++ = consts[aux]; | 373 | *S->top++ = consts[aux]; |