aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-25 08:47:59 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-25 08:47:59 +0200
commit706e902323345130b200b9325f34bfc4c79ab579 (patch)
treedb4c56119684b0eeeac3892663b2de6085a2e998
parent272890fe35c00474a785f55aff8ff03f2a625c13 (diff)
downloadfengari-706e902323345130b200b9325f34bfc4c79ab579.tar.gz
fengari-706e902323345130b200b9325f34bfc4c79ab579.tar.bz2
fengari-706e902323345130b200b9325f34bfc4c79ab579.zip
Added missing lopcode.MAXINDEXRK
Which ended up generating an OP_LOADK when not needed
-rw-r--r--src/lopcodes.js5
-rw-r--r--src/lvm.js1
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lopcodes.js b/src/lopcodes.js
index f679f85..932878d 100644
--- a/src/lopcodes.js
+++ b/src/lopcodes.js
@@ -212,6 +212,8 @@ const MAXARG_C = ((1 << SIZE_C) - 1);
/* this bit 1 means constant (0 means register) */
const BITRK = (1 << (SIZE_B - 1));
+const MAXINDEXRK = (BITRK - 1);
+
/*
** invalid register that fits in 8 bits
*/
@@ -333,6 +335,7 @@ module.exports.MAXARG_B = MAXARG_B;
module.exports.MAXARG_Bx = MAXARG_Bx;
module.exports.MAXARG_C = MAXARG_C;
module.exports.MAXARG_sBx = MAXARG_sBx;
+module.exports.MAXINDEXRK = MAXINDEXRK;
module.exports.NO_REG = NO_REG;
module.exports.OpArgK = OpArgK;
module.exports.OpArgN = OpArgN;
@@ -369,4 +372,4 @@ module.exports.iABx = iABx;
module.exports.iAsBx = iAsBx;
module.exports.iAx = iAx;
module.exports.testAMode = testAMode;
-module.exports.testTMode = testTMode; \ No newline at end of file
+module.exports.testTMode = testTMode;
diff --git a/src/lvm.js b/src/lvm.js
index 43ea9b2..be4ebfc 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -136,7 +136,6 @@ const luaV_execute = function(L) {
if (i.breakpoint) // TODO: remove, used until lapi
return;
- // console.log(`> ${opcode}`);
switch (opcode) {
case OCi.OP_MOVE: {
L.stack[ra] = L.stack[RB(L, base, i)];