The Battle for Wesnoth  1.15.12+dev
Macros | Functions
lvm.cpp File Reference
#include "lprefix.h"
#include <float.h>
#include <limits.h>
#include <math.h>
#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"
Include dependency graph for lvm.cpp:

Go to the source code of this file.

Macros

#define lvm_c
 
#define LUA_CORE
 
#define LUA_USE_JUMPTABLE   0
 
#define MAXTAGLOOP   2000
 
#define NBM   (l_floatatt(MANT_DIG))
 
#define l_intfitsf(i)   1
 
#define tostring(L, o)   (ttisstring(o) || (cvt2str(o) && (luaO_tostring(L, o), 1)))
 
#define isemptystr(o)   (ttisshrstring(o) && tsvalue(o)->shrlen == 0)
 
#define NBITS   cast_int(sizeof(lua_Integer) * CHAR_BIT)
 
#define luaV_shiftr(x, y)   luaV_shiftl(x,-(y))
 
#define l_addi(L, a, b)   intop(+, a, b)
 
#define l_subi(L, a, b)   intop(-, a, b)
 
#define l_muli(L, a, b)   intop(*, a, b)
 
#define l_band(a, b)   intop(&, a, b)
 
#define l_bor(a, b)   intop(|, a, b)
 
#define l_bxor(a, b)   intop(^, a, b)
 
#define l_lti(a, b)   (a < b)
 
#define l_lei(a, b)   (a <= b)
 
#define l_gti(a, b)   (a > b)
 
#define l_gei(a, b)   (a >= b)
 
#define op_arithI(L, iop, fop)
 
#define op_arithf_aux(L, v1, v2, fop)
 
#define op_arithf(L, fop)
 
#define op_arithfK(L, fop)
 
#define op_arith_aux(L, v1, v2, iop, fop)
 
#define op_arith(L, iop, fop)
 
#define op_arithK(L, iop, fop)
 
#define op_bitwiseK(L, op)
 
#define op_bitwise(L, op)
 
#define op_order(L, opi, opn, other)
 
#define op_orderI(L, opi, opf, inv, tm)
 
#define RA(i)   (base+GETARG_A(i))
 
#define RB(i)   (base+GETARG_B(i))
 
#define vRB(i)   s2v(RB(i))
 
#define KB(i)   (k+GETARG_B(i))
 
#define RC(i)   (base+GETARG_C(i))
 
#define vRC(i)   s2v(RC(i))
 
#define KC(i)   (k+GETARG_C(i))
 
#define RKC(i)   ((TESTARG_k(i)) ? k + GETARG_C(i) : s2v(base + GETARG_C(i)))
 
#define updatetrap(ci)   (trap = ci->u.l.trap)
 
#define updatebase(ci)   (base = ci->func + 1)
 
#define updatestack(ci)   { if (trap) { updatebase(ci); ra = RA(i); } }
 
#define dojump(ci, i, e)   { pc += GETARG_sJ(i) + e; updatetrap(ci); }
 
#define donextjump(ci)   { Instruction ni = *pc; dojump(ci, ni, 1); }
 
#define docondjump()   if (cond != GETARG_k(i)) pc++; else donextjump(ci);
 
#define savepc(L)   (ci->u.l.savedpc = pc)
 
#define savestate(L, ci)   (savepc(L), L->top = ci->top)
 
#define Protect(exp)   (savestate(L,ci), (exp), updatetrap(ci))
 
#define ProtectNT(exp)   (savepc(L), (exp), updatetrap(ci))
 
#define halfProtect(exp)   (savestate(L,ci), (exp))
 
#define checkGC(L, c)
 
#define vmfetch()
 
#define vmdispatch(o)   switch(o)
 
#define vmcase(l)   case l:
 
#define vmbreak   break
 

Functions

static int l_strton (const TValue *obj, TValue *result)
 
int luaV_tonumber_ (const TValue *obj, lua_Number *n)
 
int luaV_flttointeger (lua_Number n, lua_Integer *p, F2Imod mode)
 
int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode)
 
int luaV_tointeger (const TValue *obj, lua_Integer *p, F2Imod mode)
 
static int forlimit (lua_State *L, lua_Integer init, const TValue *lim, lua_Integer *p, lua_Integer step)
 
static int forprep (lua_State *L, StkId ra)
 
static int floatforloop (StkId ra)
 
void luaV_finishget (lua_State *L, const TValue *t, TValue *key, StkId val, const TValue *slot)
 
void luaV_finishset (lua_State *L, const TValue *t, TValue *key, TValue *val, const TValue *slot)
 
static int l_strcmp (const TString *ls, const TString *rs)
 
static int LTintfloat (lua_Integer i, lua_Number f)
 
static int LEintfloat (lua_Integer i, lua_Number f)
 
static int LTfloatint (lua_Number f, lua_Integer i)
 
static int LEfloatint (lua_Number f, lua_Integer i)
 
static int LTnum (const TValue *l, const TValue *r)
 
static int LEnum (const TValue *l, const TValue *r)
 
static int lessthanothers (lua_State *L, const TValue *l, const TValue *r)
 
int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r)
 
static int lessequalothers (lua_State *L, const TValue *l, const TValue *r)
 
int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r)
 
int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2)
 
static void copy2buff (StkId top, int n, char *buff)
 
void luaV_concat (lua_State *L, int total)
 
void luaV_objlen (lua_State *L, StkId ra, const TValue *rb)
 
lua_Integer luaV_idiv (lua_State *L, lua_Integer m, lua_Integer n)
 
lua_Integer luaV_mod (lua_State *L, lua_Integer m, lua_Integer n)
 
lua_Number luaV_modf (lua_State *L, lua_Number m, lua_Number n)
 
lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y)
 
static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, StkId ra)
 
void luaV_finishOp (lua_State *L)
 
void luaV_execute (lua_State *L, CallInfo *ci)
 

Macro Definition Documentation

◆ checkGC

#define checkGC (   L,
  c 
)
Value:
{ luaC_condGC(L, (savepc(L), L->top = (c)), \
updatetrap(ci)); \
luai_threadyield(L); }
#define luaC_condGC(L, pre, pos)
Definition: lgc.h:157
#define updatetrap(ci)
Definition: lvm.cpp:1046
#define savepc(L)
Definition: lvm.cpp:1075
mock_char c

Definition at line 1101 of file lvm.cpp.

Referenced by luaV_execute().

◆ docondjump

#define docondjump ( )    if (cond != GETARG_k(i)) pc++; else donextjump(ci);

Definition at line 1069 of file lvm.cpp.

Referenced by luaV_execute().

◆ dojump

#define dojump (   ci,
  i,
  e 
)    { pc += GETARG_sJ(i) + e; updatetrap(ci); }

Definition at line 1058 of file lvm.cpp.

Referenced by luaV_execute().

◆ donextjump

#define donextjump (   ci)    { Instruction ni = *pc; dojump(ci, ni, 1); }

Definition at line 1062 of file lvm.cpp.

Referenced by luaV_execute().

◆ halfProtect

#define halfProtect (   exp)    (savestate(L,ci), (exp))

Definition at line 1098 of file lvm.cpp.

Referenced by luaV_execute().

◆ isemptystr

#define isemptystr (   o)    (ttisshrstring(o) && tsvalue(o)->shrlen == 0)

Definition at line 619 of file lvm.cpp.

Referenced by luaV_concat().

◆ KB

#define KB (   i)    (k+GETARG_B(i))

Definition at line 1038 of file lvm.cpp.

Referenced by luaV_execute().

◆ KC

#define KC (   i)    (k+GETARG_C(i))

Definition at line 1041 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_addi

#define l_addi (   L,
  a,
  b 
)    intop(+, a, b)

Definition at line 867 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_band

#define l_band (   a,
  b 
)    intop(&, a, b)

Definition at line 870 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_bor

#define l_bor (   a,
  b 
)    intop(|, a, b)

Definition at line 871 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_bxor

#define l_bxor (   a,
  b 
)    intop(^, a, b)

Definition at line 872 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_gei

#define l_gei (   a,
  b 
)    (a >= b)

Definition at line 877 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_gti

#define l_gti (   a,
  b 
)    (a > b)

Definition at line 876 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_intfitsf

#define l_intfitsf (   i)    1

Definition at line 78 of file lvm.cpp.

Referenced by LEfloatint(), LEintfloat(), LTfloatint(), and LTintfloat().

◆ l_lei

#define l_lei (   a,
  b 
)    (a <= b)

Definition at line 875 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_lti

#define l_lti (   a,
  b 
)    (a < b)

Definition at line 874 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_muli

#define l_muli (   L,
  a,
  b 
)    intop(*, a, b)

Definition at line 869 of file lvm.cpp.

Referenced by luaV_execute().

◆ l_subi

#define l_subi (   L,
  a,
  b 
)    intop(-, a, b)

Definition at line 868 of file lvm.cpp.

Referenced by luaV_execute().

◆ LUA_CORE

#define LUA_CORE

Definition at line 8 of file lvm.cpp.

◆ LUA_USE_JUMPTABLE

#define LUA_USE_JUMPTABLE   0

Definition at line 42 of file lvm.cpp.

◆ luaV_shiftr

#define luaV_shiftr (   x,
 
)    luaV_shiftl(x,-(y))

Definition at line 767 of file lvm.cpp.

Referenced by luaV_execute().

◆ lvm_c

#define lvm_c

Definition at line 7 of file lvm.cpp.

◆ MAXTAGLOOP

#define MAXTAGLOOP   2000

Definition at line 49 of file lvm.cpp.

Referenced by luaV_finishget(), and luaV_finishset().

◆ NBITS

#define NBITS   cast_int(sizeof(lua_Integer) * CHAR_BIT)

Definition at line 762 of file lvm.cpp.

Referenced by luaV_shiftl().

◆ NBM

#define NBM   (l_floatatt(MANT_DIG))

Definition at line 58 of file lvm.cpp.

◆ op_arith

#define op_arith (   L,
  iop,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = vRC(i); \
op_arith_aux(L, v1, v2, iop, fop); }
#define vRB(i)
Definition: lvm.cpp:1037
std::size_t i
Definition: function.cpp:940
#define vRC(i)
Definition: lvm.cpp:1040

Definition at line 941 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_arith_aux

#define op_arith_aux (   L,
  v1,
  v2,
  iop,
  fop 
)
Value:
{ \
if (ttisinteger(v1) && ttisinteger(v2)) { \
lua_Integer i1 = ivalue(v1); lua_Integer i2 = ivalue(v2); \
pc++; setivalue(s2v(ra), iop(L, i1, i2)); \
} \
else op_arithf_aux(L, v1, v2, fop); }
#define ttisinteger(o)
Definition: lobject.h:306
#define s2v(o)
Definition: lobject.h:150
LUA_INTEGER lua_Integer
Definition: lua.h:94
#define ivalue(o)
Definition: lobject.h:311
#define op_arithf_aux(L, v1, v2, fop)
Definition: lvm.cpp:902
#define setivalue(obj, x)
Definition: lobject.h:322

Definition at line 930 of file lvm.cpp.

◆ op_arithf

#define op_arithf (   L,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = vRC(i); \
op_arithf_aux(L, v1, v2, fop); }
#define vRB(i)
Definition: lvm.cpp:1037
std::size_t i
Definition: function.cpp:940
#define vRC(i)
Definition: lvm.cpp:1040

Definition at line 912 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_arithf_aux

#define op_arithf_aux (   L,
  v1,
  v2,
  fop 
)
Value:
{ \
lua_Number n1; lua_Number n2; \
if (tonumberns(v1, n1) && tonumberns(v2, n2)) { \
pc++; setfltvalue(s2v(ra), fop(L, n1, n2)); \
}}
#define s2v(o)
Definition: lobject.h:150
#define tonumberns(o, n)
Definition: lvm.h:56
#define setfltvalue(obj, x)
Definition: lobject.h:316
LUA_NUMBER lua_Number
Definition: lua.h:90

Definition at line 902 of file lvm.cpp.

◆ op_arithfK

#define op_arithfK (   L,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
op_arithf_aux(L, v1, v2, fop); }
#define vRB(i)
Definition: lvm.cpp:1037
#define KC(i)
Definition: lvm.cpp:1041
std::size_t i
Definition: function.cpp:940

Definition at line 921 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_arithI

#define op_arithI (   L,
  iop,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
int imm = GETARG_sC(i); \
if (ttisinteger(v1)) { \
lua_Integer iv1 = ivalue(v1); \
pc++; setivalue(s2v(ra), iop(L, iv1, imm)); \
} \
else if (ttisfloat(v1)) { \
lua_Number nb = fltvalue(v1); \
lua_Number fimm = cast_num(imm); \
pc++; setfltvalue(s2v(ra), fop(L, nb, fimm)); \
}}
#define cast_num(i)
Definition: llimits.h:127
#define ttisfloat(o)
Definition: lobject.h:305
#define vRB(i)
Definition: lvm.cpp:1037
#define ttisinteger(o)
Definition: lobject.h:306
#define s2v(o)
Definition: lobject.h:150
#define fltvalue(o)
Definition: lobject.h:310
#define GETARG_sC(i)
Definition: lopcodes.h:133
#define ivalue(o)
Definition: lobject.h:311
std::size_t i
Definition: function.cpp:940
#define setivalue(obj, x)
Definition: lobject.h:322
#define setfltvalue(obj, x)
Definition: lobject.h:316

Definition at line 884 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_arithK

#define op_arithK (   L,
  iop,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
op_arith_aux(L, v1, v2, iop, fop); }
#define vRB(i)
Definition: lvm.cpp:1037
#define KC(i)
Definition: lvm.cpp:1041
std::size_t i
Definition: function.cpp:940

Definition at line 950 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_bitwise

#define op_bitwise (   L,
  op 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = vRC(i); \
lua_Integer i1; lua_Integer i2; \
if (tointegerns(v1, &i1) && tointegerns(v2, &i2)) { \
pc++; setivalue(s2v(ra), op(i1, i2)); \
}}
#define vRB(i)
Definition: lvm.cpp:1037
#define s2v(o)
Definition: lobject.h:150
#define tointegerns(o, i)
Definition: lvm.h:67
LUA_INTEGER lua_Integer
Definition: lua.h:94
std::size_t i
Definition: function.cpp:940
#define setivalue(obj, x)
Definition: lobject.h:322
#define vRC(i)
Definition: lvm.cpp:1040

Definition at line 972 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_bitwiseK

#define op_bitwiseK (   L,
  op 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
lua_Integer i1; \
lua_Integer i2 = ivalue(v2); \
if (tointegerns(v1, &i1)) { \
pc++; setivalue(s2v(ra), op(i1, i2)); \
}}
#define vRB(i)
Definition: lvm.cpp:1037
#define s2v(o)
Definition: lobject.h:150
#define KC(i)
Definition: lvm.cpp:1041
#define tointegerns(o, i)
Definition: lvm.h:67
#define ivalue(o)
Definition: lobject.h:311
std::size_t i
Definition: function.cpp:940
#define setivalue(obj, x)
Definition: lobject.h:322

Definition at line 959 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_order

#define op_order (   L,
  opi,
  opn,
  other 
)
Value:
{ \
int cond; \
TValue *rb = vRB(i); \
if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \
lua_Integer ia = ivalue(s2v(ra)); \
lua_Integer ib = ivalue(rb); \
cond = opi(ia, ib); \
} \
else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \
cond = opn(s2v(ra), rb); \
Protect(cond = other(L, s2v(ra), rb)); \
docondjump(); }
#define vRB(i)
Definition: lvm.cpp:1037
#define ttisinteger(o)
Definition: lobject.h:306
#define s2v(o)
Definition: lobject.h:150
#define Protect(exp)
Definition: lvm.cpp:1089
#define ivalue(o)
Definition: lobject.h:311
std::size_t i
Definition: function.cpp:940
#define ttisnumber(o)
Definition: lobject.h:304
static int cond(LexState *ls)
Definition: lparser.cpp:1394

Definition at line 986 of file lvm.cpp.

Referenced by luaV_execute().

◆ op_orderI

#define op_orderI (   L,
  opi,
  opf,
  inv,
  tm 
)
Value:
{ \
int cond; \
int im = GETARG_sB(i); \
if (ttisinteger(s2v(ra))) \
cond = opi(ivalue(s2v(ra)), im); \
else if (ttisfloat(s2v(ra))) { \
lua_Number fa = fltvalue(s2v(ra)); \
lua_Number fim = cast_num(im); \
cond = opf(fa, fim); \
} \
else { \
int isf = GETARG_C(i); \
Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \
} \
docondjump(); }
#define cast_num(i)
Definition: llimits.h:127
#define ttisfloat(o)
Definition: lobject.h:305
#define ttisinteger(o)
Definition: lobject.h:306
#define s2v(o)
Definition: lobject.h:150
#define fltvalue(o)
Definition: lobject.h:310
#define GETARG_C(i)
Definition: lopcodes.h:132
#define ivalue(o)
Definition: lobject.h:311
#define GETARG_sB(i)
Definition: lopcodes.h:129
std::size_t i
Definition: function.cpp:940
static int cond(LexState *ls)
Definition: lparser.cpp:1394
int luaT_callorderiTM(lua_State *L, const TValue *p1, int v2, int flip, int isfloat, TMS event)
Definition: ltm.cpp:220

Definition at line 1005 of file lvm.cpp.

Referenced by luaV_execute().

◆ Protect

#define Protect (   exp)    (savestate(L,ci), (exp), updatetrap(ci))

Definition at line 1089 of file lvm.cpp.

Referenced by luaV_execute().

◆ ProtectNT

#define ProtectNT (   exp)    (savepc(L), (exp), updatetrap(ci))

Definition at line 1092 of file lvm.cpp.

Referenced by luaV_execute().

◆ RA

#define RA (   i)    (base+GETARG_A(i))

Definition at line 1035 of file lvm.cpp.

Referenced by luaV_execute().

◆ RB

#define RB (   i)    (base+GETARG_B(i))

Definition at line 1036 of file lvm.cpp.

Referenced by luaV_execute().

◆ RC

#define RC (   i)    (base+GETARG_C(i))

Definition at line 1039 of file lvm.cpp.

◆ RKC

#define RKC (   i)    ((TESTARG_k(i)) ? k + GETARG_C(i) : s2v(base + GETARG_C(i)))

Definition at line 1042 of file lvm.cpp.

Referenced by luaV_execute().

◆ savepc

#define savepc (   L)    (ci->u.l.savedpc = pc)

Definition at line 1075 of file lvm.cpp.

Referenced by luaV_execute().

◆ savestate

#define savestate (   L,
  ci 
)    (savepc(L), L->top = ci->top)

Definition at line 1082 of file lvm.cpp.

Referenced by luaV_execute().

◆ tostring

#define tostring (   L,
 
)    (ttisstring(o) || (cvt2str(o) && (luaO_tostring(L, o), 1)))

Definition at line 616 of file lvm.cpp.

Referenced by luaV_concat().

◆ updatebase

#define updatebase (   ci)    (base = ci->func + 1)

Definition at line 1048 of file lvm.cpp.

Referenced by luaV_execute().

◆ updatestack

#define updatestack (   ci)    { if (trap) { updatebase(ci); ra = RA(i); } }

Definition at line 1051 of file lvm.cpp.

Referenced by luaV_execute().

◆ updatetrap

#define updatetrap (   ci)    (trap = ci->u.l.trap)

Definition at line 1046 of file lvm.cpp.

Referenced by luaV_execute().

◆ vmbreak

#define vmbreak   break

Definition at line 1119 of file lvm.cpp.

Referenced by luaV_execute().

◆ vmcase

#define vmcase (   l)    case l:

Definition at line 1118 of file lvm.cpp.

Referenced by luaV_execute().

◆ vmdispatch

#define vmdispatch (   o)    switch(o)

Definition at line 1117 of file lvm.cpp.

Referenced by luaV_execute().

◆ vmfetch

#define vmfetch ( )
Value:
{ \
if (trap) { /* stack reallocation or hooks? */ \
trap = luaG_traceexec(L, pc); /* handle hooks */ \
updatebase(ci); /* correct stack */ \
} \
i = *(pc++); \
ra = RA(i); /* WARNING: any stack reallocation invalidates 'ra' */ \
}
std::size_t i
Definition: function.cpp:940
#define RA(i)
Definition: lvm.cpp:1035
int luaG_traceexec(lua_State *L, const Instruction *pc)
Definition: ldebug.cpp:807

Definition at line 1108 of file lvm.cpp.

Referenced by luaV_execute().

◆ vRB

#define vRB (   i)    s2v(RB(i))

Definition at line 1037 of file lvm.cpp.

Referenced by luaV_execute().

◆ vRC

#define vRC (   i)    s2v(RC(i))

Definition at line 1040 of file lvm.cpp.

Referenced by luaV_execute().

Function Documentation

◆ copy2buff()

static void copy2buff ( StkId  top,
int  n,
char *  buff 
)
static

Definition at line 622 of file lvm.cpp.

References s2v, svalue, and vslen.

Referenced by luaV_concat().

◆ floatforloop()

static int floatforloop ( StkId  ra)
static

Definition at line 266 of file lvm.cpp.

References chgfltvalue, fltvalue, luai_numadd, luai_numle, luai_numlt, s2v, and setfltvalue.

Referenced by luaV_execute().

◆ forlimit()

static int forlimit ( lua_State L,
lua_Integer  init,
const TValue lim,
lua_Integer p,
lua_Integer  step 
)
static

Definition at line 176 of file lvm.cpp.

References F2Iceil, F2Ifloor, luaG_forerror(), luai_numlt, luaV_tointeger(), and tonumber.

Referenced by forprep().

◆ forprep()

static int forprep ( lua_State L,
StkId  ra 
)
static

◆ l_strcmp()

static int l_strcmp ( const TString ls,
const TString rs 
)
static

Definition at line 378 of file lvm.cpp.

References getstr, strcoll, and tsslen.

Referenced by lessequalothers(), and lessthanothers().

◆ l_strton()

static int l_strton ( const TValue obj,
TValue result 
)
static

Definition at line 90 of file lvm.cpp.

References cvt2num, lua_assert, luaO_str2num(), svalue, and vslen.

Referenced by luaV_tointeger(), and luaV_tonumber_().

◆ LEfloatint()

static int LEfloatint ( lua_Number  f,
lua_Integer  i 
)
static

Definition at line 463 of file lvm.cpp.

References cast_num, F2Iceil, i, l_intfitsf, luai_numle, and luaV_flttointeger().

Referenced by LEnum().

◆ LEintfloat()

static int LEintfloat ( lua_Integer  i,
lua_Number  f 
)
static

Definition at line 429 of file lvm.cpp.

References cast_num, F2Ifloor, l_intfitsf, luai_numle, and luaV_flttointeger().

Referenced by LEnum().

◆ LEnum()

static int LEnum ( const TValue l,
const TValue r 
)
static

Definition at line 501 of file lvm.cpp.

References fltvalue, ivalue, LEfloatint(), LEintfloat(), lua_assert, luai_numle, ttisfloat, ttisinteger, and ttisnumber.

Referenced by luaV_execute(), and luaV_lessequal().

◆ lessequalothers()

static int lessequalothers ( lua_State L,
const TValue l,
const TValue r 
)
static

Definition at line 545 of file lvm.cpp.

References l_strcmp(), lua_assert, luaT_callorderTM(), TM_LE, tsvalue, ttisnumber, and ttisstring.

Referenced by luaV_execute(), and luaV_lessequal().

◆ lessthanothers()

static int lessthanothers ( lua_State L,
const TValue l,
const TValue r 
)
static

Definition at line 523 of file lvm.cpp.

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

Referenced by luaV_execute(), and luaV_lessthan().

◆ LTfloatint()

static int LTfloatint ( lua_Number  f,
lua_Integer  i 
)
static

Definition at line 446 of file lvm.cpp.

References cast_num, F2Ifloor, i, l_intfitsf, luai_numlt, and luaV_flttointeger().

Referenced by LTnum().

◆ LTintfloat()

static int LTintfloat ( lua_Integer  i,
lua_Number  f 
)
static

Definition at line 412 of file lvm.cpp.

References cast_num, F2Iceil, l_intfitsf, luai_numlt, and luaV_flttointeger().

Referenced by LTnum().

◆ LTnum()

static int LTnum ( const TValue l,
const TValue r 
)
static

Definition at line 479 of file lvm.cpp.

References fltvalue, ivalue, LTfloatint(), LTintfloat(), lua_assert, luai_numlt, ttisfloat, ttisinteger, and ttisnumber.

Referenced by luaV_execute(), and luaV_lessthan().

◆ luaV_concat()

void luaV_concat ( lua_State L,
int  total 
)

◆ luaV_equalobj()

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

◆ luaV_execute()

void luaV_execute ( lua_State L,
CallInfo ci 
)

Definition at line 1122 of file lvm.cpp.

References Table::array, b, c, CallInfo::callstatus, cast_int, cast_num, cast_void, checkGC, checkstackGCp, chgivalue, lua_State::ci, CIST_FRESH, clLvalue, Proto::code, cond(), docondjump, dojump, donextjump, floatforloop(), fltvalue, forprep(), CallInfo::func, GET_OPCODE, GETARG_A, GETARG_Ax, GETARG_B, GETARG_Bx, GETARG_C, GETARG_k, GETARG_sB, GETARG_sBx, GETARG_sC, h, halfProtect, lua_State::hookmask, hvalue, i, intop, Proto::is_vararg, isIT, ivalue, Proto::k, KB, KC, CallInfo::l, l_addi, l_band, l_bor, l_bxor, l_castS2U, l_gei, l_gti, l_isfalse, l_lei, l_lti, l_muli, l_subi, LEnum(), lessequalothers(), lessthanothers(), LTnum(), lua_assert, LUA_MULTRET, LUA_OK, luaC_barrier, luaC_barrierback, luaD_call(), luaD_hookcall(), luaD_poscall(), luaD_precall(), luaD_pretailcall(), luaD_tryfuncTM(), luaF_close(), luaF_newtbcupval(), luaH_get(), luaH_getshortstr(), luaH_getstr(), luaH_new(), luaH_realasize(), luaH_resize(), luaH_resizearray(), luai_numadd, luai_numdiv, luai_numeq, luai_numge, luai_numgt, luai_numidiv, luai_numle, luai_numlt, luai_nummul, luai_numpow, luai_numsub, luai_numunm, luaT_adjustvarargs(), luaT_getvarargs(), luaT_trybinassocTM(), luaT_trybiniTM(), luaT_trybinTM(), luaV_concat(), luaV_equalobj(), luaV_fastget, luaV_fastgeti, luaV_finishfastset, luaV_finishget(), luaV_finishset(), luaV_idiv(), luaV_mod(), luaV_modf(), luaV_objlen(), luaV_rawequalobj, luaV_shiftl(), luaV_shiftr, MAXARG_C, n, NOCLOSINGMETH, CallInfo::nresults, obj2gco, lua_State::oldpc, OP_ADD, OP_ADDI, OP_ADDK, op_arith, op_arithf, op_arithfK, op_arithI, op_arithK, OP_BAND, OP_BANDK, op_bitwise, op_bitwiseK, OP_BNOT, OP_BOR, OP_BORK, OP_BXOR, OP_BXORK, OP_CALL, OP_CLOSE, OP_CLOSURE, OP_CONCAT, OP_DIV, OP_DIVK, OP_EQ, OP_EQI, OP_EQK, OP_EXTRAARG, OP_FORLOOP, OP_FORPREP, OP_GEI, OP_GETFIELD, OP_GETI, OP_GETTABLE, OP_GETTABUP, OP_GETUPVAL, OP_GTI, OP_IDIV, OP_IDIVK, OP_JMP, OP_LE, OP_LEI, OP_LEN, OP_LFALSESKIP, OP_LOADF, OP_LOADFALSE, OP_LOADI, OP_LOADK, OP_LOADKX, OP_LOADNIL, OP_LOADTRUE, OP_LT, OP_LTI, OP_MMBIN, OP_MMBINI, OP_MMBINK, OP_MOD, OP_MODK, OP_MOVE, OP_MUL, OP_MULK, OP_NEWTABLE, OP_NOT, op_order, op_orderI, OP_POW, OP_POWK, OP_RETURN, OP_RETURN0, OP_RETURN1, OP_SELF, OP_SETFIELD, OP_SETI, OP_SETLIST, OP_SETTABLE, OP_SETTABUP, OP_SETUPVAL, OP_SHL, OP_SHLI, OP_SHR, OP_SHRI, OP_SUB, OP_SUBK, OP_TAILCALL, OP_TBC, OP_TEST, OP_TESTSET, OP_TFORCALL, OP_TFORLOOP, OP_TFORPREP, OP_UNM, OP_VARARG, OP_VARARGPREP, p, Proto::p, LClosure::p, CallInfo::previous, Protect, ProtectNT, pushclosure(), RA, RB, RKC, s2v, savepc, savestate, setbfvalue, setbtvalue, setfltvalue, sethvalue2s, setivalue, setnilvalue, setobj, setobj2s, setobj2t, setobjs2s, lua_State::stack_last, t, TESTARG_k, TM_BNOT, TM_LE, TM_LT, TM_UNM, tointegerns, tonumberns, CallInfo::top, lua_State::top, tsvalue, ttisfloat, ttisfunction, ttisinteger, ttisLclosure, ttisnil, CallInfo::u, updatebase, updatestack, updatetrap, LClosure::upvals, UpVal::v, vmbreak, vmcase, vmdispatch, vmfetch, vRB, and vRC.

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

◆ luaV_finishget()

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

◆ luaV_finishOp()

void luaV_finishOp ( lua_State L)

◆ luaV_finishset()

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

◆ luaV_flttointeger()

int luaV_flttointeger ( lua_Number  n,
lua_Integer p,
F2Imod  mode 
)

◆ luaV_idiv()

lua_Integer luaV_idiv ( lua_State L,
lua_Integer  m,
lua_Integer  n 
)

Definition at line 716 of file lvm.cpp.

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

Referenced by intarith(), and luaV_execute().

◆ luaV_lessequal()

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

Definition at line 557 of file lvm.cpp.

References LEnum(), lessequalothers(), and ttisnumber.

Referenced by lua_compare().

◆ luaV_lessthan()

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

Definition at line 535 of file lvm.cpp.

References lessthanothers(), LTnum(), and ttisnumber.

Referenced by lua_compare().

◆ luaV_mod()

lua_Integer luaV_mod ( lua_State L,
lua_Integer  m,
lua_Integer  n 
)

Definition at line 736 of file lvm.cpp.

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

Referenced by intarith(), and luaV_execute().

◆ luaV_modf()

lua_Number luaV_modf ( lua_State L,
lua_Number  m,
lua_Number  n 
)

Definition at line 754 of file lvm.cpp.

References luai_nummod.

Referenced by luaV_execute(), and numarith().

◆ luaV_objlen()

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

◆ luaV_shiftl()

lua_Integer luaV_shiftl ( lua_Integer  x,
lua_Integer  y 
)

Definition at line 769 of file lvm.cpp.

References intop, and NBITS.

Referenced by intarith(), and luaV_execute().

◆ luaV_tointeger()

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

Definition at line 152 of file lvm.cpp.

References l_strton(), and luaV_tointegerns().

Referenced by forlimit().

◆ luaV_tointegerns()

int luaV_tointegerns ( const TValue obj,
lua_Integer p,
F2Imod  mode 
)

Definition at line 137 of file lvm.cpp.

References fltvalue, ivalue, luaV_flttointeger(), ttisfloat, and ttisinteger.

Referenced by luaV_tointeger().

◆ luaV_tonumber_()

int luaV_tonumber_ ( const TValue obj,
lua_Number n 
)

Definition at line 103 of file lvm.cpp.

References cast_num, ivalue, l_strton(), nvalue, and ttisinteger.

◆ pushclosure()

static void pushclosure ( lua_State L,
Proto p,
UpVal **  encup,
StkId  base,
StkId  ra 
)
static