#include "lobject.h"#include "lstate.h"#include "lzio.h"Go to the source code of this file.
Defines | |
| #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) ((TValue *)((char *)L->stack + (n))) |
| #define | saveci(L, p) ((char *)(p) - (char *)L->base_ci) |
| #define | restoreci(L, n) ((CallInfo *)((char *)L->base_ci + (n))) |
| #define | PCRLUA 0 |
| #define | PCRC 1 |
| #define | PCRYIELD 2 |
Typedefs | |
| typedef void(* | Pfunc )(lua_State *L, void *ud) |
Functions | |
| LUAI_FUNC int | luaD_protectedparser (lua_State *L, ZIO *z, const char *name) |
| LUAI_FUNC void | luaD_callhook (lua_State *L, int event, int line) |
| LUAI_FUNC int | luaD_precall (lua_State *L, StkId func, int nresults) |
| LUAI_FUNC void | luaD_call (lua_State *L, StkId func, int nResults) |
| LUAI_FUNC int | luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef) |
| LUAI_FUNC int | luaD_poscall (lua_State *L, StkId firstResult) |
| LUAI_FUNC void | luaD_reallocCI (lua_State *L, int newsize) |
| LUAI_FUNC void | luaD_reallocstack (lua_State *L, int newsize) |
| LUAI_FUNC void | luaD_growstack (lua_State *L, int n) |
| LUAI_FUNC void | luaD_throw (lua_State *L, int errcode) |
| LUAI_FUNC int | luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) |
| LUAI_FUNC void | luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) |
| #define incr_top | ( | L | ) | {luaD_checkstack(L,1); L->top++;} |
Definition at line 22 of file ldo.h.
Referenced by collectvalidlines(), combine(), f_parser(), LoadFunction(), lua_getinfo(), luaG_errormsg(), luaO_pushvfstring(), open_func(), pushstr(), resume_error(), and tryfuncTM().
| #define luaD_checkstack | ( | L, | |||
| n | ) |
Value:
if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ luaD_growstack(L, n); \ else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
Definition at line 16 of file ldo.h.
Referenced by callTM(), callTMres(), lua_checkstack(), luaD_callhook(), and luaD_precall().
| #define PCRC 1 |
| #define PCRLUA 0 |
| #define PCRYIELD 2 |
Definition at line 25 of file ldo.h.
Referenced by callrethooks(), callTMres(), luaD_callhook(), luaD_pcall(), luaD_precall(), luaG_errormsg(), and tryfuncTM().
Definition at line 24 of file ldo.h.
Referenced by callrethooks(), callTMres(), lua_cpcall(), lua_pcall(), luaD_callhook(), luaD_precall(), luaD_protectedparser(), and tryfuncTM().
Definition at line 369 of file ldo.cpp.
References LUA_ERRERR, luaC_checkGC, luaD_precall(), luaD_throw(), luaG_runerror(), LUAI_MAXCCALLS, luaV_execute(), lua_State::nCcalls, and PCRLUA.
| LUAI_FUNC void luaD_callhook | ( | lua_State * | L, | |
| int | event, | |||
| int | line | |||
| ) |
Definition at line 181 of file ldo.cpp.
References lua_State::allowhook, lua_State::base_ci, cast_int, lua_State::ci, lua_Debug::currentline, lua_Debug::event, lua_State::hook, lua_Debug::i_ci, lua_assert, LUA_HOOKTAILRET, lua_lock, LUA_MINSTACK, lua_unlock, luaD_checkstack, restorestack, savestack, lua_State::stack_last, CallInfo::top, and lua_State::top.
| LUAI_FUNC void luaD_growstack | ( | lua_State * | L, | |
| int | n | |||
| ) |
Definition at line 453 of file ldo.cpp.
References lua_State::allowhook, CallInfo::base, lua_State::base, lua_State::ci, lua_State::errfunc, luaD_rawrunprotected(), luaD_seterrorobj(), luaF_close(), lua_State::nCcalls, restore_stack_limit(), restoreci, restorestack, saveci, CallInfo::savedpc, lua_State::savedpc, and lua_longjmp::status.
Definition at line 342 of file ldo.cpp.
References lua_State::base, callrethooks(), lua_State::ci, CallInfo::func, lua_State::hookmask, LUA_MASKRET, LUA_MULTRET, CallInfo::nresults, lua_State::savedpc, setnilvalue, setobjs2s, and lua_State::top.
Definition at line 264 of file ldo.cpp.
References adjust_varargs(), CallInfo::base, lua_State::base, cast_int, lua_State::ci, clvalue, Proto::code, curr_func, CallInfo::func, lua_State::hookmask, inc_ci, Proto::is_vararg, lua_assert, LUA_HOOKCALL, lua_lock, LUA_MASKCALL, LUA_MINSTACK, lua_unlock, luaD_callhook(), luaD_checkstack, luaD_poscall(), Proto::maxstacksize, CallInfo::nresults, Proto::numparams, LClosure::p, PCRC, PCRLUA, PCRYIELD, restorestack, lua_State::savedpc, CallInfo::savedpc, savestack, setnilvalue, lua_State::stack_last, CallInfo::tailcalls, CallInfo::top, lua_State::top, tryfuncTM(), and ttisfunction.
Definition at line 506 of file ldo.cpp.
References SParser::buff, lua_State::errfunc, f_parser(), luaD_pcall(), luaZ_freebuffer, luaZ_initbuffer, SParser::name, savestack, lua_State::top, and SParser::z.
Definition at line 111 of file ldo.cpp.
References lua_State::errorJmp, LUAI_TRY, lua_longjmp::previous, and lua_longjmp::status.
| LUAI_FUNC void luaD_reallocCI | ( | lua_State * | L, | |
| int | newsize | |||
| ) |
Definition at line 152 of file ldo.cpp.
References lua_State::base_ci, lua_State::ci, lua_State::end_ci, luaM_reallocvector, and lua_State::size_ci.
| LUAI_FUNC void luaD_reallocstack | ( | lua_State * | L, | |
| int | newsize | |||
| ) |
Definition at line 141 of file ldo.cpp.
References correctstack(), EXTRA_STACK, lua_assert, luaM_reallocvector, lua_State::stack, lua_State::stack_last, and lua_State::stacksize.
Definition at line 51 of file ldo.cpp.
References LUA_ERRERR, LUA_ERRMEM, LUA_ERRRUN, LUA_ERRSYNTAX, luaS_newliteral, MEMERRMSG, setobjs2s, setsvalue2s, and lua_State::top.
| LUAI_FUNC void luaD_throw | ( | lua_State * | L, | |
| int | errcode | |||
| ) |
Definition at line 94 of file ldo.cpp.
References cast_byte, lua_State::errorJmp, G, lua_unlock, LUAI_THROW, panic(), resetstack(), lua_State::status, and lua_longjmp::status.
1.5.3