diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-07 11:25:26 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-07 11:25:26 -0200 |
| commit | ad0704e40cc7b3135fedc6d40a522addb039e090 (patch) | |
| tree | 4bcd104de4941239e09316efcee5e5e3566b8b81 /lobject.h | |
| parent | 5a3f26f85558bedfa439027919d928abfdd00b6d (diff) | |
| download | lua-ad0704e40cc7b3135fedc6d40a522addb039e090.tar.gz lua-ad0704e40cc7b3135fedc6d40a522addb039e090.tar.bz2 lua-ad0704e40cc7b3135fedc6d40a522addb039e090.zip | |
back to 'CallInfo' (no gains with its removal)
Diffstat (limited to 'lobject.h')
| -rw-r--r-- | lobject.h | 32 |
1 files changed, 1 insertions, 31 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.128 2017/11/03 17:22:54 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.125 2017/06/29 15:06:44 roberto Exp $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -311,39 +311,9 @@ typedef struct TValue { | |||
| 311 | 311 | ||
| 312 | typedef union StackValue { | 312 | typedef union StackValue { |
| 313 | TValue val; | 313 | TValue val; |
| 314 | struct { | ||
| 315 | TValuefields; | ||
| 316 | lu_byte callstatus_; | ||
| 317 | char nresults; /* expected number of results from this function */ | ||
| 318 | union { | ||
| 319 | unsigned char funcidx; /* called-function index */ | ||
| 320 | unsigned char nyield; /* number of values yielded */ | ||
| 321 | } u2; | ||
| 322 | unsigned short previous; /* difference to previous 'func' */ | ||
| 323 | unsigned short framesize; /* stack space available for this function */ | ||
| 324 | union { | ||
| 325 | struct { /* only for Lua functions */ | ||
| 326 | const Instruction *savedpc; | ||
| 327 | } l; | ||
| 328 | struct { /* only for C functions */ | ||
| 329 | lua_KFunction k; /* continuation in case of yields */ | ||
| 330 | int old_errfunc; | ||
| 331 | int ctx; /* context info. in case of yields */ | ||
| 332 | } c; | ||
| 333 | } u; | ||
| 334 | } stkci; | ||
| 335 | } StackValue; | 314 | } StackValue; |
| 336 | 315 | ||
| 337 | 316 | ||
| 338 | #define callstatus(ar) ((ar)->stkci.callstatus_) | ||
| 339 | |||
| 340 | /* top of a function (first element after its frame) */ | ||
| 341 | #define functop(func) ((func) + (func)->stkci.framesize) | ||
| 342 | |||
| 343 | /* set top of a function to a specific value */ | ||
| 344 | #define setfunctop(func,v) ((func)->stkci.framesize = (v) - (func)) | ||
| 345 | |||
| 346 | |||
| 347 | typedef StackValue *StkId; /* index to stack elements */ | 317 | typedef StackValue *StkId; /* index to stack elements */ |
| 348 | 318 | ||
| 349 | /* convert a 'StackValue' to a 'TValue' */ | 319 | /* convert a 'StackValue' to a 'TValue' */ |
