336 |
336 |
337 /* |
337 /* |
338 ** some macros for common tasks in `luaV_execute' |
338 ** some macros for common tasks in `luaV_execute' |
339 */ |
339 */ |
340 |
340 |
341 #define runtime_check(L, c) { if (!(c)) break; } |
341 #define runtime_check(L, c) { if (!(c)) break; } |
342 |
342 |
343 #define RA(i) (base+GETARG_A(i)) |
343 #define RA(i) (base+GETARG_A(i)) |
344 /* to be used after possible stack reallocation */ |
344 /* to be used after possible stack reallocation */ |
345 #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) |
345 #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) |
346 #define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) |
346 #define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) |
347 #define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ |
347 #define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ |
348 ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) |
348 ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) |
349 #define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ |
349 #define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ |
350 ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) |
350 ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) |
351 #define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) |
351 #define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) |
352 |
352 |
353 |
353 |
354 #define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} |
354 #define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} |
355 |
355 |
356 |
356 |
357 #define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } |
357 #define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } |
358 |
358 |
359 |
359 |
360 #define arith_op(op,tm) { \ |
360 #define arith_op(op,tm) { \ |
361 TValue *rb = RKB(i); \ |
361 TValue *rb = RKB(i); \ |
362 TValue *rc = RKC(i); \ |
362 TValue *rc = RKC(i); \ |