diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-27 15:01:57 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-06-27 15:01:57 -0300 |
| commit | 6ac7219da31df0238dc33c2d4457f69bfe0c1e79 (patch) | |
| tree | c9fc124ed998ea39a6222556bb581817791089de /lopcodes.h | |
| parent | 9904c253da9690728710082cfb94654709ab89e7 (diff) | |
| download | lua-6ac7219da31df0238dc33c2d4457f69bfe0c1e79.tar.gz lua-6ac7219da31df0238dc33c2d4457f69bfe0c1e79.tar.bz2 lua-6ac7219da31df0238dc33c2d4457f69bfe0c1e79.zip | |
'isIT'/'isOT' turned from macros to functions
Diffstat (limited to 'lopcodes.h')
| -rw-r--r-- | lopcodes.h | 12 |
1 files changed, 3 insertions, 9 deletions
| @@ -8,6 +8,7 @@ | |||
| 8 | #define lopcodes_h | 8 | #define lopcodes_h |
| 9 | 9 | ||
| 10 | #include "llimits.h" | 10 | #include "llimits.h" |
| 11 | #include "lobject.h" | ||
| 11 | 12 | ||
| 12 | 13 | ||
| 13 | /*=========================================================================== | 14 | /*=========================================================================== |
| @@ -394,16 +395,9 @@ LUAI_DDEC(const lu_byte luaP_opmodes[NUM_OPCODES];) | |||
| 394 | #define testOTMode(m) (luaP_opmodes[m] & (1 << 6)) | 395 | #define testOTMode(m) (luaP_opmodes[m] & (1 << 6)) |
| 395 | #define testMMMode(m) (luaP_opmodes[m] & (1 << 7)) | 396 | #define testMMMode(m) (luaP_opmodes[m] & (1 << 7)) |
| 396 | 397 | ||
| 397 | /* "out top" (set top for next instruction) */ | ||
| 398 | #define isOT(i) \ | ||
| 399 | ((testOTMode(GET_OPCODE(i)) && GETARG_C(i) == 0) || \ | ||
| 400 | GET_OPCODE(i) == OP_TAILCALL) | ||
| 401 | 398 | ||
| 402 | /* "in top" (uses top from previous instruction) */ | 399 | LUAI_FUNC int luaP_isOT (Instruction i); |
| 403 | #define isIT(i) (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0) | 400 | LUAI_FUNC int luaP_isIT (Instruction i); |
| 404 | |||
| 405 | #define opmode(mm,ot,it,t,a,m) \ | ||
| 406 | (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m)) | ||
| 407 | 401 | ||
| 408 | 402 | ||
| 409 | #endif | 403 | #endif |
