From dd547c55c85ba48f481836ba76ecdfe69960bcd0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 1 Feb 2011 16:03:10 -0200 Subject: new scheme to close upvalues in 'break'; jump instructions may do the close, avoiding the need for a OP_CLOSE instruction --- lopcodes.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index b26a4519..f606ab0a 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.136 2010/10/13 16:45:54 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.137 2010/10/25 12:24:55 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -195,8 +195,7 @@ OP_LEN,/* A B R(A) := length of R(B) */ OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ -OP_JMP,/* sBx pc+=sBx */ - +OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A) + 1 */ OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ @@ -217,7 +216,7 @@ OP_TFORLOOP,/* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }*/ OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ -OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ +OP_CLOSE,/* A close all upvalues >= R(A) */ OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx]) */ OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-2) = vararg */ -- cgit v1.2.3-55-g6feb