From 8fbe9e3470295e3b70273fa32ef56459cc0b5201 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 4 Oct 2017 12:49:24 -0300 Subject: new opcodes with immediate integer operand for all arithmetic operations --- ldebug.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index fbb3839d..67b9496a 100644 --- a/ldebug.c +++ b/ldebug.c @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 2.129 2017/07/07 16:34:32 roberto Exp roberto $ +** $Id: ldebug.c,v 2.130 2017/07/10 17:35:12 roberto Exp roberto $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -592,14 +592,17 @@ static const char *funcnamefromcode (lua_State *L, CallInfo *ci, case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD: tm = TM_NEWINDEX; break; - case OP_ADDI: - tm = TM_ADD; + case OP_ADDI: case OP_SUBI: case OP_MULI: case OP_MODI: + case OP_POWI: case OP_DIVI: case OP_IDIVI: { + int offset = GET_OPCODE(i) - OP_ADDI; /* ORDER OP */ + tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ break; + } case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD: case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND: case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: { - int offset = cast_int(GET_OPCODE(i)) - cast_int(OP_ADD); /* ORDER OP */ - tm = cast(TMS, offset + cast_int(TM_ADD)); /* ORDER TM */ + int offset = GET_OPCODE(i) - OP_ADD; /* ORDER OP */ + tm = cast(TMS, offset + TM_ADD); /* ORDER TM */ break; } case OP_UNM: tm = TM_UNM; break; -- cgit v1.2.3-55-g6feb