summaryrefslogtreecommitdiff
path: root/src/lopcodes.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-09 13:55:06 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-09 14:25:56 +1000
commit9376c7bb8b361de6c2399034c2c91d1bb080660a (patch)
treef9367392171e866cc01b71d97c6ca4a6428b4375 /src/lopcodes.js
parent347242c091e24955f7c81667bd5f340a0d0f0d1e (diff)
downloadfengari-9376c7bb8b361de6c2399034c2c91d1bb080660a.tar.gz
fengari-9376c7bb8b361de6c2399034c2c91d1bb080660a.tar.bz2
fengari-9376c7bb8b361de6c2399034c2c91d1bb080660a.zip
src/lopcodes.js: SETARG_* can be tail calls
Diffstat (limited to 'src/lopcodes.js')
-rw-r--r--src/lopcodes.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lopcodes.js b/src/lopcodes.js
index ba33f12..e3b71db 100644
--- a/src/lopcodes.js
+++ b/src/lopcodes.js
@@ -251,12 +251,12 @@ const GET_OPCODE = function(i) {
const SET_OPCODE = function(i, o) {
i.code = (i.code & MASK0(SIZE_OP, POS_OP)) | ((o << POS_OP) & MASK1(SIZE_OP, POS_OP));
- fullins(i);
+ return fullins(i);
};
const setarg = function(i, v, pos, size) {
i.code = (i.code & MASK0(size, pos)) | ((v << pos) & MASK1(size, pos));
- fullins(i);
+ return fullins(i);
};
const GETARG_A = function(i) {
@@ -264,7 +264,7 @@ const GETARG_A = function(i) {
};
const SETARG_A = function(i,v) {
- setarg(i, v, POS_A, SIZE_A);
+ return setarg(i, v, POS_A, SIZE_A);
};
const GETARG_B = function(i) {
@@ -272,7 +272,7 @@ const GETARG_B = function(i) {
};
const SETARG_B = function(i,v) {
- setarg(i, v, POS_B, SIZE_B);
+ return setarg(i, v, POS_B, SIZE_B);
};
const GETARG_C = function(i) {
@@ -280,7 +280,7 @@ const GETARG_C = function(i) {
};
const SETARG_C = function(i,v) {
- setarg(i, v, POS_C, SIZE_C);
+ return setarg(i, v, POS_C, SIZE_C);
};
const GETARG_Bx = function(i) {
@@ -288,7 +288,7 @@ const GETARG_Bx = function(i) {
};
const SETARG_Bx = function(i,v) {
- setarg(i, v, POS_Bx, SIZE_Bx);
+ return setarg(i, v, POS_Bx, SIZE_Bx);
};
const GETARG_Ax = function(i) {
@@ -296,7 +296,7 @@ const GETARG_Ax = function(i) {
};
const SETARG_Ax = function(i,v) {
- setarg(i, v, POS_Ax, SIZE_Ax);
+ return setarg(i, v, POS_Ax, SIZE_Ax);
};
const GETARG_sBx = function(i) {
@@ -304,7 +304,7 @@ const GETARG_sBx = function(i) {
};
const SETARG_sBx = function(i, b) {
- SETARG_Bx(i, b + MAXARG_sBx);
+ return SETARG_Bx(i, b + MAXARG_sBx);
};
/*