/*
* If 'obj' is a string, it is tried to be interpreted as a number.
/*
* If 'obj' is a string, it is tried to be interpreted as a number.
ARITH_OP1_END
#endif
+#ifdef COMPUTED_GOTO
+#define OPCODE_TARGET(op) DO_OP_##op:
ARITH_OP1_END
#endif
+#ifdef COMPUTED_GOTO
+#define OPCODE_TARGET(op) DO_OP_##op:
-+#define CALL_OPCODE(op) \
-+ if ((op < sizeof(opcodes) / sizeof(opcodes[0])) && opcodes[op]) \
-+ goto *opcodes[op];
++#define CALL_OPCODE(op) goto *opcodes[op];
+#define OPCODE_PTR(op) [OP_##op] = &&DO_OP_##op
+#else
+#define OPCODE_TARGET(op) case OP_##op:
+#define OPCODE_PTR(op) [OP_##op] = &&DO_OP_##op
+#else
+#define OPCODE_TARGET(op) case OP_##op:
reentry: /* entry point */
lua_assert(isLua(L->ci));
pc = L->savedpc;
reentry: /* entry point */
lua_assert(isLua(L->ci));
pc = L->savedpc;
+@@ -592,33 +646,33 @@
+ lua_assert(base == L->base && L->base == L->ci->base);
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
lua_assert(base <= L->top && L->top <= L->stack + L->stacksize);
lua_assert(L->top == L->ci->top || luaG_checkopenop(i));
- switch (GET_OPCODE(i)) {
+- switch (GET_OPCODE(i)) {
++ CALL_OPCODE(GET_OPCODE(i)) {
+ OPCODE_TARGET(MOVE) {
setobjs2s(L, ra, RB(i));
continue;
+ OPCODE_TARGET(MOVE) {
setobjs2s(L, ra, RB(i));
continue;
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
Protect(luaV_gettable(L, &g, rb, ra));
continue;
}
Protect(luaV_gettable(L, &g, rb, ra));
continue;
}
const TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
const TValue *rb = RB(i);
switch (ttype(rb)) {
case LUA_TTABLE: {
TValue *rb = RKB(i);
TValue *rc = RKC(i);
Protect(
TValue *rb = RKB(i);
TValue *rc = RKC(i);
Protect(
Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
Protect(
if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
Protect(
if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i))
dojump(L, pc, GETARG_sBx(*pc));
TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb);
TValue *rb = RB(i);
if (l_isfalse(rb) != GETARG_C(i)) {
setobjs2s(L, ra, rb);
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */
int b = GETARG_B(i);
int nresults = GETARG_C(i) - 1;
if (b != 0) L->top = ra+b; /* else previous instruction set top */
int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc;
int b = GETARG_B(i);
if (b != 0) L->top = ra+b; /* else previous instruction set top */
L->savedpc = pc;
int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base);
int b = GETARG_B(i);
if (b != 0) L->top = ra+b-1;
if (L->openupval) luaF_close(L, base);
/* If start,step and limit are all integers, we don't need to check
* against overflow in the looping.
*/
/* If start,step and limit are all integers, we don't need to check
* against overflow in the looping.
*/
const TValue *init = ra;
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
const TValue *init = ra;
const TValue *plimit = ra+1;
const TValue *pstep = ra+2;
dojump(L, pc, GETARG_sBx(i));
continue;
}
dojump(L, pc, GETARG_sBx(i));
continue;
}
StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1);
StkId cb = ra + 3; /* call base */
setobjs2s(L, cb+2, ra+2);
setobjs2s(L, cb+1, ra+1);
int n = GETARG_B(i);
int c = GETARG_C(i);
int last;
int n = GETARG_B(i);
int c = GETARG_C(i);
int last;
Proto *p;
Closure *ncl;
int nup, j;
Proto *p;
Closure *ncl;
int nup, j;
Protect(luaC_checkGC(L));
continue;
}
Protect(luaC_checkGC(L));
continue;
}