#include "lobject.h"
#include "lstate.h"
#include "lzio.h"
Go to the source code of this file.
Defines | |
#define | condhardstacktests(x) { /* empty */ } |
#define | luaD_checkstack(L, n) |
#define | incr_top(L) {luaD_checkstack(L,1); L->top++;} |
#define | savestack(L, p) ((char *)(p) - (char *)L->stack) |
#define | restorestack(L, n) ((TObject *)((char *)L->stack + (n))) |
#define | saveci(L, p) ((char *)(p) - (char *)L->base_ci) |
#define | restoreci(L, n) ((CallInfo *)((char *)L->base_ci + (n))) |
Typedefs | |
typedef void(*) | Pfunc (lua_State *L, void *ud) |
Functions | |
void | luaD_resetprotection (lua_State *L) |
int | luaD_protectedparser (lua_State *L, ZIO *z, int bin) |
void | luaD_callhook (lua_State *L, int event, int line) |
StkId | luaD_precall (lua_State *L, StkId func) |
void | luaD_call (lua_State *L, StkId func, int nResults) |
int | luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef) |
void | luaD_poscall (lua_State *L, int wanted, StkId firstResult) |
void | luaD_reallocCI (lua_State *L, int newsize) |
void | luaD_reallocstack (lua_State *L, int newsize) |
void | luaD_growstack (lua_State *L, int n) |
void | luaD_throw (lua_State *L, int errcode) |
int | luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) |
#define condhardstacktests | ( | x | ) | { /* empty */ } |
#define incr_top | ( | L | ) | {luaD_checkstack(L,1); L->top++;} |
Definition at line 32 of file ldo.h.
Referenced by adjust_varargs(), f_Ccall(), f_parser(), lua_getinfo(), luaA_pushobject(), luaG_errormsg(), luaO_pushvfstring(), pushstr(), resume_error(), and tryfuncTM().
#define luaD_checkstack | ( | L, | |||
n | ) |
Value:
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \ luaD_growstack(L, n); \ else condhardstacktests(luaD_reallocstack(L, L->stacksize));
Definition at line 26 of file ldo.h.
Referenced by adjust_varargs(), callTM(), callTMres(), lua_checkstack(), lua_pushupvalues(), luaD_callhook(), and luaD_precall().
#define restoreci | ( | L, | |||
n | ) | ((CallInfo *)((char *)L->base_ci + (n))) |
#define restorestack | ( | L, | |||
n | ) | ((TObject *)((char *)L->stack + (n))) |
Definition at line 35 of file ldo.h.
Referenced by Arith(), call_binTM(), callrethooks(), luaD_callhook(), luaD_pcall(), luaD_precall(), luaD_protectedparser(), luaG_errormsg(), and tryfuncTM().
#define saveci | ( | L, | |||
p | ) | ((char *)(p) - (char *)L->base_ci) |
#define savestack | ( | L, | |||
p | ) | ((char *)(p) - (char *)L->stack) |
Definition at line 34 of file ldo.h.
Referenced by Arith(), call_binTM(), callrethooks(), lua_cpcall(), lua_pcall(), luaD_callhook(), luaD_precall(), luaD_protectedparser(), and tryfuncTM().
Definition at line 318 of file ldo.c.
References lua_State::ci, CI_CALLING, lua_assert, LUA_MAXCCALLS, luaC_checkGC, luaD_poscall(), luaD_precall(), luaD_throw(), luaG_runerror(), luaV_execute(), lua_State::nCcalls, and CallInfo::state.
Referenced by callTM(), callTMres(), do1gcTM(), f_call(), f_Ccall(), lua_call(), and luaG_errormsg().
void luaD_callhook | ( | lua_State * | L, | |
int | event, | |||
int | line | |||
) |
Definition at line 165 of file ldo.c.
References lua_State::allowhook, ar, lua_State::base_ci, lua_State::ci, lua_State::hook, lua_assert, lua_lock, lua_unlock, luaD_checkstack, restorestack, savestack, CallInfo::top, and lua_State::top.
Referenced by callrethooks(), luaD_precall(), luaV_execute(), and traceexec().
void luaD_growstack | ( | lua_State * | L, | |
int | n | |||
) |
Definition at line 144 of file ldo.c.
References EXTRA_STACK, luaD_reallocstack(), and lua_State::stacksize.
Definition at line 432 of file ldo.c.
References lua_State::allowhook, CallInfo::base, lua_State::base, lua_State::ci, lua_State::errfunc, luaD_rawrunprotected(), luaF_close(), lua_State::nCcalls, restore_stack_limit(), restoreci, restorestack, saveci, seterrorobj(), and lua_longjmp::status.
Referenced by lua_cpcall(), and lua_pcall().
Definition at line 294 of file ldo.c.
References CallInfo::base, lua_State::base, callrethooks(), lua_State::ci, lua_State::hookmask, setnilvalue, setobjs2s, and lua_State::top.
Referenced by luaD_call(), and resume().
Definition at line 234 of file ldo.c.
References adjust_varargs(), CallInfo::base, lua_State::base, lua_State::ci, CI_C, CI_SAVEDPC, clvalue, Proto::code, condhardstacktests, lua_State::end_ci, lua_State::hookmask, Proto::is_vararg, LClosure::isC, CallInfo::l, lua_lock, lua_pushupvalues(), lua_unlock, luaD_callhook(), luaD_checkstack, luaD_growCI(), luaD_reallocCI(), Proto::maxstacksize, Proto::numparams, LClosure::p, restorestack, savestack, setnilvalue, lua_State::size_ci, CallInfo::state, lua_State::top, CallInfo::top, tryfuncTM(), ttisfunction, and CallInfo::u.
Referenced by luaD_call(), and resume().
Definition at line 482 of file ldo.c.
References SParser::bin, SParser::buff, f_parser(), luaD_rawrunprotected(), luaZ_freebuffer, luaZ_initbuffer, restorestack, savestack, seterrorobj(), lua_State::top, and SParser::z.
Referenced by lua_load().
Definition at line 84 of file ldo.c.
References lua_longjmp::b, lua_State::errorJmp, lua_longjmp::previous, and lua_longjmp::status.
Referenced by lua_close(), lua_open(), lua_resume(), luaD_pcall(), and luaD_protectedparser().
void luaD_reallocCI | ( | lua_State * | L, | |
int | newsize | |||
) |
Definition at line 135 of file ldo.c.
References lua_State::base_ci, cast, lua_State::ci, lua_State::end_ci, luaM_reallocvector, and lua_State::size_ci.
Referenced by checkstacksizes(), luaD_growCI(), luaD_precall(), and restore_stack_limit().
void luaD_reallocstack | ( | lua_State * | L, | |
int | newsize | |||
) |
Definition at line 126 of file ldo.c.
References correctstack(), EXTRA_STACK, luaM_reallocvector, lua_State::stack, lua_State::stack_last, and lua_State::stacksize.
Referenced by checkstacksizes(), and luaD_growstack().
void luaD_resetprotection | ( | lua_State * | L | ) |
void luaD_throw | ( | lua_State * | L, | |
int | errcode | |||
) |
Definition at line 72 of file ldo.c.
References lua_longjmp::b, lua_State::errorJmp, EXIT_FAILURE, G, and lua_longjmp::status.
Referenced by f_luaopen(), luaD_call(), luaD_growCI(), luaG_errormsg(), luaM_realloc(), and luaX_errorline().