You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1686 lines
41 KiB
1686 lines
41 KiB
define Proc%1
|
|
L0 (entry)
|
|
NEWTABLE {T(0)}
|
|
MOV {T(0)} {local(matrix, 0)}
|
|
CLOSURE {Proc%2} {T(1)}
|
|
PUTsk {T(1)} {local(matrix, 0), 'T' Ks(0)}
|
|
CLOSURE {Proc%3} {T(2)}
|
|
PUTsk {T(2)} {local(matrix, 0), 'mul' Ks(1)}
|
|
CLOSURE {Proc%4} {T(3)}
|
|
PUTsk {T(3)} {local(matrix, 0), 'gen' Ks(2)}
|
|
RET {local(matrix, 0)} {L1}
|
|
L1 (exit)
|
|
define Proc%2
|
|
L0 (entry)
|
|
TOTABLE {local(a, 0)}
|
|
LEN {local(a, 0)} {T(0)}
|
|
TGETik {local(a, 0), 1 Kint(0)} {T(1)}
|
|
LEN {T(1)} {T(2)}
|
|
NEWTABLE {T(3)}
|
|
MOV {T(3)} {local(x, 1)}
|
|
TOINT {T(2)}
|
|
MOVi {T(2)} {Tint(1)}
|
|
TOINT {T(0)}
|
|
MOVi {T(0)} {Tint(0)}
|
|
MOV {1 Kint(0)} {Tint(3)}
|
|
MOV {Tint(1)} {Tint(4)}
|
|
MOV {1 Kint(0)} {Tint(5)}
|
|
SUBii {Tint(3), Tint(5)} {Tint(3)}
|
|
BR {L2}
|
|
L1 (exit)
|
|
L2
|
|
ADDii {Tint(3), Tint(5)} {Tint(3)}
|
|
BR {L3}
|
|
L3
|
|
LIii {Tint(4), Tint(3)} {Tbool(6)}
|
|
CBR {Tbool(6)} {L5, L4}
|
|
L4
|
|
MOV {Tint(3)} {Tint(2)}
|
|
LOADGLOBAL {Upval(_ENV), 'table' Ks(1)} {T(0)}
|
|
GETsk {T(0), 'numarray' Ks(2)} {T(2)}
|
|
CALL {T(2), Tint(1), 0.000000000000 Kflt(3)} {T(2..), 1 Kint(0)}
|
|
TOFARRAY {T(2[2..])}
|
|
MOV {T(2[2..])} {local(xi, 2)}
|
|
TPUTik {local(xi, 2)} {local(x, 1), Tint(2)}
|
|
MOV {1 Kint(0)} {Tint(8)}
|
|
MOV {Tint(0)} {Tint(9)}
|
|
MOV {1 Kint(0)} {Tint(10)}
|
|
SUBii {Tint(8), Tint(10)} {Tint(8)}
|
|
BR {L6}
|
|
L5
|
|
RET {local(x, 1)} {L1}
|
|
L6
|
|
ADDii {Tint(8), Tint(10)} {Tint(8)}
|
|
BR {L7}
|
|
L7
|
|
LIii {Tint(9), Tint(8)} {Tbool(11)}
|
|
CBR {Tbool(11)} {L9, L8}
|
|
L8
|
|
MOV {Tint(8)} {Tint(7)}
|
|
TGETik {local(a, 0), Tint(7)} {T(3)}
|
|
GETik {T(3), Tint(2)} {T(4)}
|
|
TOFLT {T(4)}
|
|
FAPUTfv {T(4)} {local(xi, 2), Tint(7)}
|
|
BR {L6}
|
|
L9
|
|
BR {L2}
|
|
define Proc%3
|
|
L0 (entry)
|
|
TOTABLE {local(a, 0)}
|
|
TOTABLE {local(b, 1)}
|
|
LOADGLOBAL {Upval(_ENV), 'assert' Ks(0)} {T(0)}
|
|
TGETik {local(a, 0), 1 Kint(1)} {T(1)}
|
|
LEN {T(1)} {T(2)}
|
|
TOINT {T(2)}
|
|
LEN {local(b, 1)} {T(3)}
|
|
EQ {T(2), T(3)} {T(4)}
|
|
CALL {T(0), T(4)} {T(0..), 1 Kint(1)}
|
|
LEN {local(a, 0)} {T(4)}
|
|
TGETik {local(a, 0), 1 Kint(1)} {T(3)}
|
|
LEN {T(3)} {T(2)}
|
|
TGETik {local(b, 1), 1 Kint(1)} {T(5)}
|
|
LEN {T(5)} {T(6)}
|
|
NEWTABLE {T(7)}
|
|
MOV {T(7)} {local(x, 2)}
|
|
TOINT {T(6)}
|
|
MOVi {T(6)} {Tint(2)}
|
|
TOINT {T(2)}
|
|
MOVi {T(2)} {Tint(1)}
|
|
TOINT {T(4)}
|
|
MOVi {T(4)} {Tint(0)}
|
|
GETsk {Upval(1, Proc%1, matrix), 'T' Ks(2)} {T(4)}
|
|
CALL {T(4), local(b, 1)} {T(4..), 1 Kint(1)}
|
|
TOTABLE {T(4[4..])}
|
|
MOV {T(4[4..])} {local(c, 3)}
|
|
MOV {1 Kint(1)} {Tint(4)}
|
|
MOV {Tint(0)} {Tint(5)}
|
|
MOV {1 Kint(1)} {Tint(6)}
|
|
SUBii {Tint(4), Tint(6)} {Tint(4)}
|
|
BR {L2}
|
|
L1 (exit)
|
|
L2
|
|
ADDii {Tint(4), Tint(6)} {Tint(4)}
|
|
BR {L3}
|
|
L3
|
|
LIii {Tint(5), Tint(4)} {Tbool(7)}
|
|
CBR {Tbool(7)} {L5, L4}
|
|
L4
|
|
MOV {Tint(4)} {Tint(3)}
|
|
LOADGLOBAL {Upval(_ENV), 'table' Ks(3)} {T(2)}
|
|
GETsk {T(2), 'numarray' Ks(4)} {T(6)}
|
|
CALL {T(6), Tint(2), 0.000000000000 Kflt(5)} {T(6..), 1 Kint(1)}
|
|
TOFARRAY {T(6[6..])}
|
|
MOV {T(6[6..])} {local(xi, 4)}
|
|
TPUTik {local(xi, 4)} {local(x, 2), Tint(3)}
|
|
MOV {1 Kint(1)} {Tint(9)}
|
|
MOV {Tint(2)} {Tint(10)}
|
|
MOV {1 Kint(1)} {Tint(11)}
|
|
SUBii {Tint(9), Tint(11)} {Tint(9)}
|
|
BR {L6}
|
|
L5
|
|
RET {local(x, 2)} {L1}
|
|
L6
|
|
ADDii {Tint(9), Tint(11)} {Tint(9)}
|
|
BR {L7}
|
|
L7
|
|
LIii {Tint(10), Tint(9)} {Tbool(12)}
|
|
CBR {Tbool(12)} {L9, L8}
|
|
L8
|
|
MOV {Tint(9)} {Tint(8)}
|
|
TGETik {local(a, 0), Tint(3)} {T(7)}
|
|
TOFARRAY {T(7)}
|
|
TGETik {local(c, 3), Tint(8)} {T(8)}
|
|
TOFARRAY {T(8)}
|
|
MOV {T(8)} {local(cj, 6)}
|
|
MOV {T(7)} {local(ai, 5)}
|
|
MOVf {0.000000000000 Kflt(5)} {Tflt(0)}
|
|
MOV {1 Kint(1)} {Tint(14)}
|
|
MOV {Tint(1)} {Tint(15)}
|
|
MOV {1 Kint(1)} {Tint(16)}
|
|
SUBii {Tint(14), Tint(16)} {Tint(14)}
|
|
BR {L10}
|
|
L9
|
|
BR {L2}
|
|
L10
|
|
ADDii {Tint(14), Tint(16)} {Tint(14)}
|
|
BR {L11}
|
|
L11
|
|
LIii {Tint(15), Tint(14)} {Tbool(17)}
|
|
CBR {Tbool(17)} {L13, L12}
|
|
L12
|
|
MOV {Tint(14)} {Tint(13)}
|
|
FAGETik {local(ai, 5), Tint(13)} {Tflt(1)}
|
|
FAGETik {local(cj, 6), Tint(13)} {Tflt(2)}
|
|
MULff {Tflt(1), Tflt(2)} {Tflt(3)}
|
|
ADDff {Tflt(0), Tflt(3)} {Tflt(2)}
|
|
MOVf {Tflt(2)} {Tflt(0)}
|
|
BR {L10}
|
|
L13
|
|
FAPUTfv {Tflt(0)} {local(xi, 4), Tint(8)}
|
|
BR {L6}
|
|
define Proc%4
|
|
L0 (entry)
|
|
TOINT {local(n, 0)}
|
|
NEWTABLE {T(0)}
|
|
DIVfi {1.000000000000 Kflt(0), local(n, 0)} {Tflt(1)}
|
|
DIVfi {Tflt(1), local(n, 0)} {Tflt(2)}
|
|
MOVf {Tflt(2)} {Tflt(0)}
|
|
MOV {T(0)} {local(a, 1)}
|
|
MOV {1 Kint(1)} {Tint(1)}
|
|
MOV {local(n, 0)} {Tint(2)}
|
|
MOV {1 Kint(1)} {Tint(3)}
|
|
SUBii {Tint(1), Tint(3)} {Tint(1)}
|
|
BR {L2}
|
|
L1 (exit)
|
|
L2
|
|
ADDii {Tint(1), Tint(3)} {Tint(1)}
|
|
BR {L3}
|
|
L3
|
|
LIii {Tint(2), Tint(1)} {Tbool(4)}
|
|
CBR {Tbool(4)} {L5, L4}
|
|
L4
|
|
MOV {Tint(1)} {Tint(0)}
|
|
LOADGLOBAL {Upval(_ENV), 'table' Ks(2)} {T(0)}
|
|
GETsk {T(0), 'numarray' Ks(3)} {T(1)}
|
|
CALL {T(1), local(n, 0), 0.000000000000 Kflt(4)} {T(1..), 1 Kint(1)}
|
|
TOFARRAY {T(1[1..])}
|
|
MOV {T(1[1..])} {local(ai, 2)}
|
|
TPUTik {local(ai, 2)} {local(a, 1), Tint(0)}
|
|
MOV {1 Kint(1)} {Tint(6)}
|
|
MOV {local(n, 0)} {Tint(7)}
|
|
MOV {1 Kint(1)} {Tint(8)}
|
|
SUBii {Tint(6), Tint(8)} {Tint(6)}
|
|
BR {L6}
|
|
L5
|
|
RET {local(a, 1)} {L1}
|
|
L6
|
|
ADDii {Tint(6), Tint(8)} {Tint(6)}
|
|
BR {L7}
|
|
L7
|
|
LIii {Tint(7), Tint(6)} {Tbool(9)}
|
|
CBR {Tbool(9)} {L9, L8}
|
|
L8
|
|
MOV {Tint(6)} {Tint(5)}
|
|
SUBii {Tint(0), Tint(5)} {Tint(10)}
|
|
MULfi {Tflt(0), Tint(10)} {Tflt(1)}
|
|
ADDii {Tint(0), Tint(5)} {Tint(10)}
|
|
SUBii {Tint(10), 2 Kint(5)} {Tint(11)}
|
|
MULfi {Tflt(1), Tint(11)} {Tflt(3)}
|
|
FAPUTfv {Tflt(3)} {local(ai, 2), Tint(5)}
|
|
BR {L6}
|
|
L9
|
|
BR {L2}
|
|
typedef __SIZE_TYPE__ size_t;
|
|
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
typedef __INTPTR_TYPE__ intptr_t;
|
|
typedef __INT64_TYPE__ int64_t;
|
|
typedef __UINT64_TYPE__ uint64_t;
|
|
typedef __INT32_TYPE__ int32_t;
|
|
typedef __UINT32_TYPE__ uint32_t;
|
|
typedef __INT16_TYPE__ int16_t;
|
|
typedef __UINT16_TYPE__ uint16_t;
|
|
typedef __INT8_TYPE__ int8_t;
|
|
typedef __UINT8_TYPE__ uint8_t;
|
|
typedef size_t lu_mem;
|
|
typedef unsigned char lu_byte;
|
|
typedef uint16_t LuaType;
|
|
#define NULL ((void *)0)
|
|
typedef struct lua_State lua_State;
|
|
#define LUA_TNONE (-1)
|
|
#define LUA_TNIL 0
|
|
#define LUA_TBOOLEAN 1
|
|
#define LUA_TLIGHTUSERDATA 2
|
|
#define LUA_TNUMBER 3
|
|
#define LUA_TSTRING 4
|
|
#define LUA_TTABLE 5
|
|
#define LUA_TFUNCTION 6
|
|
#define LUA_TUSERDATA 7
|
|
#define LUA_TTHREAD 8
|
|
#define LUA_OK 0
|
|
typedef enum {TM_INDEX,TM_NEWINDEX,TM_GC,
|
|
TM_MODE,TM_LEN,TM_EQ,TM_ADD,TM_SUB,TM_MUL,
|
|
TM_MOD,TM_POW,TM_DIV,TM_IDIV,TM_BAND,TM_BOR,
|
|
TM_BXOR,TM_SHL,TM_SHR,TM_UNM,TM_BNOT,TM_LT,
|
|
TM_LE,TM_CONCAT,TM_CALL,TM_N
|
|
} TMS;
|
|
typedef double lua_Number;
|
|
typedef int64_t lua_Integer;
|
|
typedef uint64_t lua_Unsigned;
|
|
typedef int (*lua_CFunction) (lua_State *L);
|
|
typedef union {
|
|
lua_Number n;
|
|
double u;
|
|
void *s;
|
|
lua_Integer i;
|
|
long l;
|
|
} L_Umaxalign;
|
|
#define lua_assert(c) ((void)0)
|
|
#define check_exp(c,e) (e)
|
|
#define lua_longassert(c) ((void)0)
|
|
#define luai_apicheck(l,e) lua_assert(e)
|
|
#define api_check(l,e,msg) luai_apicheck(l,(e) && msg)
|
|
#define UNUSED(x) ((void)(x))
|
|
#define cast(t, exp) ((t)(exp))
|
|
#define cast_void(i) cast(void, (i))
|
|
#define cast_byte(i) cast(lu_byte, (i))
|
|
#define cast_num(i) cast(lua_Number, (i))
|
|
#define cast_int(i) cast(int, (i))
|
|
#define cast_uchar(i) cast(unsigned char, (i))
|
|
#define l_castS2U(i) ((lua_Unsigned)(i))
|
|
#define l_castU2S(i) ((lua_Integer)(i))
|
|
#define l_noret void
|
|
typedef unsigned int Instruction;
|
|
#define luai_numidiv(L,a,b) ((void)L, l_floor(luai_numdiv(L,a,b)))
|
|
#define luai_numdiv(L,a,b) ((a)/(b))
|
|
#define luai_nummod(L,a,b,m) \
|
|
{ (m) = l_mathop(fmod)(a,b); if ((m)*(b) < 0) (m) += (b); }
|
|
#define LUA_TLCL (LUA_TFUNCTION | (0 << 4))
|
|
#define LUA_TLCF (LUA_TFUNCTION | (1 << 4))
|
|
#define LUA_TCCL (LUA_TFUNCTION | (2 << 4))
|
|
#define RAVI_TFCF (LUA_TFUNCTION | (4 << 4))
|
|
#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4))
|
|
#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4))
|
|
#define LUA_TNUMFLT (LUA_TNUMBER | (0 << 4))
|
|
#define LUA_TNUMINT (LUA_TNUMBER | (1 << 4))
|
|
#define RAVI_TIARRAY (LUA_TTABLE | (1 << 4))
|
|
#define RAVI_TFARRAY (LUA_TTABLE | (2 << 4))
|
|
#define BIT_ISCOLLECTABLE (1 << 15)
|
|
#define ctb(t) ((t) | BIT_ISCOLLECTABLE)
|
|
typedef struct GCObject GCObject;
|
|
#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked
|
|
struct GCObject {
|
|
CommonHeader;
|
|
};
|
|
typedef union Value {
|
|
GCObject *gc;
|
|
void *p;
|
|
int b;
|
|
lua_CFunction f;
|
|
lua_Integer i;
|
|
lua_Number n;
|
|
} Value;
|
|
#define TValuefields Value value_; LuaType tt_
|
|
typedef struct lua_TValue {
|
|
TValuefields;
|
|
} TValue;
|
|
#define NILCONSTANT {NULL}, LUA_TNIL
|
|
#define val_(o) ((o)->value_)
|
|
#define rttype(o) ((o)->tt_)
|
|
#define novariant(x) ((x) & 0x0F)
|
|
#define ttype(o) (rttype(o) & 0x7F)
|
|
#define ttnov(o) (novariant(rttype(o)))
|
|
#define checktag(o,t) (rttype(o) == (t))
|
|
#define checktype(o,t) (ttnov(o) == (t))
|
|
#define ttisnumber(o) checktype((o), LUA_TNUMBER)
|
|
#define ttisfloat(o) checktag((o), LUA_TNUMFLT)
|
|
#define ttisinteger(o) checktag((o), LUA_TNUMINT)
|
|
#define ttisnil(o) checktag((o), LUA_TNIL)
|
|
#define ttisboolean(o) checktag((o), LUA_TBOOLEAN)
|
|
#define ttislightuserdata(o) checktag((o), LUA_TLIGHTUSERDATA)
|
|
#define ttisstring(o) checktype((o), LUA_TSTRING)
|
|
#define ttisshrstring(o) checktag((o), ctb(LUA_TSHRSTR))
|
|
#define ttislngstring(o) checktag((o), ctb(LUA_TLNGSTR))
|
|
#define ttistable(o) checktype((o), LUA_TTABLE)
|
|
#define ttisiarray(o) checktag((o), ctb(RAVI_TIARRAY))
|
|
#define ttisfarray(o) checktag((o), ctb(RAVI_TFARRAY))
|
|
#define ttisarray(o) (ttisiarray(o) || ttisfarray(o))
|
|
#define ttisLtable(o) checktag((o), ctb(LUA_TTABLE))
|
|
#define ttisfunction(o) checktype(o, LUA_TFUNCTION)
|
|
#define ttisclosure(o) ((rttype(o) & 0x1F) == LUA_TFUNCTION)
|
|
#define ttisCclosure(o) checktag((o), ctb(LUA_TCCL))
|
|
#define ttisLclosure(o) checktag((o), ctb(LUA_TLCL))
|
|
#define ttislcf(o) checktag((o), LUA_TLCF)
|
|
#define ttisfcf(o) (ttype(o) == RAVI_TFCF)
|
|
#define ttisfulluserdata(o) checktag((o), ctb(LUA_TUSERDATA))
|
|
#define ttisthread(o) checktag((o), ctb(LUA_TTHREAD))
|
|
#define ttisdeadkey(o) checktag((o), LUA_TDEADKEY)
|
|
#define ivalue(o) check_exp(ttisinteger(o), val_(o).i)
|
|
#define fltvalue(o) check_exp(ttisfloat(o), val_(o).n)
|
|
#define nvalue(o) check_exp(ttisnumber(o), \
|
|
(ttisinteger(o) ? cast_num(ivalue(o)) : fltvalue(o)))
|
|
#define gcvalue(o) check_exp(iscollectable(o), val_(o).gc)
|
|
#define pvalue(o) check_exp(ttislightuserdata(o), val_(o).p)
|
|
#define tsvalue(o) check_exp(ttisstring(o), gco2ts(val_(o).gc))
|
|
#define uvalue(o) check_exp(ttisfulluserdata(o), gco2u(val_(o).gc))
|
|
#define clvalue(o) check_exp(ttisclosure(o), gco2cl(val_(o).gc))
|
|
#define clLvalue(o) check_exp(ttisLclosure(o), gco2lcl(val_(o).gc))
|
|
#define clCvalue(o) check_exp(ttisCclosure(o), gco2ccl(val_(o).gc))
|
|
#define fvalue(o) check_exp(ttislcf(o), val_(o).f)
|
|
#define fcfvalue(o) check_exp(ttisfcf(o), val_(o).p)
|
|
#define hvalue(o) check_exp(ttistable(o), gco2t(val_(o).gc))
|
|
#define arrvalue(o) check_exp(ttisarray(o), gco2array(val_(o).gc))
|
|
#define arrvalue(o) check_exp(ttisarray(o), gco2array(val_(o).gc))
|
|
#define bvalue(o) check_exp(ttisboolean(o), val_(o).b)
|
|
#define thvalue(o) check_exp(ttisthread(o), gco2th(val_(o).gc))
|
|
#define deadvalue(o) check_exp(ttisdeadkey(o), cast(void *, val_(o).gc))
|
|
#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0))
|
|
#define iscollectable(o) (rttype(o) & BIT_ISCOLLECTABLE)
|
|
#define righttt(obj) (ttype(obj) == gcvalue(obj)->tt)
|
|
#define checkliveness(L,obj) \
|
|
lua_longassert(!iscollectable(obj) || \
|
|
(righttt(obj) && (L == NULL || !isdead(G(L),gcvalue(obj)))))
|
|
#define settt_(o,t) ((o)->tt_=(t))
|
|
#define setfltvalue(obj,x) \
|
|
{ TValue *io=(obj); val_(io).n=(x); settt_(io, LUA_TNUMFLT); }
|
|
#define chgfltvalue(obj,x) \
|
|
{ TValue *io=(obj); lua_assert(ttisfloat(io)); val_(io).n=(x); }
|
|
#define setivalue(obj,x) \
|
|
{ TValue *io=(obj); val_(io).i=(x); settt_(io, LUA_TNUMINT); }
|
|
#define chgivalue(obj,x) \
|
|
{ TValue *io=(obj); lua_assert(ttisinteger(io)); val_(io).i=(x); }
|
|
#define setnilvalue(obj) settt_(obj, LUA_TNIL)
|
|
#define setfvalue(obj,x) \
|
|
{ TValue *io=(obj); val_(io).f=(x); settt_(io, LUA_TLCF); }
|
|
#define setfvalue_fastcall(obj, x, tag) \
|
|
{ \
|
|
TValue *io = (obj); \
|
|
lua_assert(tag >= 1 && tag < 0x80); \
|
|
val_(io).p = (x); \
|
|
settt_(io, ((tag << 8) | RAVI_TFCF)); \
|
|
}
|
|
#define setpvalue(obj,x) \
|
|
{ TValue *io=(obj); val_(io).p=(x); settt_(io, LUA_TLIGHTUSERDATA); }
|
|
#define setbvalue(obj,x) \
|
|
{ TValue *io=(obj); val_(io).b=(x); settt_(io, LUA_TBOOLEAN); }
|
|
#define setgcovalue(L,obj,x) \
|
|
{ TValue *io = (obj); GCObject *i_g=(x); \
|
|
val_(io).gc = i_g; settt_(io, ctb(i_g->tt)); }
|
|
#define setsvalue(L,obj,x) \
|
|
{ TValue *io = (obj); TString *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(x_->tt)); \
|
|
checkliveness(L,io); }
|
|
#define setuvalue(L,obj,x) \
|
|
{ TValue *io = (obj); Udata *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TUSERDATA)); \
|
|
checkliveness(L,io); }
|
|
#define setthvalue(L,obj,x) \
|
|
{ TValue *io = (obj); lua_State *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTHREAD)); \
|
|
checkliveness(L,io); }
|
|
#define setclLvalue(L,obj,x) \
|
|
{ TValue *io = (obj); LClosure *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TLCL)); \
|
|
checkliveness(L,io); }
|
|
#define setclCvalue(L,obj,x) \
|
|
{ TValue *io = (obj); CClosure *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TCCL)); \
|
|
checkliveness(L,io); }
|
|
#define sethvalue(L,obj,x) \
|
|
{ TValue *io = (obj); Table *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(LUA_TTABLE)); \
|
|
checkliveness(L,io); }
|
|
#define setiarrayvalue(L,obj,x) \
|
|
{ TValue *io = (obj); Table *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(RAVI_TIARRAY)); \
|
|
checkliveness(L,io); }
|
|
#define setfarrayvalue(L,obj,x) \
|
|
{ TValue *io = (obj); Table *x_ = (x); \
|
|
val_(io).gc = obj2gco(x_); settt_(io, ctb(RAVI_TFARRAY)); \
|
|
checkliveness(L,io); }
|
|
#define setdeadvalue(obj) settt_(obj, LUA_TDEADKEY)
|
|
#define setobj(L,obj1,obj2) \
|
|
{ TValue *io1=(obj1); const TValue *io2=(obj2); io1->tt_ = io2->tt_; val_(io1).n = val_(io2).n; \
|
|
(void)L; checkliveness(L,io1); }
|
|
#define setobjs2s setobj
|
|
#define setobj2s setobj
|
|
#define setsvalue2s setsvalue
|
|
#define sethvalue2s sethvalue
|
|
#define setptvalue2s setptvalue
|
|
#define setobjt2t setobj
|
|
#define setobj2n setobj
|
|
#define setsvalue2n setsvalue
|
|
#define setobj2t setobj
|
|
typedef TValue *StkId;
|
|
typedef struct TString {
|
|
CommonHeader;
|
|
lu_byte extra;
|
|
lu_byte shrlen;
|
|
unsigned int hash;
|
|
union {
|
|
size_t lnglen;
|
|
struct TString *hnext;
|
|
} u;
|
|
} TString;
|
|
typedef union UTString {
|
|
L_Umaxalign dummy;
|
|
TString tsv;
|
|
} UTString;
|
|
#define getstr(ts) \
|
|
check_exp(sizeof((ts)->extra), cast(char *, (ts)) + sizeof(UTString))
|
|
#define svalue(o) getstr(tsvalue(o))
|
|
#define tsslen(s) ((s)->tt == LUA_TSHRSTR ? (s)->shrlen : (s)->u.lnglen)
|
|
#define vslen(o) tsslen(tsvalue(o))
|
|
typedef struct Udata {
|
|
CommonHeader;
|
|
LuaType ttuv_;
|
|
struct Table *metatable;
|
|
size_t len;
|
|
union Value user_;
|
|
} Udata;
|
|
typedef union UUdata {
|
|
L_Umaxalign dummy;
|
|
Udata uv;
|
|
} UUdata;
|
|
#define getudatamem(u) \
|
|
check_exp(sizeof((u)->ttuv_), (cast(char*, (u)) + sizeof(UUdata)))
|
|
#define setuservalue(L,u,o) \
|
|
{ const TValue *io=(o); Udata *iu = (u); \
|
|
iu->user_ = io->value_; iu->ttuv_ = rttype(io); \
|
|
checkliveness(L,io); }
|
|
#define getuservalue(L,u,o) \
|
|
{ TValue *io=(o); const Udata *iu = (u); \
|
|
io->value_ = iu->user_; settt_(io, iu->ttuv_); \
|
|
checkliveness(L,io); }
|
|
typedef enum {
|
|
RAVI_TANY = 0,
|
|
RAVI_TNUMINT = 1,
|
|
RAVI_TNUMFLT,
|
|
RAVI_TARRAYINT,
|
|
RAVI_TARRAYFLT,
|
|
RAVI_TFUNCTION,
|
|
RAVI_TTABLE,
|
|
RAVI_TSTRING,
|
|
RAVI_TNIL,
|
|
RAVI_TBOOLEAN,
|
|
RAVI_TUSERDATA
|
|
} ravitype_t;
|
|
typedef struct Upvaldesc {
|
|
TString *name;
|
|
TString *usertype;
|
|
lu_byte ravi_type;
|
|
lu_byte instack;
|
|
lu_byte idx;
|
|
} Upvaldesc;
|
|
typedef struct LocVar {
|
|
TString *varname;
|
|
TString *usertype;
|
|
int startpc;
|
|
int endpc;
|
|
lu_byte ravi_type;
|
|
} LocVar;
|
|
typedef enum {
|
|
RAVI_JIT_NOT_COMPILED = 0,
|
|
RAVI_JIT_CANT_COMPILE = 1,
|
|
RAVI_JIT_COMPILED = 2
|
|
} ravi_jit_status_t;
|
|
typedef enum {
|
|
RAVI_JIT_FLAG_NONE = 0,
|
|
RAVI_JIT_FLAG_HASFORLOOP = 1
|
|
} ravi_jit_flag_t;
|
|
typedef struct RaviJITProto {
|
|
lu_byte jit_status;
|
|
lu_byte jit_flags;
|
|
unsigned short execution_count;
|
|
void *jit_data;
|
|
lua_CFunction jit_function;
|
|
} RaviJITProto;
|
|
typedef struct Proto {
|
|
CommonHeader;
|
|
lu_byte numparams;
|
|
lu_byte is_vararg;
|
|
lu_byte maxstacksize;
|
|
int sizeupvalues;
|
|
int sizek;
|
|
int sizecode;
|
|
int sizelineinfo;
|
|
int sizep;
|
|
int sizelocvars;
|
|
int linedefined;
|
|
int lastlinedefined;
|
|
TValue *k;
|
|
Instruction *code;
|
|
struct Proto **p;
|
|
int *lineinfo;
|
|
LocVar *locvars;
|
|
Upvaldesc *upvalues;
|
|
struct LClosure *cache;
|
|
TString *source;
|
|
GCObject *gclist;
|
|
RaviJITProto ravi_jit;
|
|
} Proto;
|
|
typedef struct UpVal UpVal;
|
|
#define ClosureHeader \
|
|
CommonHeader; lu_byte nupvalues; GCObject *gclist
|
|
typedef struct CClosure {
|
|
ClosureHeader;
|
|
lua_CFunction f;
|
|
TValue upvalue[1];
|
|
} CClosure;
|
|
typedef struct LClosure {
|
|
ClosureHeader;
|
|
struct Proto *p;
|
|
UpVal *upvals[1];
|
|
} LClosure;
|
|
typedef union Closure {
|
|
CClosure c;
|
|
LClosure l;
|
|
} Closure;
|
|
#define isLfunction(o) ttisLclosure(o)
|
|
#define getproto(o) (clLvalue(o)->p)
|
|
typedef union TKey {
|
|
struct {
|
|
TValuefields;
|
|
int next;
|
|
} nk;
|
|
TValue tvk;
|
|
} TKey;
|
|
#define setnodekey(L,key,obj) \
|
|
{ TKey *k_=(key); const TValue *io_=(obj); \
|
|
k_->nk.value_ = io_->value_; k_->nk.tt_ = io_->tt_; \
|
|
(void)L; checkliveness(L,io_); }
|
|
typedef struct Node {
|
|
TValue i_val;
|
|
TKey i_key;
|
|
} Node;
|
|
typedef enum RaviArrayModifer {
|
|
RAVI_ARRAY_SLICE = 1,
|
|
RAVI_ARRAY_FIXEDSIZE = 2,
|
|
RAVI_ARRAY_ALLOCATED = 4,
|
|
RAVI_ARRAY_ISFLOAT = 8
|
|
} RaviArrayModifier;
|
|
enum {
|
|
RAVI_ARRAY_MAX_INLINE = 3,
|
|
};
|
|
typedef struct RaviArray {
|
|
CommonHeader;
|
|
lu_byte flags;
|
|
unsigned int len;
|
|
unsigned int size;
|
|
union {
|
|
lua_Number numarray[RAVI_ARRAY_MAX_INLINE];
|
|
lua_Integer intarray[RAVI_ARRAY_MAX_INLINE];
|
|
struct RaviArray* parent;
|
|
};
|
|
char *data;
|
|
struct Table *metatable;
|
|
} RaviArray;
|
|
typedef struct Table {
|
|
CommonHeader;
|
|
lu_byte flags;
|
|
lu_byte lsizenode;
|
|
unsigned int sizearray;
|
|
TValue *array;
|
|
Node *node;
|
|
Node *lastfree;
|
|
struct Table *metatable;
|
|
GCObject *gclist;
|
|
unsigned int hmask;
|
|
} Table;
|
|
typedef struct Mbuffer {
|
|
char *buffer;
|
|
size_t n;
|
|
size_t buffsize;
|
|
} Mbuffer;
|
|
typedef struct stringtable {
|
|
TString **hash;
|
|
int nuse;
|
|
int size;
|
|
} stringtable;
|
|
struct lua_Debug;
|
|
typedef intptr_t lua_KContext;
|
|
typedef int(*lua_KFunction)(struct lua_State *L, int status, lua_KContext ctx);
|
|
typedef void *(*lua_Alloc)(void *ud, void *ptr, size_t osize,
|
|
size_t nsize);
|
|
typedef void(*lua_Hook)(struct lua_State *L, struct lua_Debug *ar);
|
|
typedef struct CallInfo {
|
|
StkId func;
|
|
StkId top;
|
|
struct CallInfo *previous, *next;
|
|
union {
|
|
struct {
|
|
StkId base;
|
|
const Instruction *savedpc;
|
|
} l;
|
|
struct {
|
|
lua_KFunction k;
|
|
ptrdiff_t old_errfunc;
|
|
lua_KContext ctx;
|
|
} c;
|
|
} u;
|
|
ptrdiff_t extra;
|
|
short nresults;
|
|
unsigned short callstatus;
|
|
unsigned short stacklevel;
|
|
lu_byte jitstatus;
|
|
lu_byte magic;
|
|
} CallInfo;
|
|
#define CIST_OAH (1<<0)
|
|
#define CIST_LUA (1<<1)
|
|
#define CIST_HOOKED (1<<2)
|
|
#define CIST_FRESH (1<<3)
|
|
#define CIST_YPCALL (1<<4)
|
|
#define CIST_TAIL (1<<5)
|
|
#define CIST_HOOKYIELD (1<<6)
|
|
#define CIST_LEQ (1<<7)
|
|
#define CIST_FIN (1<<8)
|
|
#define isLua(ci) ((ci)->callstatus & CIST_LUA)
|
|
#define isJITed(ci) ((ci)->jitstatus)
|
|
#define setoah(st,v) ((st) = ((st) & ~CIST_OAH) | (v))
|
|
#define getoah(st) ((st) & CIST_OAH)
|
|
typedef struct global_State global_State;
|
|
struct lua_State {
|
|
CommonHeader;
|
|
lu_byte status;
|
|
StkId top;
|
|
global_State *l_G;
|
|
CallInfo *ci;
|
|
const Instruction *oldpc;
|
|
StkId stack_last;
|
|
StkId stack;
|
|
UpVal *openupval;
|
|
GCObject *gclist;
|
|
struct lua_State *twups;
|
|
struct lua_longjmp *errorJmp;
|
|
CallInfo base_ci;
|
|
volatile lua_Hook hook;
|
|
ptrdiff_t errfunc;
|
|
int stacksize;
|
|
int basehookcount;
|
|
int hookcount;
|
|
unsigned short nny;
|
|
unsigned short nCcalls;
|
|
lu_byte hookmask;
|
|
lu_byte allowhook;
|
|
unsigned short nci;
|
|
lu_byte magic;
|
|
};
|
|
#define G(L) (L->l_G)
|
|
union GCUnion {
|
|
GCObject gc;
|
|
struct TString ts;
|
|
struct Udata u;
|
|
union Closure cl;
|
|
struct Table h;
|
|
struct RaviArray arr;
|
|
struct Proto p;
|
|
struct lua_State th;
|
|
};
|
|
struct UpVal {
|
|
TValue *v;
|
|
lu_mem refcount;
|
|
union {
|
|
struct {
|
|
UpVal *next;
|
|
int touched;
|
|
} open;
|
|
TValue value;
|
|
} u;
|
|
};
|
|
#define cast_u(o) cast(union GCUnion *, (o))
|
|
#define gco2ts(o) \
|
|
check_exp(novariant((o)->tt) == LUA_TSTRING, &((cast_u(o))->ts))
|
|
#define gco2u(o) check_exp((o)->tt == LUA_TUSERDATA, &((cast_u(o))->u))
|
|
#define gco2lcl(o) check_exp((o)->tt == LUA_TLCL, &((cast_u(o))->cl.l))
|
|
#define gco2ccl(o) check_exp((o)->tt == LUA_TCCL, &((cast_u(o))->cl.c))
|
|
#define gco2cl(o) \
|
|
check_exp(novariant((o)->tt) == LUA_TFUNCTION, &((cast_u(o))->cl))
|
|
#define gco2t(o) check_exp((o)->tt == LUA_TTABLE, &((cast_u(o))->h))
|
|
#define gco2array(o) check_exp(((o)->tt == RAVI_TIARRAY || (o)->tt == RAVI_TFARRAY), &((cast_u(o))->arr))
|
|
#define gco2p(o) check_exp((o)->tt == LUA_TPROTO, &((cast_u(o))->p))
|
|
#define gco2th(o) check_exp((o)->tt == LUA_TTHREAD, &((cast_u(o))->th))
|
|
#define obj2gco(v) \
|
|
check_exp(novariant((v)->tt) < LUA_TDEADKEY, (&(cast_u(v)->gc)))
|
|
#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))
|
|
extern int luaV_tonumber_(const TValue *obj, lua_Number *n);
|
|
extern int luaV_tointeger(const TValue *obj, lua_Integer *p, int mode);
|
|
extern void luaF_close (lua_State *L, StkId level);
|
|
extern int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, int nres);
|
|
extern void luaD_growstack (lua_State *L, int n);
|
|
extern int luaV_equalobj(lua_State *L, const TValue *t1, const TValue *t2);
|
|
extern int luaV_lessthan(lua_State *L, const TValue *l, const TValue *r);
|
|
extern int luaV_lessequal(lua_State *L, const TValue *l, const TValue *r);
|
|
extern void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val);
|
|
extern void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val);
|
|
extern int luaV_execute(lua_State *L);
|
|
extern int luaD_precall (lua_State *L, StkId func, int nresults, int op_call);
|
|
extern void raviV_op_newtable(lua_State *L, CallInfo *ci, TValue *ra, int b, int c);
|
|
extern void raviV_op_newarrayint(lua_State *L, CallInfo *ci, TValue *ra);
|
|
extern void raviV_op_newarrayfloat(lua_State *L, CallInfo *ci, TValue *ra);
|
|
extern void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2, TValue *res);
|
|
extern void raviV_op_setlist(lua_State *L, CallInfo *ci, TValue *ra, int b, int c);
|
|
extern void raviV_op_concat(lua_State *L, CallInfo *ci, int a, int b, int c);
|
|
extern void raviV_op_closure(lua_State *L, CallInfo *ci, LClosure *cl, int a, int Bx);
|
|
extern void raviV_op_vararg(lua_State *L, CallInfo *ci, LClosure *cl, int a, int b);
|
|
extern void luaV_objlen (lua_State *L, StkId ra, const TValue *rb);
|
|
extern int luaV_forlimit(const TValue *obj, lua_Integer *p, lua_Integer step, int *stopnow);
|
|
extern void raviV_op_setupval(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raviV_op_setupvali(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raviV_op_setupvalf(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raviV_op_setupvalai(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raviV_op_setupvalaf(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raviV_op_setupvalt(lua_State *L, LClosure *cl, TValue *ra, int b);
|
|
extern void raise_error(lua_State *L, int errorcode);
|
|
extern void raise_error_with_info(lua_State *L, int errorcode, const char *info);
|
|
extern void luaD_call (lua_State *L, StkId func, int nResults);
|
|
extern void raviH_set_int(lua_State *L, RaviArray *t, lua_Unsigned key, lua_Integer value);
|
|
extern void raviH_set_float(lua_State *L, RaviArray *t, lua_Unsigned key, lua_Number value);
|
|
extern int raviV_check_usertype(lua_State *L, TString *name, const TValue *o);
|
|
extern void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, TValue *res, TMS event);
|
|
extern void raviV_gettable_sskey(lua_State *L, const TValue *t, TValue *key, TValue *val);
|
|
extern void raviV_settable_sskey(lua_State *L, const TValue *t, TValue *key, TValue *val);
|
|
extern void raviV_gettable_i(lua_State *L, const TValue *t, TValue *key, TValue *val);
|
|
extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue *val);
|
|
extern lua_Integer luaV_shiftl(lua_Integer x, lua_Integer y);
|
|
extern void ravi_dump_value(lua_State *L, const struct lua_TValue *v);
|
|
extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
|
|
#define R(i) (base + i)
|
|
#define K(i) (k + i)
|
|
#define S(i) (stackbase + i)
|
|
#define stackoverflow(L, n) (((int)(L->top - L->stack) + (n) + 5) >= L->stacksize)
|
|
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
|
|
#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
|
|
#define tonumberns(o,n) \
|
|
(ttisfloat(o) ? ((n) = fltvalue(o), 1) : \
|
|
(ttisinteger(o) ? ((n) = cast_num(ivalue(o)), 1) : 0))
|
|
#define intop(op,v1,v2) l_castU2S(l_castS2U(v1) op l_castS2U(v2))
|
|
#define nan (0./0.)
|
|
#define inf (1./0.)
|
|
#define luai_numunm(L,a) (-(a))
|
|
extern int __ravifunc_1(lua_State *L);
|
|
int __ravifunc_1(lua_State *L) {
|
|
int error_code = 0;
|
|
int result = 0;
|
|
CallInfo *ci = L->ci;
|
|
LClosure *cl = clLvalue(ci->func);
|
|
TValue *k = cl->p->k;
|
|
StkId base = ci->u.l.base;
|
|
TValue ival0; settt_(&ival0, LUA_TNUMINT);
|
|
TValue fval0; settt_(&fval0, LUA_TNUMFLT);
|
|
TValue bval0; settt_(&bval0, LUA_TBOOLEAN);
|
|
TValue ival1; settt_(&ival1, LUA_TNUMINT);
|
|
TValue fval1; settt_(&fval1, LUA_TNUMFLT);
|
|
TValue bval1; settt_(&bval1, LUA_TBOOLEAN);
|
|
TValue nilval; setnilvalue(&nilval);
|
|
L0:
|
|
{
|
|
TValue *ra = R(1);
|
|
raviV_op_newtable(L, ci, ra, 0, 0);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
const TValue *src_reg = R(1);
|
|
TValue *dst_reg = R(0);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
raviV_op_closure(L, ci, cl, 2, 0);
|
|
base = ci->u.l.base;
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = K(0);
|
|
TValue *src = R(2);
|
|
raviV_settable_sskey(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
raviV_op_closure(L, ci, cl, 3, 1);
|
|
base = ci->u.l.base;
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = K(1);
|
|
TValue *src = R(3);
|
|
raviV_settable_sskey(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
raviV_op_closure(L, ci, cl, 4, 2);
|
|
base = ci->u.l.base;
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = K(2);
|
|
TValue *src = R(4);
|
|
raviV_settable_sskey(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
luaF_close(L, base);
|
|
{
|
|
TValue *stackbase = ci->func;
|
|
int wanted = ci->nresults;
|
|
result = wanted == -1 ? 0 : 1;
|
|
if (wanted == -1) wanted = 1;
|
|
int j = 0;
|
|
if (0 < wanted) {
|
|
{
|
|
const TValue *src_reg = R(0);
|
|
TValue *dst_reg = S(0);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
}
|
|
j++;
|
|
while (j < wanted) {
|
|
setnilvalue(S(j));
|
|
j++;
|
|
}
|
|
L->top = S(0) + wanted;
|
|
L->ci = ci->previous;
|
|
}
|
|
goto L1;
|
|
L1:
|
|
return result;
|
|
Lraise_error:
|
|
raise_error(L, error_code); /* does not return */
|
|
return result;
|
|
}
|
|
extern int __ravifunc_2(lua_State *L);
|
|
int __ravifunc_2(lua_State *L) {
|
|
int error_code = 0;
|
|
int result = 0;
|
|
CallInfo *ci = L->ci;
|
|
LClosure *cl = clLvalue(ci->func);
|
|
TValue *k = cl->p->k;
|
|
StkId base = ci->u.l.base;
|
|
lua_Integer i_0 = 0, i_1 = 0, i_2 = 0, i_3 = 0, i_4 = 0, i_5 = 0, i_6 = 0, i_7 = 0, i_8 = 0, i_9 = 0, i_10 = 0, i_11 = 0;
|
|
lua_Number f_0 = 0;
|
|
TValue ival0; settt_(&ival0, LUA_TNUMINT);
|
|
TValue fval0; settt_(&fval0, LUA_TNUMFLT);
|
|
TValue bval0; settt_(&bval0, LUA_TBOOLEAN);
|
|
TValue ival1; settt_(&ival1, LUA_TNUMINT);
|
|
TValue fval1; settt_(&fval1, LUA_TNUMFLT);
|
|
TValue bval1; settt_(&bval1, LUA_TBOOLEAN);
|
|
TValue nilval; setnilvalue(&nilval);
|
|
L0:
|
|
{
|
|
TValue *ra = R(0);
|
|
if (!ttisLtable(ra)) {
|
|
error_code = 4;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *len = R(3);
|
|
TValue *obj = R(0);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = &ival0; ival0.value_.i = 1;
|
|
TValue *dst = R(4);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *len = R(5);
|
|
TValue *obj = R(4);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(6);
|
|
raviV_op_newtable(L, ci, ra, 0, 0);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
const TValue *src_reg = R(6);
|
|
TValue *dst_reg = R(1);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *ra = R(5);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *reg = R(5);
|
|
i_1 = ivalue(reg);
|
|
}
|
|
{
|
|
TValue *ra = R(3);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *reg = R(3);
|
|
i_0 = ivalue(reg);
|
|
}
|
|
i_3 = 1;
|
|
i_4 = i_1;
|
|
i_5 = 1;
|
|
{ i_3 = i_3 - i_5; }
|
|
goto L2;
|
|
L1:
|
|
return result;
|
|
Lraise_error:
|
|
raise_error(L, error_code); /* does not return */
|
|
return result;
|
|
L2:
|
|
{ i_3 = i_3 + i_5; }
|
|
goto L3;
|
|
L3:
|
|
{ i_6 = i_4 < i_3; }
|
|
{ if (i_6 != 0) goto L5; else goto L4; }
|
|
L4:
|
|
i_2 = i_3;
|
|
{
|
|
TValue *tab = cl->upvals[0]->v;
|
|
TValue *name = K(0);
|
|
TValue *dst = R(3);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(3);
|
|
TValue *name = K(1);
|
|
TValue *dst = R(5);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
if (stackoverflow(L,4)) { luaD_growstack(L, 4); base = ci->u.l.base; }
|
|
L->top = R(5) + 3;
|
|
{
|
|
TValue *dst_reg = R(7);
|
|
setfltvalue(dst_reg, 0);
|
|
}
|
|
{
|
|
TValue *dst_reg = R(6);
|
|
setivalue(dst_reg, i_1);
|
|
}
|
|
{
|
|
TValue *ra = R(5);
|
|
int result = luaD_precall(L, ra, 1, 1);
|
|
if (result) {
|
|
if (result == 1 && 1 >= 0)
|
|
L->top = ci->top;
|
|
}
|
|
else { /* Lua function */
|
|
result = luaV_execute(L);
|
|
if (result) L->top = ci->top;
|
|
}
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(5);
|
|
if (!ttisfarray(ra)) {
|
|
error_code = 3;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
const TValue *src_reg = R(5);
|
|
TValue *dst_reg = R(2);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *tab = R(1);
|
|
TValue *name = &ival0; ival0.value_.i = i_2;
|
|
TValue *src = R(2);
|
|
raviV_settable_i(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
i_8 = 1;
|
|
i_9 = i_0;
|
|
i_10 = 1;
|
|
{ i_8 = i_8 - i_10; }
|
|
goto L6;
|
|
L5:
|
|
{
|
|
TValue *stackbase = ci->func;
|
|
int wanted = ci->nresults;
|
|
result = wanted == -1 ? 0 : 1;
|
|
if (wanted == -1) wanted = 1;
|
|
int j = 0;
|
|
if (0 < wanted) {
|
|
{
|
|
const TValue *src_reg = R(1);
|
|
TValue *dst_reg = S(0);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
}
|
|
j++;
|
|
while (j < wanted) {
|
|
setnilvalue(S(j));
|
|
j++;
|
|
}
|
|
L->top = S(0) + wanted;
|
|
L->ci = ci->previous;
|
|
}
|
|
goto L1;
|
|
L6:
|
|
{ i_8 = i_8 + i_10; }
|
|
goto L7;
|
|
L7:
|
|
{ i_11 = i_9 < i_8; }
|
|
{ if (i_11 != 0) goto L9; else goto L8; }
|
|
L8:
|
|
i_7 = i_8;
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = &ival0; ival0.value_.i = i_7;
|
|
TValue *dst = R(6);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(6);
|
|
TValue *name = &ival0; ival0.value_.i = i_2;
|
|
TValue *dst = R(7);
|
|
luaV_gettable(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(7);
|
|
lua_Number n = 0;
|
|
if (ttisnumber(ra)) { n = (ttisinteger(ra) ? (double) ivalue(ra) : fltvalue(ra)); setfltvalue(ra, n); }
|
|
else {
|
|
error_code = 1;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
RaviArray *arr = arrvalue(R(2));
|
|
lua_Unsigned ukey = (lua_Unsigned) i_7;
|
|
lua_Number *iptr = (lua_Number *)arr->data;
|
|
if (ukey < (lua_Unsigned)(arr->len)) {
|
|
iptr[ukey] = fltvalue(R(7));
|
|
} else {
|
|
raviH_set_float(L, arr, ukey, fltvalue(R(7)));
|
|
}
|
|
}
|
|
goto L6;
|
|
L9:
|
|
goto L2;
|
|
}
|
|
extern int __ravifunc_3(lua_State *L);
|
|
int __ravifunc_3(lua_State *L) {
|
|
int error_code = 0;
|
|
int result = 0;
|
|
CallInfo *ci = L->ci;
|
|
LClosure *cl = clLvalue(ci->func);
|
|
TValue *k = cl->p->k;
|
|
StkId base = ci->u.l.base;
|
|
lua_Integer i_0 = 0, i_1 = 0, i_2 = 0, i_3 = 0, i_4 = 0, i_5 = 0, i_6 = 0, i_7 = 0, i_8 = 0, i_9 = 0, i_10 = 0, i_11 = 0, i_12 = 0, i_13 = 0, i_14 = 0, i_15 = 0, i_16 = 0, i_17 = 0;
|
|
lua_Number f_0 = 0, f_1 = 0, f_2 = 0, f_3 = 0;
|
|
TValue ival0; settt_(&ival0, LUA_TNUMINT);
|
|
TValue fval0; settt_(&fval0, LUA_TNUMFLT);
|
|
TValue bval0; settt_(&bval0, LUA_TBOOLEAN);
|
|
TValue ival1; settt_(&ival1, LUA_TNUMINT);
|
|
TValue fval1; settt_(&fval1, LUA_TNUMFLT);
|
|
TValue bval1; settt_(&bval1, LUA_TBOOLEAN);
|
|
TValue nilval; setnilvalue(&nilval);
|
|
L0:
|
|
{
|
|
TValue *ra = R(0);
|
|
if (!ttisLtable(ra)) {
|
|
error_code = 4;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *ra = R(1);
|
|
if (!ttisLtable(ra)) {
|
|
error_code = 4;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *tab = cl->upvals[0]->v;
|
|
TValue *name = K(0);
|
|
TValue *dst = R(7);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = &ival0; ival0.value_.i = 1;
|
|
TValue *dst = R(8);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *len = R(9);
|
|
TValue *obj = R(8);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(9);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *len = R(10);
|
|
TValue *obj = R(1);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
int result = 0;
|
|
TValue *rb = R(9);
|
|
TValue *rc = R(10);
|
|
if (ttisinteger(rb) && ttisinteger(rc))
|
|
result = (ivalue(rb) == ivalue(rc));
|
|
else {
|
|
result = luaV_equalobj(L, rb, rc);
|
|
base = ci->u.l.base;
|
|
}
|
|
setbvalue(R(11), result != 0);
|
|
}
|
|
if (stackoverflow(L,3)) { luaD_growstack(L, 3); base = ci->u.l.base; }
|
|
L->top = R(7) + 2;
|
|
{
|
|
const TValue *src_reg = R(11);
|
|
TValue *dst_reg = R(8);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *ra = R(7);
|
|
int result = luaD_precall(L, ra, 1, 1);
|
|
if (result) {
|
|
if (result == 1 && 1 >= 0)
|
|
L->top = ci->top;
|
|
}
|
|
else { /* Lua function */
|
|
result = luaV_execute(L);
|
|
if (result) L->top = ci->top;
|
|
}
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *len = R(11);
|
|
TValue *obj = R(0);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = &ival0; ival0.value_.i = 1;
|
|
TValue *dst = R(10);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *len = R(9);
|
|
TValue *obj = R(10);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(1);
|
|
TValue *name = &ival0; ival0.value_.i = 1;
|
|
TValue *dst = R(12);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *len = R(13);
|
|
TValue *obj = R(12);
|
|
luaV_objlen(L, len, obj);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(14);
|
|
raviV_op_newtable(L, ci, ra, 0, 0);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
const TValue *src_reg = R(14);
|
|
TValue *dst_reg = R(2);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *ra = R(13);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *reg = R(13);
|
|
i_2 = ivalue(reg);
|
|
}
|
|
{
|
|
TValue *ra = R(9);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *reg = R(9);
|
|
i_1 = ivalue(reg);
|
|
}
|
|
{
|
|
TValue *ra = R(11);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *reg = R(11);
|
|
i_0 = ivalue(reg);
|
|
}
|
|
{
|
|
TValue *tab = cl->upvals[1]->v;
|
|
TValue *name = K(1);
|
|
TValue *dst = R(11);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
if (stackoverflow(L,3)) { luaD_growstack(L, 3); base = ci->u.l.base; }
|
|
L->top = R(11) + 2;
|
|
{
|
|
const TValue *src_reg = R(1);
|
|
TValue *dst_reg = R(12);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *ra = R(11);
|
|
int result = luaD_precall(L, ra, 1, 1);
|
|
if (result) {
|
|
if (result == 1 && 1 >= 0)
|
|
L->top = ci->top;
|
|
}
|
|
else { /* Lua function */
|
|
result = luaV_execute(L);
|
|
if (result) L->top = ci->top;
|
|
}
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(11);
|
|
if (!ttisLtable(ra)) {
|
|
error_code = 4;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
const TValue *src_reg = R(11);
|
|
TValue *dst_reg = R(3);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
i_4 = 1;
|
|
i_5 = i_0;
|
|
i_6 = 1;
|
|
{ i_4 = i_4 - i_6; }
|
|
goto L2;
|
|
L1:
|
|
return result;
|
|
Lraise_error:
|
|
raise_error(L, error_code); /* does not return */
|
|
return result;
|
|
L2:
|
|
{ i_4 = i_4 + i_6; }
|
|
goto L3;
|
|
L3:
|
|
{ i_7 = i_5 < i_4; }
|
|
{ if (i_7 != 0) goto L5; else goto L4; }
|
|
L4:
|
|
i_3 = i_4;
|
|
{
|
|
TValue *tab = cl->upvals[0]->v;
|
|
TValue *name = K(2);
|
|
TValue *dst = R(9);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(9);
|
|
TValue *name = K(3);
|
|
TValue *dst = R(13);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
if (stackoverflow(L,4)) { luaD_growstack(L, 4); base = ci->u.l.base; }
|
|
L->top = R(13) + 3;
|
|
{
|
|
TValue *dst_reg = R(15);
|
|
setfltvalue(dst_reg, 0);
|
|
}
|
|
{
|
|
TValue *dst_reg = R(14);
|
|
setivalue(dst_reg, i_2);
|
|
}
|
|
{
|
|
TValue *ra = R(13);
|
|
int result = luaD_precall(L, ra, 1, 1);
|
|
if (result) {
|
|
if (result == 1 && 1 >= 0)
|
|
L->top = ci->top;
|
|
}
|
|
else { /* Lua function */
|
|
result = luaV_execute(L);
|
|
if (result) L->top = ci->top;
|
|
}
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(13);
|
|
if (!ttisfarray(ra)) {
|
|
error_code = 3;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
const TValue *src_reg = R(13);
|
|
TValue *dst_reg = R(4);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *tab = R(2);
|
|
TValue *name = &ival0; ival0.value_.i = i_3;
|
|
TValue *src = R(4);
|
|
raviV_settable_i(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
i_9 = 1;
|
|
i_10 = i_2;
|
|
i_11 = 1;
|
|
{ i_9 = i_9 - i_11; }
|
|
goto L6;
|
|
L5:
|
|
{
|
|
TValue *stackbase = ci->func;
|
|
int wanted = ci->nresults;
|
|
result = wanted == -1 ? 0 : 1;
|
|
if (wanted == -1) wanted = 1;
|
|
int j = 0;
|
|
if (0 < wanted) {
|
|
{
|
|
const TValue *src_reg = R(2);
|
|
TValue *dst_reg = S(0);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
}
|
|
j++;
|
|
while (j < wanted) {
|
|
setnilvalue(S(j));
|
|
j++;
|
|
}
|
|
L->top = S(0) + wanted;
|
|
L->ci = ci->previous;
|
|
}
|
|
goto L1;
|
|
L6:
|
|
{ i_9 = i_9 + i_11; }
|
|
goto L7;
|
|
L7:
|
|
{ i_12 = i_10 < i_9; }
|
|
{ if (i_12 != 0) goto L9; else goto L8; }
|
|
L8:
|
|
i_8 = i_9;
|
|
{
|
|
TValue *tab = R(0);
|
|
TValue *name = &ival0; ival0.value_.i = i_3;
|
|
TValue *dst = R(14);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(14);
|
|
if (!ttisfarray(ra)) {
|
|
error_code = 3;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *tab = R(3);
|
|
TValue *name = &ival0; ival0.value_.i = i_8;
|
|
TValue *dst = R(15);
|
|
raviV_gettable_i(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(15);
|
|
if (!ttisfarray(ra)) {
|
|
error_code = 3;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
const TValue *src_reg = R(15);
|
|
TValue *dst_reg = R(6);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
const TValue *src_reg = R(14);
|
|
TValue *dst_reg = R(5);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
f_0 = 0;
|
|
i_14 = 1;
|
|
i_15 = i_1;
|
|
i_16 = 1;
|
|
{ i_14 = i_14 - i_16; }
|
|
goto L10;
|
|
L9:
|
|
goto L2;
|
|
L10:
|
|
{ i_14 = i_14 + i_16; }
|
|
goto L11;
|
|
L11:
|
|
{ i_17 = i_15 < i_14; }
|
|
{ if (i_17 != 0) goto L13; else goto L12; }
|
|
L12:
|
|
i_13 = i_14;
|
|
{
|
|
RaviArray *arr = arrvalue(R(5));
|
|
lua_Unsigned ukey = (lua_Unsigned) i_13;
|
|
lua_Number *iptr = (lua_Number *)arr->data;
|
|
f_1 = iptr[ukey];
|
|
}
|
|
{
|
|
RaviArray *arr = arrvalue(R(6));
|
|
lua_Unsigned ukey = (lua_Unsigned) i_13;
|
|
lua_Number *iptr = (lua_Number *)arr->data;
|
|
f_2 = iptr[ukey];
|
|
}
|
|
{ f_3 = f_1 * f_2; }
|
|
{ f_2 = f_0 + f_3; }
|
|
f_0 = f_2;
|
|
goto L10;
|
|
L13:
|
|
{
|
|
RaviArray *arr = arrvalue(R(4));
|
|
lua_Unsigned ukey = (lua_Unsigned) i_8;
|
|
lua_Number *iptr = (lua_Number *)arr->data;
|
|
if (ukey < (lua_Unsigned)(arr->len)) {
|
|
iptr[ukey] = f_0;
|
|
} else {
|
|
raviH_set_float(L, arr, ukey, f_0);
|
|
}
|
|
}
|
|
goto L6;
|
|
}
|
|
extern int __ravifunc_4(lua_State *L);
|
|
int __ravifunc_4(lua_State *L) {
|
|
int error_code = 0;
|
|
int result = 0;
|
|
CallInfo *ci = L->ci;
|
|
LClosure *cl = clLvalue(ci->func);
|
|
TValue *k = cl->p->k;
|
|
StkId base = ci->u.l.base;
|
|
lua_Integer i_0 = 0, i_1 = 0, i_2 = 0, i_3 = 0, i_4 = 0, i_5 = 0, i_6 = 0, i_7 = 0, i_8 = 0, i_9 = 0, i_10 = 0, i_11 = 0;
|
|
lua_Number f_0 = 0, f_1 = 0, f_2 = 0, f_3 = 0;
|
|
TValue ival0; settt_(&ival0, LUA_TNUMINT);
|
|
TValue fval0; settt_(&fval0, LUA_TNUMFLT);
|
|
TValue bval0; settt_(&bval0, LUA_TBOOLEAN);
|
|
TValue ival1; settt_(&ival1, LUA_TNUMINT);
|
|
TValue fval1; settt_(&fval1, LUA_TNUMFLT);
|
|
TValue bval1; settt_(&bval1, LUA_TBOOLEAN);
|
|
TValue nilval; setnilvalue(&nilval);
|
|
L0:
|
|
{
|
|
TValue *ra = R(0);
|
|
if (!ttisinteger(ra)) {
|
|
error_code = 0;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
TValue *ra = R(3);
|
|
raviV_op_newtable(L, ci, ra, 0, 0);
|
|
base = ci->u.l.base;
|
|
}
|
|
{ f_1 = 1 / ((lua_Number)(ivalue(R(0)))); }
|
|
{ f_2 = f_1 / ((lua_Number)(ivalue(R(0)))); }
|
|
f_0 = f_2;
|
|
{
|
|
const TValue *src_reg = R(3);
|
|
TValue *dst_reg = R(1);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
i_1 = 1;
|
|
{
|
|
TValue *reg = R(0);
|
|
i_2 = ivalue(reg);
|
|
}
|
|
i_3 = 1;
|
|
{ i_1 = i_1 - i_3; }
|
|
goto L2;
|
|
L1:
|
|
return result;
|
|
Lraise_error:
|
|
raise_error(L, error_code); /* does not return */
|
|
return result;
|
|
L2:
|
|
{ i_1 = i_1 + i_3; }
|
|
goto L3;
|
|
L3:
|
|
{ i_4 = i_2 < i_1; }
|
|
{ if (i_4 != 0) goto L5; else goto L4; }
|
|
L4:
|
|
i_0 = i_1;
|
|
{
|
|
TValue *tab = cl->upvals[0]->v;
|
|
TValue *name = K(0);
|
|
TValue *dst = R(3);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *tab = R(3);
|
|
TValue *name = K(1);
|
|
TValue *dst = R(4);
|
|
raviV_gettable_sskey(L, tab, name, dst);
|
|
base = ci->u.l.base;
|
|
}
|
|
if (stackoverflow(L,4)) { luaD_growstack(L, 4); base = ci->u.l.base; }
|
|
L->top = R(4) + 3;
|
|
{
|
|
TValue *dst_reg = R(6);
|
|
setfltvalue(dst_reg, 0);
|
|
}
|
|
{
|
|
const TValue *src_reg = R(0);
|
|
TValue *dst_reg = R(5);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *ra = R(4);
|
|
int result = luaD_precall(L, ra, 1, 1);
|
|
if (result) {
|
|
if (result == 1 && 1 >= 0)
|
|
L->top = ci->top;
|
|
}
|
|
else { /* Lua function */
|
|
result = luaV_execute(L);
|
|
if (result) L->top = ci->top;
|
|
}
|
|
base = ci->u.l.base;
|
|
}
|
|
{
|
|
TValue *ra = R(4);
|
|
if (!ttisfarray(ra)) {
|
|
error_code = 3;
|
|
goto Lraise_error;
|
|
}
|
|
}
|
|
{
|
|
const TValue *src_reg = R(4);
|
|
TValue *dst_reg = R(2);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
{
|
|
TValue *tab = R(1);
|
|
TValue *name = &ival0; ival0.value_.i = i_0;
|
|
TValue *src = R(2);
|
|
raviV_settable_i(L, tab, name, src);
|
|
base = ci->u.l.base;
|
|
}
|
|
i_6 = 1;
|
|
{
|
|
TValue *reg = R(0);
|
|
i_7 = ivalue(reg);
|
|
}
|
|
i_8 = 1;
|
|
{ i_6 = i_6 - i_8; }
|
|
goto L6;
|
|
L5:
|
|
{
|
|
TValue *stackbase = ci->func;
|
|
int wanted = ci->nresults;
|
|
result = wanted == -1 ? 0 : 1;
|
|
if (wanted == -1) wanted = 1;
|
|
int j = 0;
|
|
if (0 < wanted) {
|
|
{
|
|
const TValue *src_reg = R(1);
|
|
TValue *dst_reg = S(0);
|
|
dst_reg->tt_ = src_reg->tt_;
|
|
dst_reg->value_.n = src_reg->value_.n;
|
|
}
|
|
}
|
|
j++;
|
|
while (j < wanted) {
|
|
setnilvalue(S(j));
|
|
j++;
|
|
}
|
|
L->top = S(0) + wanted;
|
|
L->ci = ci->previous;
|
|
}
|
|
goto L1;
|
|
L6:
|
|
{ i_6 = i_6 + i_8; }
|
|
goto L7;
|
|
L7:
|
|
{ i_9 = i_7 < i_6; }
|
|
{ if (i_9 != 0) goto L9; else goto L8; }
|
|
L8:
|
|
i_5 = i_6;
|
|
{ i_10 = i_0 - i_5; }
|
|
{ f_1 = f_0 * ((lua_Number)(i_10)); }
|
|
{ i_10 = i_0 + i_5; }
|
|
{ i_11 = i_10 - 2; }
|
|
{ f_3 = f_1 * ((lua_Number)(i_11)); }
|
|
{
|
|
RaviArray *arr = arrvalue(R(2));
|
|
lua_Unsigned ukey = (lua_Unsigned) i_5;
|
|
lua_Number *iptr = (lua_Number *)arr->data;
|
|
if (ukey < (lua_Unsigned)(arr->len)) {
|
|
iptr[ukey] = f_3;
|
|
} else {
|
|
raviH_set_float(L, arr, ukey, f_3);
|
|
}
|
|
}
|
|
goto L6;
|
|
L9:
|
|
goto L2;
|
|
}
|
|
|
|
time taken 0.98
|
|
-95.5835833333
|