diff options
Diffstat (limited to 'lopcodes.h')
| -rw-r--r-- | lopcodes.h | 15 |
1 files changed, 10 insertions, 5 deletions
| @@ -417,8 +417,8 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | |||
| 417 | ** bits 0-2: op mode | 417 | ** bits 0-2: op mode |
| 418 | ** bit 3: instruction set register A | 418 | ** bit 3: instruction set register A |
| 419 | ** bit 4: operator is a test (next instruction must be a jump) | 419 | ** bit 4: operator is a test (next instruction must be a jump) |
| 420 | ** bit 5: instruction uses 'L->top' set by previous instruction (when B == 0) | 420 | ** bit 5: used by 'luaP_isIT' |
| 421 | ** bit 6: instruction sets 'L->top' for next instruction (when C == 0) | 421 | ** bit 6: used by 'luaP_isOT' |
| 422 | ** bit 7: instruction is an MM instruction (call a metamethod) | 422 | ** bit 7: instruction is an MM instruction (call a metamethod) |
| 423 | */ | 423 | */ |
| 424 | 424 | ||
| @@ -427,12 +427,17 @@ LUAI_DDEC(const lu_byte luaP_opmodes[NUM_OPCODES];) | |||
| 427 | #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) | 427 | #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 7)) |
| 428 | #define testAMode(m) (luaP_opmodes[m] & (1 << 3)) | 428 | #define testAMode(m) (luaP_opmodes[m] & (1 << 3)) |
| 429 | #define testTMode(m) (luaP_opmodes[m] & (1 << 4)) | 429 | #define testTMode(m) (luaP_opmodes[m] & (1 << 4)) |
| 430 | #define testITMode(m) (luaP_opmodes[m] & (1 << 5)) | ||
| 431 | #define testOTMode(m) (luaP_opmodes[m] & (1 << 6)) | ||
| 432 | #define testMMMode(m) (luaP_opmodes[m] & (1 << 7)) | 430 | #define testMMMode(m) (luaP_opmodes[m] & (1 << 7)) |
| 433 | 431 | ||
| 434 | 432 | ||
| 435 | LUAI_FUNC int luaP_isOT (Instruction i); | 433 | /* Check whether instruction sets top for next instruction, that is, |
| 434 | ** it results in multiple values. Used only for tests. | ||
| 435 | */ | ||
| 436 | #define luaP_isOT(i) \ | ||
| 437 | (GET_OPCODE(i) == OP_TAILCALL || \ | ||
| 438 | ((luaP_opmodes[GET_OPCODE(i)] & (1 << 6)) && GETARG_C(i) == 0)) | ||
| 439 | |||
| 440 | |||
| 436 | LUAI_FUNC int luaP_isIT (Instruction i); | 441 | LUAI_FUNC int luaP_isIT (Instruction i); |
| 437 | 442 | ||
| 438 | 443 | ||
