Macros | Functions
lvm.c 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.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

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

Functions

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

Macro Definition Documentation

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

Definition at line 1105 of file lvm.c.

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

Definition at line 1069 of file lvm.c.

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

Definition at line 1058 of file lvm.c.

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

Definition at line 1062 of file lvm.c.

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

Definition at line 1099 of file lvm.c.

#define halfProtectNT (   exp)    (savepc(L), (exp))

Definition at line 1102 of file lvm.c.

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

Definition at line 619 of file lvm.c.

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

Definition at line 1038 of file lvm.c.

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

Definition at line 1041 of file lvm.c.

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

Definition at line 867 of file lvm.c.

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

Definition at line 870 of file lvm.c.

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

Definition at line 871 of file lvm.c.

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

Definition at line 872 of file lvm.c.

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

Definition at line 877 of file lvm.c.

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

Definition at line 876 of file lvm.c.

#define l_intfitsf (   i)    1

Definition at line 78 of file lvm.c.

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

Definition at line 875 of file lvm.c.

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

Definition at line 874 of file lvm.c.

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

Definition at line 869 of file lvm.c.

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

Definition at line 868 of file lvm.c.

#define LUA_CORE

Definition at line 8 of file lvm.c.

#define LUA_USE_JUMPTABLE   0

Definition at line 42 of file lvm.c.

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

Definition at line 767 of file lvm.c.

#define lvm_c

Definition at line 7 of file lvm.c.

#define MAXTAGLOOP   2000

Definition at line 49 of file lvm.c.

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

Definition at line 762 of file lvm.c.

#define NBM   (l_floatatt(MANT_DIG))

Definition at line 58 of file lvm.c.

#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.c:1037
#define op_arith_aux(L, v1, v2, iop, fop)
Definition: lvm.c:930
#define vRC(i)
Definition: lvm.c:1040
struct TValue TValue

Definition at line 941 of file lvm.c.

#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:304
#define s2v(o)
Definition: lobject.h:148
LUA_INTEGER lua_Integer
Definition: lua.h:94
#define op_arithf_aux(L, v1, v2, fop)
Definition: lvm.c:902
#define ivalue(o)
Definition: lobject.h:309
#define setivalue(obj, x)
Definition: lobject.h:320

Definition at line 930 of file lvm.c.

#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.c:1037
#define op_arithf_aux(L, v1, v2, fop)
Definition: lvm.c:902
#define vRC(i)
Definition: lvm.c:1040
struct TValue TValue

Definition at line 912 of file lvm.c.

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

Definition at line 902 of file lvm.c.

#define op_arithfK (   L,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
op_arithf_aux(L, v1, v2, fop); }
#define KC(i)
Definition: lvm.c:1041
#define vRB(i)
Definition: lvm.c:1037
#define op_arithf_aux(L, v1, v2, fop)
Definition: lvm.c:902
struct TValue TValue

Definition at line 921 of file lvm.c.

#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 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:303
#define ttisinteger(o)
Definition: lobject.h:304
#define s2v(o)
Definition: lobject.h:148
#define fltvalue(o)
Definition: lobject.h:308
LUA_INTEGER lua_Integer
Definition: lua.h:94
#define vRB(i)
Definition: lvm.c:1037
#define GETARG_sC(i)
Definition: lopcodes.h:133
#define ivalue(o)
Definition: lobject.h:309
#define setivalue(obj, x)
Definition: lobject.h:320
#define setfltvalue(obj, x)
Definition: lobject.h:314
LUA_NUMBER lua_Number
Definition: lua.h:90
struct TValue TValue

Definition at line 884 of file lvm.c.

#define op_arithK (   L,
  iop,
  fop 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
op_arith_aux(L, v1, v2, iop, fop); }
#define KC(i)
Definition: lvm.c:1041
#define vRB(i)
Definition: lvm.c:1037
#define op_arith_aux(L, v1, v2, iop, fop)
Definition: lvm.c:930
struct TValue TValue

Definition at line 950 of file lvm.c.

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

Definition at line 972 of file lvm.c.

#define op_bitwiseK (   L,
  op 
)
Value:
{ \
TValue *v1 = vRB(i); \
TValue *v2 = KC(i); \
lua_Integer i2 = ivalue(v2); \
if (tointegerns(v1, &i1)) { \
pc++; setivalue(s2v(ra), op(i1, i2)); \
}}
#define s2v(o)
Definition: lobject.h:148
#define tointegerns(o, i)
Definition: lvm.h:67
LUA_INTEGER lua_Integer
Definition: lua.h:94
#define KC(i)
Definition: lvm.c:1041
#define vRB(i)
Definition: lvm.c:1037
#define ivalue(o)
Definition: lobject.h:309
#define setivalue(obj, x)
Definition: lobject.h:320
struct TValue TValue

Definition at line 959 of file lvm.c.

#define op_order (   L,
  opi,
  opn,
  other 
)
Value:
{ \
int cond; \
TValue *rb = vRB(i); \
if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \
cond = opi(ia, ib); \
} \
else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \
cond = opn(s2v(ra), rb); \
Protect(cond = other(L, s2v(ra), rb)); \
#define ttisinteger(o)
Definition: lobject.h:304
#define s2v(o)
Definition: lobject.h:148
static int cond(LexState *ls)
Definition: lparser.c:1396
LUA_INTEGER lua_Integer
Definition: lua.h:94
#define vRB(i)
Definition: lvm.c:1037
#define ivalue(o)
Definition: lobject.h:309
#define Protect(exp)
Definition: lvm.c:1089
#define ttisnumber(o)
Definition: lobject.h:302
#define docondjump()
Definition: lvm.c:1069
struct TValue TValue

Definition at line 986 of file lvm.c.

#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))) { \
cond = opf(fa, fim); \
} \
else { \
int isf = GETARG_C(i); \
Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \
} \
int luaT_callorderiTM(lua_State *L, const TValue *p1, int v2, int flip, int isfloat, TMS event)
Definition: ltm.c:220
#define cast_num(i)
Definition: llimits.h:127
#define ttisfloat(o)
Definition: lobject.h:303
#define ttisinteger(o)
Definition: lobject.h:304
#define s2v(o)
Definition: lobject.h:148
#define fltvalue(o)
Definition: lobject.h:308
static int cond(LexState *ls)
Definition: lparser.c:1396
#define GETARG_C(i)
Definition: lopcodes.h:132
#define ivalue(o)
Definition: lobject.h:309
#define GETARG_sB(i)
Definition: lopcodes.h:129
#define Protect(exp)
Definition: lvm.c:1089
#define docondjump()
Definition: lvm.c:1069
LUA_NUMBER lua_Number
Definition: lua.h:90

Definition at line 1005 of file lvm.c.

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

Definition at line 1089 of file lvm.c.

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

Definition at line 1092 of file lvm.c.

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

Definition at line 1035 of file lvm.c.

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

Definition at line 1036 of file lvm.c.

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

Definition at line 1039 of file lvm.c.

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

Definition at line 1042 of file lvm.c.

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

Definition at line 1075 of file lvm.c.

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

Definition at line 1082 of file lvm.c.

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

Definition at line 616 of file lvm.c.

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

Definition at line 1048 of file lvm.c.

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

Definition at line 1051 of file lvm.c.

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

Definition at line 1046 of file lvm.c.

#define vmbreak   break

Definition at line 1123 of file lvm.c.

#define vmcase (   l)    case l:

Definition at line 1122 of file lvm.c.

#define vmdispatch (   o)    switch(o)

Definition at line 1121 of file lvm.c.

#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' */ \
}
int luaG_traceexec(lua_State *L, const Instruction *pc)
Definition: ldebug.c:807
#define RA(i)
Definition: lvm.c:1035
#define updatebase(ci)
Definition: lvm.c:1048

Definition at line 1112 of file lvm.c.

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

Definition at line 1037 of file lvm.c.

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

Definition at line 1040 of file lvm.c.

Function Documentation

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

Definition at line 622 of file lvm.c.

static int floatforloop ( StkId  ra)
static

Definition at line 266 of file lvm.c.

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.c.

static int forprep ( lua_State L,
StkId  ra 
)
static

Definition at line 206 of file lvm.c.

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

Definition at line 378 of file lvm.c.

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

Definition at line 90 of file lvm.c.

static int LEfloatint ( lua_Number  f,
lua_Integer  i 
)
static

Definition at line 463 of file lvm.c.

static int LEintfloat ( lua_Integer  i,
lua_Number  f 
)
static

Definition at line 429 of file lvm.c.

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

Definition at line 501 of file lvm.c.

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

Definition at line 545 of file lvm.c.

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

Definition at line 523 of file lvm.c.

static int LTfloatint ( lua_Number  f,
lua_Integer  i 
)
static

Definition at line 446 of file lvm.c.

static int LTintfloat ( lua_Integer  i,
lua_Number  f 
)
static

Definition at line 412 of file lvm.c.

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

Definition at line 479 of file lvm.c.

void luaV_concat ( lua_State L,
int  total 
)

Definition at line 636 of file lvm.c.

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

Definition at line 568 of file lvm.c.

void luaV_execute ( lua_State L,
CallInfo ci 
)

Definition at line 1126 of file lvm.c.

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

Definition at line 287 of file lvm.c.

void luaV_finishOp ( lua_State L)

Definition at line 806 of file lvm.c.

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

Definition at line 330 of file lvm.c.

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

Definition at line 121 of file lvm.c.

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

Definition at line 716 of file lvm.c.

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

Definition at line 557 of file lvm.c.

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

Definition at line 535 of file lvm.c.

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

Definition at line 736 of file lvm.c.

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

Definition at line 754 of file lvm.c.

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

Definition at line 681 of file lvm.c.

lua_Integer luaV_shiftl ( lua_Integer  x,
lua_Integer  y 
)

Definition at line 769 of file lvm.c.

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

Definition at line 152 of file lvm.c.

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

Definition at line 137 of file lvm.c.

int luaV_tonumber_ ( const TValue obj,
lua_Number n 
)

Definition at line 103 of file lvm.c.

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

Definition at line 785 of file lvm.c.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:49