aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-29 15:35:46 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-29 15:35:46 -0200
commit4e0bf95622151cf09a2708b465d6df682ad43284 (patch)
tree884d5b225780be9629121046eea600b7451348e6
parent498a934abf763ef1e436663ae40afea4f3a5075a (diff)
downloadlua-4e0bf95622151cf09a2708b465d6df682ad43284.tar.gz
lua-4e0bf95622151cf09a2708b465d6df682ad43284.tar.bz2
lua-4e0bf95622151cf09a2708b465d6df682ad43284.zip
variant opcodes for PUSHSELF
-rw-r--r--lopcodes.h10
-rw-r--r--lua.stx4
-rw-r--r--lvm.c8
3 files changed, 17 insertions, 5 deletions
diff --git a/lopcodes.h b/lopcodes.h
index ec3cfce2..a93ae98c 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -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]] */
79GETDOTTEDW,/* w t t[CONST[w]] */ 79GETDOTTEDW,/* w t t[CONST[w]] */
80 80
81PUSHSELF,/* b t t t[CNST[b]] */ 81PUSHSELF,/* b t t t[CNST[b]] */
82PUSHSELF0,/* - t t t[CNST[0]] */
83PUSHSELF1,/* - t t t[CNST[1]] */
84PUSHSELF2,/* - t t t[CNST[2]] */
85PUSHSELF3,/* - t t t[CNST[3]] */
86PUSHSELF4,/* - t t t[CNST[4]] */
87PUSHSELF5,/* - t t t[CNST[5]] */
88PUSHSELF6,/* - t t t[CNST[6]] */
89PUSHSELF7,/* - t t t[CNST[7]] */
82PUSHSELFW,/* w t t t[CNST[w]] */ 90PUSHSELFW,/* w t t t[CNST[w]] */
83 91
84CREATEARRAY,/* b - newarray(size = b) */ 92CREATEARRAY,/* b - newarray(size = b) */
diff --git a/lua.stx b/lua.stx
index 07e0d0cd..784ad704 100644
--- a/lua.stx
+++ b/lua.stx
@@ -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
833funcvalue : sexp1 { $$ = 0; } 833funcvalue : 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 ;
diff --git a/lvm.c b/lvm.c
index 56a842bc..13bd6e73 100644
--- a/lvm.c
+++ b/lvm.c
@@ -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];