The Battle for Wesnoth  1.15.1+dev
Macros | Functions
lvm.h File Reference
#include "ldo.h"
#include "lobject.h"
#include "ltm.h"
Include dependency graph for lvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define cvt2str(o)   ttisnumber(o)
 
#define cvt2num(o)   ttisstring(o)
 
#define LUA_FLOORN2I   0
 
#define tonumber(o, n)   (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))
 
#define tointeger(o, i)   (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I))
 
#define intop(op, v1, v2)   l_castU2S(l_castS2U(v1) op l_castS2U(v2))
 
#define luaV_rawequalobj(t1, t2)   luaV_equalobj(NULL,t1,t2)
 
#define luaV_fastget(L, t, k, slot, f)
 
#define luaV_gettable(L, t, k, v)
 
#define luaV_fastset(L, t, k, slot, f, v)
 
#define luaV_settable(L, t, k, v)
 

Functions

LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2)
 
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r)
 
LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r)
 
LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n)
 
LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode)
 
LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
 
LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
 
LUAI_FUNC void luaV_finishOp (lua_State *L)
 
LUAI_FUNC void luaV_execute (lua_State *L)
 
LUAI_FUNC void luaV_concat (lua_State *L, int total)
 
LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y)
 
LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y)
 
LUAI_FUNC lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y)
 
LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb)
 

Macro Definition Documentation

◆ cvt2num

#define cvt2num (   o)    ttisstring(o)

Definition at line 24 of file lvm.h.

Referenced by luaV_tointeger(), and luaV_tonumber_().

◆ cvt2str

#define cvt2str (   o)    ttisnumber(o)

Definition at line 17 of file lvm.h.

Referenced by lua_isstring(), lua_tolstring(), luaG_concaterror(), and luaV_concat().

◆ intop

#define intop (   op,
  v1,
  v2 
)    l_castU2S(l_castS2U(v1) op l_castS2U(v2))

Definition at line 46 of file lvm.h.

Referenced by intarith(), luaV_div(), luaV_execute(), and luaV_shiftl().

◆ LUA_FLOORN2I

#define LUA_FLOORN2I   0

Definition at line 36 of file lvm.h.

◆ luaV_fastget

#define luaV_fastget (   L,
  t,
  k,
  slot,
  f 
)
Value:
? (slot = NULL, 0) /* not a table; 'slot' is NULL and result is 0 */ \
: (slot = f(hvalue(t), k), /* else, do raw access */ \
!ttisnil(slot))) /* result not nil? */
#define ttistable(o)
Definition: lobject.h:151
#define ttisnil(o)
Definition: lobject.h:145
#define f
double t
Definition: astarsearch.cpp:64
#define hvalue(o)
Definition: lobject.h:175

Definition at line 58 of file lvm.h.

Referenced by auxgetstr(), lua_geti(), luaV_execute(), and luaV_finishget().

◆ luaV_fastset

#define luaV_fastset (   L,
  t,
  k,
  slot,
  f,
 
)
Value:
? (slot = NULL, 0) \
: (slot = f(hvalue(t), k), \
ttisnil(slot) ? 0 \
: (luaC_barrierback(L, hvalue(t), v), \
setobj2t(L, cast(TValue *,slot), v), \
1)))
#define ttistable(o)
Definition: lobject.h:151
#define cast(t, exp)
Definition: llimits.h:111
#define luaC_barrierback(L, p, v)
Definition: lgc.h:122
#define f
double t
Definition: astarsearch.cpp:64
#define hvalue(o)
Definition: lobject.h:175

Definition at line 80 of file lvm.h.

Referenced by auxsetstr(), lua_seti(), and luaV_finishset().

◆ luaV_gettable

#define luaV_gettable (   L,
  t,
  k,
 
)
Value:
{ const TValue *slot; \
if (luaV_fastget(L,t,k,slot,luaH_get)) { setobj2s(L, v, slot); } \
else luaV_finishget(L,t,k,v,slot); }
LUAI_FUNC void luaV_finishget(lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
Definition: lvm.cpp:160
#define luaV_fastget(L, t, k, slot, f)
Definition: lvm.h:58
const TValue * luaH_get(Table *t, const TValue *key)
Definition: ltable.cpp:589
#define setobj2s
Definition: lobject.h:271
double t
Definition: astarsearch.cpp:64

Definition at line 67 of file lvm.h.

Referenced by lua_gettable().

◆ luaV_rawequalobj

#define luaV_rawequalobj (   t1,
  t2 
)    luaV_equalobj(NULL,t1,t2)

Definition at line 48 of file lvm.h.

Referenced by addk(), findindex(), getgeneric(), and lua_rawequal().

◆ luaV_settable

#define luaV_settable (   L,
  t,
  k,
 
)
Value:
{ const TValue *slot; \
if (!luaV_fastset(L,t,k,slot,luaH_get,v)) \
luaV_finishset(L,t,k,v,slot); }
const TValue * luaH_get(Table *t, const TValue *key)
Definition: ltable.cpp:589
double t
Definition: astarsearch.cpp:64
#define luaV_fastset(L, t, k, slot, f, v)
Definition: lvm.h:80

Definition at line 90 of file lvm.h.

Referenced by lua_settable().

◆ tointeger

#define tointeger (   o,
  i 
)    (ttisinteger(o) ? (*(i) = ivalue(o), 1) : luaV_tointeger(o,i,LUA_FLOORN2I))

Definition at line 43 of file lvm.h.

Referenced by lua_tointegerx(), luaG_tointerror(), luaO_arith(), luaV_equalobj(), luaV_execute(), and validop().

◆ tonumber

#define tonumber (   o,
  n 
)    (ttisfloat(o) ? (*(n) = fltvalue(o), 1) : luaV_tonumber_(o,n))

Function Documentation

◆ luaV_concat()

LUAI_FUNC void luaV_concat ( lua_State L,
int  total 
)

◆ luaV_div()

LUAI_FUNC lua_Integer luaV_div ( lua_State L,
lua_Integer  x,
lua_Integer  y 
)

Definition at line 552 of file lvm.cpp.

References intop, l_castS2U, luaG_runerror(), and n.

Referenced by intarith(), and luaV_execute().

◆ luaV_equalobj()

LUAI_FUNC int luaV_equalobj ( lua_State L,
const TValue t1,
const TValue t2 
)

◆ luaV_execute()

LUAI_FUNC void luaV_execute ( lua_State L)

Definition at line 786 of file lvm.cpp.

References b, c, CallInfo::callstatus, cast_int, checkGC, chgfltvalue, chgivalue, lua_State::ci, CIST_FRESH, CIST_TAIL, clLvalue, dojump, donextjump, fltvalue, forlimit(), CallInfo::func, GET_OPCODE, GETARG_A, GETARG_Ax, GETARG_B, GETARG_Bx, GETARG_C, GETARG_sBx, getcached(), getproto, gettableProtected, h, hvalue, i, utils::detail::init, intop, isLua, ivalue, Proto::k, CallInfo::l, l_castS2U, l_isfalse, LFIELDS_PER_FLUSH, lua_assert, LUA_MULTRET, luaC_barrierback, luaC_upvalbarrier, luaD_call(), luaD_checkstack, luaD_poscall(), luaD_precall(), luaF_close(), luaG_runerror(), luaH_getstr(), luaH_new(), luaH_resize(), luaH_resizearray(), luaH_setint(), luai_numadd, luai_numdiv, luai_numidiv, luai_numle, luai_numlt, luai_nummod, luai_nummul, luai_numpow, luai_numsub, luai_numunm, luaO_fb2int(), luaT_trybinTM(), luaV_concat(), luaV_div(), luaV_equalobj(), luaV_fastget, luaV_finishget(), luaV_lessequal(), luaV_lessthan(), luaV_mod(), luaV_objlen(), luaV_shiftl(), n, Proto::numparams, OP_ADD, OP_BAND, OP_BNOT, OP_BOR, OP_BXOR, OP_CALL, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_EQ, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_IDIV, 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_SHL, OP_SHR, OP_SUB, OP_TAILCALL, OP_TEST, OP_TESTSET, OP_TFORCALL, OP_TFORLOOP, OP_UNM, OP_VARARG, p, Proto::p, LClosure::p, CallInfo::previous, Protect, pushclosure(), RA, RB, RKB, RKC, setbvalue, setclLvalue, setfltvalue, sethvalue, setivalue, setnilvalue, setobj, setobj2s, setobjs2s, settableProtected, Table::sizearray, Proto::sizep, t, TM_ADD, TM_BAND, TM_BNOT, TM_BOR, TM_BXOR, TM_DIV, TM_IDIV, TM_MOD, TM_MUL, TM_POW, TM_SHL, TM_SHR, TM_SUB, TM_UNM, tointeger, tonumber, CallInfo::top, lua_State::top, tsvalue, ttisinteger, ttisnil, CallInfo::u, LClosure::upvals, UpVal::v, vmbreak, vmcase, vmdispatch, and vmfetch.

Referenced by luaD_call(), resume(), and unroll().

◆ luaV_finishget()

LUAI_FUNC void luaV_finishget ( lua_State L,
const TValue t,
TValue key,
StkId  val,
const TValue slot 
)

◆ luaV_finishOp()

LUAI_FUNC void luaV_finishOp ( lua_State L)

◆ luaV_finishset()

LUAI_FUNC void luaV_finishset ( lua_State L,
const TValue t,
TValue key,
StkId  val,
const TValue slot 
)

◆ luaV_lessequal()

LUAI_FUNC int luaV_lessequal ( lua_State L,
const TValue l,
const TValue r 
)

◆ luaV_lessthan()

LUAI_FUNC int luaV_lessthan ( lua_State L,
const TValue l,
const TValue r 
)

Definition at line 364 of file lvm.cpp.

References l_strcmp(), LTnum(), luaG_ordererror(), luaT_callorderTM(), TM_LT, tsvalue, ttisnumber, and ttisstring.

Referenced by lua_compare(), and luaV_execute().

◆ luaV_mod()

LUAI_FUNC lua_Integer luaV_mod ( lua_State L,
lua_Integer  x,
lua_Integer  y 
)

Definition at line 572 of file lvm.cpp.

References l_castS2U, luaG_runerror(), and n.

Referenced by intarith(), and luaV_execute().

◆ luaV_objlen()

LUAI_FUNC void luaV_objlen ( lua_State L,
StkId  ra,
const TValue rb 
)

◆ luaV_shiftl()

LUAI_FUNC lua_Integer luaV_shiftl ( lua_Integer  x,
lua_Integer  y 
)

Definition at line 593 of file lvm.cpp.

References intop, and NBITS.

Referenced by intarith(), and luaV_execute().

◆ luaV_tointeger()

LUAI_FUNC int luaV_tointeger ( const TValue obj,
lua_Integer p,
int  mode 
)

Definition at line 94 of file lvm.cpp.

References cvt2num, f, fltvalue, ivalue, l_floor, lua_numbertointeger, luaO_str2num(), n, svalue, ttisfloat, ttisinteger, and vslen.

Referenced by forlimit(), luaH_get(), and luaH_newkey().

◆ luaV_tonumber_()

LUAI_FUNC int luaV_tonumber_ ( const TValue obj,
lua_Number n 
)

Definition at line 72 of file lvm.cpp.

References cast_num, cvt2num, ivalue, luaO_str2num(), nvalue, svalue, ttisinteger, and vslen.