diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 15:25:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 15:25:11 -0300 |
commit | f12ce4029dfbce7b89ec136e6b7ba5f6bca039da (patch) | |
tree | 6f395f013dcd0841efe00ebbf73c18d855c9fd28 /lstate.h | |
parent | a4762b6ffe74f5878882ef238d37bfa92d90e418 (diff) | |
download | lua-f12ce4029dfbce7b89ec136e6b7ba5f6bca039da.tar.gz lua-f12ce4029dfbce7b89ec136e6b7ba5f6bca039da.tar.bz2 lua-f12ce4029dfbce7b89ec136e6b7ba5f6bca039da.zip |
More integration of 'nresults' into 'callstatus'
Diffstat (limited to 'lstate.h')
-rw-r--r-- | lstate.h | 33 |
1 files changed, 20 insertions, 13 deletions
@@ -210,33 +210,40 @@ struct CallInfo { | |||
210 | 210 | ||
211 | 211 | ||
212 | /* | 212 | /* |
213 | ** Maximum expected number of results from a function | ||
214 | ** (must fit in CIST_NRESULTS). | ||
215 | */ | ||
216 | #define MAXRESULTS 250 | ||
217 | |||
218 | |||
219 | /* | ||
213 | ** Bits in CallInfo status | 220 | ** Bits in CallInfo status |
214 | */ | 221 | */ |
215 | /* bits 0-7 are the expected number of results from this function + 1 */ | 222 | /* bits 0-7 are the expected number of results from this function + 1 */ |
216 | #define CIST_NRESULTS 0xff | 223 | #define CIST_NRESULTS 0xffu |
224 | /* Bits 8-10 are used for CIST_RECST (see below) */ | ||
225 | #define CIST_RECST 8 /* the offset, not the mask */ | ||
217 | /* original value of 'allowhook' */ | 226 | /* original value of 'allowhook' */ |
218 | #define CIST_OAH (cast(l_uint32, 1) << 8) | 227 | #define CIST_OAH (cast(l_uint32, 1) << 11) |
219 | /* call is running a C function */ | 228 | /* call is running a C function */ |
220 | #define CIST_C (cast(l_uint32, 1) << 9) | 229 | #define CIST_C (CIST_OAH << 1) |
221 | /* call is on a fresh "luaV_execute" frame */ | 230 | /* call is on a fresh "luaV_execute" frame */ |
222 | #define CIST_FRESH (cast(l_uint32, 1) << 10) | 231 | #define CIST_FRESH (CIST_C << 1) |
223 | /* call is running a debug hook */ | 232 | /* call is running a debug hook */ |
224 | #define CIST_HOOKED (cast(l_uint32, 1) << 11) | 233 | #define CIST_HOOKED (CIST_FRESH << 1) |
225 | /* doing a yieldable protected call */ | 234 | /* doing a yieldable protected call */ |
226 | #define CIST_YPCALL (cast(l_uint32, 1) << 12) | 235 | #define CIST_YPCALL (CIST_HOOKED << 1) |
227 | /* call was tail called */ | 236 | /* call was tail called */ |
228 | #define CIST_TAIL (cast(l_uint32, 1) << 13) | 237 | #define CIST_TAIL (CIST_YPCALL << 1) |
229 | /* last hook called yielded */ | 238 | /* last hook called yielded */ |
230 | #define CIST_HOOKYIELD (cast(l_uint32, 1) << 14) | 239 | #define CIST_HOOKYIELD (CIST_TAIL << 1) |
231 | /* function "called" a finalizer */ | 240 | /* function "called" a finalizer */ |
232 | #define CIST_FIN (cast(l_uint32, 1) << 15) | 241 | #define CIST_FIN (CIST_HOOKYIELD << 1) |
233 | /* function is closing tbc variables */ | 242 | /* function is closing tbc variables */ |
234 | #define CIST_CLSRET (cast(l_uint32, 1) << 16) | 243 | #define CIST_CLSRET (CIST_FIN << 1) |
235 | /* Bits 17-19 are used for CIST_RECST (see below) */ | ||
236 | #define CIST_RECST 17 /* the offset, not the mask */ | ||
237 | #if defined(LUA_COMPAT_LT_LE) | 244 | #if defined(LUA_COMPAT_LT_LE) |
238 | /* using __lt for __le */ | 245 | /* using __lt for __le */ |
239 | #define CIST_LEQ (cast(l_uint32, 1) << 20) | 246 | #define CIST_LEQ (CIST_CLSRET << 1) |
240 | #endif | 247 | #endif |
241 | 248 | ||
242 | 249 | ||