#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include "lvm.h"
Go to the source code of this file.
Macros | |
#define | lvm_c |
#define | LUA_CORE |
#define | MAXTAGLOOP 100 |
#define | luai_runtimecheck(L, c) /* void */ |
#define | RA(i) (base+GETARG_A(i)) |
#define | RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) |
#define | RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) |
#define | RKB(i) |
#define | RKC(i) |
#define | KBx(i) (k + (GETARG_Bx(i) != 0 ? GETARG_Bx(i) - 1 : GETARG_Ax(*ci->u.l.savedpc++))) |
#define | dojump(ci, i, e) |
#define | donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); } |
#define | Protect(x) { {x;}; base = ci->u.l.base; } |
#define | checkGC(L, c) |
#define | arith_op(op, tm) |
#define | vmdispatch(o) switch(o) |
#define | vmcase(l, b) case l: {b} break; |
#define | vmcasenb(l, b) case l: {b} /* nb = no break */ |
#define arith_op | ( | op, | |
tm | |||
) |
Definition at line 520 of file lvm.cpp.
Referenced by luaV_execute().
#define checkGC | ( | L, | |
c | |||
) |
Definition at line 513 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 508 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 485 of file lvm.cpp.
Referenced by luaV_execute().
#define MAXTAGLOOP 100 |
Definition at line 31 of file lvm.cpp.
Referenced by luaV_gettable(), and luaV_settable().
Definition at line 511 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 489 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 491 of file lvm.cpp.
Referenced by luaV_execute().
#define RKB | ( | i | ) |
Definition at line 493 of file lvm.cpp.
Referenced by luaV_execute().
#define RKC | ( | i | ) |
Definition at line 495 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 531 of file lvm.cpp.
Referenced by luaV_execute().
Definition at line 532 of file lvm.cpp.
Referenced by luaV_execute().
#define vmdispatch | ( | o | ) | switch(o) |
Definition at line 530 of file lvm.cpp.
Referenced by luaV_execute().
|
static |
Definition at line 174 of file lvm.cpp.
References callTM(), luaT_gettmbyobj(), and ttisnil.
Referenced by call_orderTM(), luaV_arith(), and luaV_concat().
Definition at line 199 of file lvm.cpp.
References call_binTM(), l_isfalse, and lua_State::top.
Referenced by luaV_lessequal(), and luaV_lessthan().
|
static |
Definition at line 92 of file lvm.cpp.
References lua_State::ci, isLua, luaD_call(), restorestack, savestack, setobj2s, setobjs2s, and lua_State::top.
Referenced by call_binTM(), luaV_equalobj_(), luaV_gettable(), luaV_objlen(), and luaV_settable().
Definition at line 185 of file lvm.cpp.
References fasttm, and luaV_rawequalobj.
Referenced by luaV_equalobj_().
Definition at line 379 of file lvm.cpp.
References c, Proto::cache, i, Upvaldesc::idx, Upvaldesc::instack, Closure::l, Proto::sizeupvalues, LClosure::upvals, Proto::upvalues, and UpVal::v.
Referenced by luaV_execute().
Definition at line 208 of file lvm.cpp.
References getstr, TString::len, and TString::tsv.
Referenced by luaV_lessequal(), and luaV_lessthan().
Definition at line 360 of file lvm.cpp.
References c, call_binTM(), LUA_OPADD, luaG_aritherror(), luaO_arith(), luaV_tonumber(), nvalue, setnvalue, and TM_ADD.
Referenced by lua_arith(), and luaV_execute().
Definition at line 293 of file lvm.cpp.
References call_binTM(), G, i, lua_assert, luaG_concaterror(), luaG_runerror(), luaS_newlstr(), luaZ_openspace(), MAX_SIZET, setobjs2s, setsvalue2s, svalue, TM_CONCAT, lua_State::top, tostring, tsvalue, ttisnumber, and ttisstring.
Referenced by lua_concat(), luaO_pushvfstring(), luaV_execute(), and luaV_finishOp().
Definition at line 260 of file lvm.cpp.
References bvalue, callTM(), eqshrstr, fvalue, gcvalue, get_equalTM(), hvalue, iscollectable, l_isfalse, lua_assert, LUA_TBOOLEAN, LUA_TLCF, LUA_TLIGHTUSERDATA, LUA_TLNGSTR, LUA_TNIL, LUA_TNUMBER, LUA_TSHRSTR, LUA_TTABLE, LUA_TUSERDATA, luaS_eqlngstr(), nvalue, pvalue, rawtsvalue, TM_EQ, lua_State::top, ttisequal, ttype, and uvalue.
Definition at line 534 of file lvm.cpp.
References arith_op, CallInfo::callstatus, cast_int, checkGC, lua_State::ci, CIST_REENTRY, CIST_TAIL, clLvalue, dojump, donextjump, equalobj, CallInfo::func, GET_OPCODE, GETARG_A, GETARG_Ax, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getcached(), getproto, h, lua_State::hookcount, lua_State::hookmask, hvalue, i, ai::registry::init(), isLua, Proto::k, CallInfo::l, l_isfalse, LFIELDS_PER_FLUSH, lua_assert, LUA_MASKCOUNT, LUA_MASKLINE, LUA_MULTRET, LUA_QL, luaC_barrier, luaC_barrierback, luaD_call(), luaD_checkstack, luaD_poscall(), luaD_precall(), luaF_close(), luaG_runerror(), luaH_new(), luaH_resize(), luaH_resizearray(), luaH_setint(), luai_runtimecheck, luaO_fb2int(), luaV_arith(), luaV_concat(), luaV_gettable(), luaV_lessequal(), luaV_lessthan(), luaV_objlen(), luaV_settable(), Proto::numparams, nvalue, obj2gco, OP_ADD, OP_CALL, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_JMP, OP_LE, OP_LEN, OP_LOADBOOL, OP_LOADK, OP_LOADKX, OP_LOADNIL, OP_LT, OP_MOD, OP_MOVE, OP_MUL, OP_NEWTABLE, OP_NOT, OP_POW, OP_RETURN, OP_SELF, OP_SETLIST, OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORCALL, OP_TFORLOOP, OP_UNM, OP_VARARG, Proto::p, LClosure::p, CallInfo::previous, Protect, pushclosure(), RA, RB, RKB, RKC, setbvalue, setclLvalue, sethvalue, setnilvalue, setnvalue, setobj, setobj2s, setobjs2s, Table::sizearray, Proto::sizep, lua_State::stack, lua_State::stacksize, TM_ADD, TM_DIV, TM_MOD, TM_MUL, TM_POW, TM_SUB, TM_UNM, tonumber, CallInfo::top, lua_State::top, traceexec(), ttisnil, ttisnumber, ttistable, CallInfo::u, LClosure::upvals, UpVal::v, vmcase, vmcasenb, and vmdispatch.
Referenced by luaD_call(), resume(), and unroll().
Definition at line 423 of file lvm.cpp.
References cast_int, lua_State::ci, GET_OPCODE, GETARG_A, GETARG_B, GETARG_C, ISK, CallInfo::l, l_isfalse, lua_assert, luaT_gettmbyobj(), luaV_concat(), OP_ADD, OP_CALL, OP_CONCAT, OP_DIV, OP_EQ, OP_GETTABLE, OP_GETTABUP, OP_JMP, OP_LE, OP_LEN, OP_LT, OP_MOD, OP_MUL, OP_POW, OP_SELF, OP_SETTABLE, OP_SETTABUP, OP_SUB, OP_TAILCALL, OP_TFORCALL, OP_TFORLOOP, OP_UNM, setobj2s, setobjs2s, TM_LE, CallInfo::top, lua_State::top, ttisnil, and CallInfo::u.
Referenced by unroll().
Definition at line 109 of file lvm.cpp.
References callTM(), fasttm, hvalue, luaG_runerror(), luaG_typeerror(), luaH_get(), luaT_gettmbyobj(), MAXTAGLOOP, Table::metatable, setobj2s, TM_INDEX, ttisfunction, ttisnil, and ttistable.
Referenced by lua_getfield(), lua_getglobal(), lua_gettable(), and luaV_execute().
Definition at line 243 of file lvm.cpp.
References call_orderTM(), l_strcmp(), luaG_ordererror(), nvalue, rawtsvalue, TM_LE, TM_LT, ttisnumber, and ttisstring.
Referenced by lua_compare(), and luaV_execute().
Definition at line 231 of file lvm.cpp.
References call_orderTM(), l_strcmp(), luaG_ordererror(), nvalue, rawtsvalue, TM_LT, ttisnumber, and ttisstring.
Referenced by lua_compare(), and luaV_execute().
Definition at line 335 of file lvm.cpp.
References callTM(), cast_num, fasttm, hvalue, LUA_TSTRING, LUA_TTABLE, luaG_typeerror(), luaH_getn(), luaT_gettmbyobj(), Table::metatable, setnvalue, TM_LEN, tsvalue, ttisnil, and ttypenv.
Referenced by lua_len(), and luaV_execute().
Definition at line 135 of file lvm.cpp.
References callTM(), cast, fasttm, hvalue, invalidateTMcache, luaC_barrierback, luaG_runerror(), luaG_typeerror(), luaH_get(), luaH_newkey(), luaO_nilobject, luaT_gettmbyobj(), MAXTAGLOOP, Table::metatable, obj2gco, setobj2t, TM_NEWINDEX, ttisfunction, ttisnil, and ttistable.
Referenced by lua_setfield(), lua_setglobal(), lua_settable(), and luaV_execute().
Definition at line 34 of file lvm.cpp.
References luaO_str2d(), setnvalue, svalue, tsvalue, ttisnumber, and ttisstring.
Referenced by luaG_aritherror(), and luaV_arith().
Definition at line 46 of file lvm.cpp.
References lua_number2str, LUAI_MAXNUMBER2STR, luaS_newlstr(), nvalue, setsvalue2s, and ttisnumber.
Referenced by lua_tolstring().
Definition at line 401 of file lvm.cpp.
References Proto::cache, i, Upvaldesc::idx, Closure::l, luaC_barrierproto, luaF_findupval(), luaF_newLclosure(), LClosure::p, setclLvalue, Proto::sizeupvalues, LClosure::upvals, and Proto::upvalues.
Referenced by luaV_execute().
Definition at line 59 of file lvm.cpp.
References CallInfo::callstatus, lua_State::ci, ci_func, CIST_HOOKYIELD, CallInfo::func, getfuncline, lua_State::hookcount, lua_State::hookmask, CallInfo::l, LUA_HOOKCOUNT, LUA_HOOKLINE, LUA_MASKCOUNT, LUA_MASKLINE, LUA_YIELD, luaD_hook(), luaD_throw(), lua_State::oldpc, pcRel, resethookcount, lua_State::status, lua_State::top, and CallInfo::u.
Referenced by luaV_execute().