From 80d9b09f351c7a9be557116e9c79ae11e9b3f032 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 13 Sep 2017 16:50:08 -0300 Subject: jumps do not close upvalues (to be faster and simpler); explicit instruction to close upvalues; command 'break' not handled like a 'goto' (to optimize removal of uneeded 'close' instructions) --- lopcodes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lopcodes.c') diff --git a/lopcodes.c b/lopcodes.c index 74195d42..a64c29ce 100644 --- a/lopcodes.c +++ b/lopcodes.c @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.c,v 1.59 2017/06/29 15:38:41 roberto Exp roberto $ +** $Id: lopcodes.c,v 1.60 2017/08/14 18:33:14 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -54,6 +54,7 @@ LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { "NOT", "LEN", "CONCAT", + "CLOSE", "JMP", "EQ", "LT", @@ -115,7 +116,8 @@ LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ - ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ + ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ + ,opmode(0, 0, OpArgU, OpArgN, iAsBx) /* OP_JMP */ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ -- cgit v1.2.3-55-g6feb