aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-10-04 12:49:24 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-10-04 12:49:24 -0300
commit8fbe9e3470295e3b70273fa32ef56459cc0b5201 (patch)
tree21fcdfc75c622f5b015a1fcd131eef1b7701cc5d /ldebug.c
parent9ed9f40f1e3674f9ed7ffbe73c0c9718782fe6cd (diff)
downloadlua-8fbe9e3470295e3b70273fa32ef56459cc0b5201.tar.gz
lua-8fbe9e3470295e3b70273fa32ef56459cc0b5201.tar.bz2
lua-8fbe9e3470295e3b70273fa32ef56459cc0b5201.zip
new opcodes with immediate integer operand for all arithmetic operations
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ldebug.c b/ldebug.c
index fbb3839d..67b9496a 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.129 2017/07/07 16:34:32 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.130 2017/07/10 17:35:12 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -592,14 +592,17 @@ static const char *funcnamefromcode (lua_State *L, CallInfo *ci,
592 case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD: 592 case OP_SETTABUP: case OP_SETTABLE: case OP_SETI: case OP_SETFIELD:
593 tm = TM_NEWINDEX; 593 tm = TM_NEWINDEX;
594 break; 594 break;
595 case OP_ADDI: 595 case OP_ADDI: case OP_SUBI: case OP_MULI: case OP_MODI:
596 tm = TM_ADD; 596 case OP_POWI: case OP_DIVI: case OP_IDIVI: {
597 int offset = GET_OPCODE(i) - OP_ADDI; /* ORDER OP */
598 tm = cast(TMS, offset + TM_ADD); /* ORDER TM */
597 break; 599 break;
600 }
598 case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD: 601 case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD:
599 case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND: 602 case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND:
600 case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: { 603 case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: {
601 int offset = cast_int(GET_OPCODE(i)) - cast_int(OP_ADD); /* ORDER OP */ 604 int offset = GET_OPCODE(i) - OP_ADD; /* ORDER OP */
602 tm = cast(TMS, offset + cast_int(TM_ADD)); /* ORDER TM */ 605 tm = cast(TMS, offset + TM_ADD); /* ORDER TM */
603 break; 606 break;
604 } 607 }
605 case OP_UNM: tm = TM_UNM; break; 608 case OP_UNM: tm = TM_UNM; break;