aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-25 15:52:29 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-03-25 15:52:29 -0300
commit2a2b64d6ac2ea7839dac41cc84be1c7a5a18bee7 (patch)
treebbacd86c6e92e3614dcd48b54846de5f4252f137
parentdaa937c043bb0ddb5f4bfe676f8ff13825a99651 (diff)
downloadlua-2a2b64d6ac2ea7839dac41cc84be1c7a5a18bee7.tar.gz
lua-2a2b64d6ac2ea7839dac41cc84be1c7a5a18bee7.tar.bz2
lua-2a2b64d6ac2ea7839dac41cc84be1c7a5a18bee7.zip
opcode "CLOSURE" gets the prototipe (instead of a previous pushconstant)
-rw-r--r--lopcodes.h7
-rw-r--r--lua.stx6
-rw-r--r--lvm.c13
3 files changed, 13 insertions, 13 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 591ff7f4..5ee96ad9 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.16 1998/03/10 17:15:05 roberto Exp $ 2** $Id: lopcodes.h,v 1.16 1998/03/11 13:59:50 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*/
@@ -154,9 +154,8 @@ IFTUPJMPW,/* w x - (x!=nil)? PC-=w */
154IFFUPJMP,/* b x - (x==nil)? PC-=b */ 154IFFUPJMP,/* b x - (x==nil)? PC-=b */
155IFFUPJMPW,/* w x - (x==nil)? PC-=w */ 155IFFUPJMPW,/* w x - (x==nil)? PC-=w */
156 156
157CLOSURE,/* b proto v_b...v_1 c(proto) */ 157CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */
158CLOSURE0,/* - proto c(proto) */ 158CLOSUREW,/* w b v_b...v_1 closure(CNST[w], v_b...v_1) */
159CLOSURE1,/* - proto v_1 c(proto) */
160 159
161CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ 160CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */
162CALLFUNC0,/* b v_b...v_1 f - f(v1,...,v_b) */ 161CALLFUNC0,/* b v_b...v_1 f - f(v1,...,v_b) */
diff --git a/lua.stx b/lua.stx
index ad7f3c88..fcfd9aa0 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2/* 2/*
3** $Id: lua.stx,v 1.34 1998/02/11 20:56:46 roberto Exp roberto $ 3** $Id: lua.stx,v 1.35 1998/03/09 21:49:52 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*/
@@ -554,8 +554,8 @@ static void func_onstack (TProtoFunc *f)
554 else { 554 else {
555 for (i=0; i<nupvalues; i++) 555 for (i=0; i<nupvalues; i++)
556 lua_pushvar((L->currState+1)->upvalues[i]); 556 lua_pushvar((L->currState+1)->upvalues[i]);
557 code_constant(c); 557 code_oparg(CLOSURE, 0, c, -nupvalues+1);
558 code_oparg(CLOSURE, 2, nupvalues, -nupvalues); 558 code_byte(nupvalues);
559 } 559 }
560} 560}
561 561
diff --git a/lvm.c b/lvm.c
index 2b1622d1..c41d84b5 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.25 1998/03/09 21:49:52 roberto Exp roberto $ 2** $Id: lvm.c,v 1.26 1998/03/11 13:59:50 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*/
@@ -680,13 +680,14 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base)
680 if (ttype(--S->top) == LUA_T_NIL) pc -= aux; 680 if (ttype(--S->top) == LUA_T_NIL) pc -= aux;
681 break; 681 break;
682 682
683 case CLOSURE: 683 case CLOSUREW:
684 aux = *pc++; goto closure; 684 aux = next_word(pc); goto closure;
685 685
686 case CLOSURE0: case CLOSURE1: 686 case CLOSURE:
687 aux -= CLOSURE0; 687 aux = *pc++;
688 closure: 688 closure:
689 luaV_closure(aux); 689 *S->top++ = consts[aux];
690 luaV_closure(*pc++);
690 luaC_checkGC(); 691 luaC_checkGC();
691 break; 692 break;
692 693