issue #198 Initial support for AOT compiled code

pull/200/head
Dibyendu Majumdar 3 years ago
parent 0f6a4084ae
commit 001dceb996

@ -366,11 +366,14 @@ LUA_API int (lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
lua_KContext ctx, lua_KFunction k);
#define lua_pcall(L,n,r,f) lua_pcallk(L, (n), (r), (f), 0, NULL)
/* A Lua Closure must be on top of the stack. This will set _ENV upvalue */
LUA_API void (ravi_closure_setenv) (lua_State* L);
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname, const char *mode);
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data, int strip);
LUA_API void (raviV_raise_error) (lua_State *L, int errorcode);
/*
** coroutine functions

@ -281,14 +281,17 @@
** give a warning about it. To avoid these warnings, change to the
** default definition.
*/
#if 0
#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
defined(__ELF__) /* { */
#define LUAI_FUNC __attribute__((visibility("internal"))) extern
#else /* }{ */
#define LUAI_FUNC extern
#endif /* } */
#endif
#define LUAI_FUNC LUA_API /* AOT code needs to access symbols */
#define LUAI_DDEC LUAI_FUNC
#define LUAI_DDEC extern
#define LUAI_DDEF /* empty */
/* }================================================================== */

@ -122,6 +122,8 @@ LUAI_FUNC bool raviJ_cancompile(Proto *p);
LUAI_FUNC bool raviJ_codegen(struct lua_State *L, struct Proto *p,
struct ravi_compile_options_t *options,
const char *fname, membuff_t *buf);
void raviV_raise_error(lua_State *L, int errorcode);
void raviV_raise_error_with_info(lua_State *L, int errorcode, const char *info);
#ifdef __cplusplus
};

@ -1329,6 +1329,17 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc,
return status;
}
LUA_API void ravi_closure_setenv(lua_State* L) {
LClosure *f = clLvalue(L->top - 1); /* get newly created function */
if (f->nupvalues >= 1) { /* does it have an upvalue? */
/* get global table from registry */
Table *reg = hvalue(&G(L)->l_registry);
const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
setobj(L, f->upvals[0]->v, gt);
luaC_upvalbarrier(L, f->upvals[0], gt);
}
}
LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
const char *chunkname, const char *mode) {
@ -1339,15 +1350,7 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
luaZ_init(L, &z, reader, data);
status = luaD_protectedparser(L, &z, chunkname, mode);
if (status == LUA_OK) { /* no errors? */
LClosure *f = clLvalue(L->top - 1); /* get newly created function */
if (f->nupvalues >= 1) { /* does it have an upvalue? */
/* get global table from registry */
Table *reg = hvalue(&G(L)->l_registry);
const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
setobj(L, f->upvals[0]->v, gt);
luaC_upvalbarrier(L, f->upvals[0], gt);
}
ravi_closure_setenv(L);
}
lua_unlock(L);
return status;

@ -22,6 +22,8 @@
#include "lauxlib.h"
#include "lualib.h"
#include "lobject.h"
#include "lfunc.h"
/*
@ -404,6 +406,55 @@ static int ll_loadlib (lua_State *L) {
}
}
/*
** Look for a compiled Ravi function named 'sym' in a dynamically loaded library
** 'path'.
** First, check whether the library is already loaded; if not, try
** to load it.
** Then, if 'sym' is '*', return true (as library has been loaded).
** Otherwise, look for symbol 'sym' in the library and push a
** C function with that symbol.
** Return 0 and 'true' or a function in the stack; in case of
** errors, return an error code and an error message in the stack.
*/
static int ravi_lookforfunc (lua_State *L, const char *path, const char *sym) {
void *reg = checkclib(L, path); /* check loaded C libraries */
if (reg == NULL) { /* must load library? */
reg = lsys_load(L, path, *sym == '*'); /* global symbols if 'sym'=='*' */
if (reg == NULL) return ERRLIB; /* unable to load library */
addtoclib(L, path, reg);
}
if (*sym == '*') { /* loading only library (no function)? */
lua_pushboolean(L, 1); /* return 'true' */
return 0; /* no errors */
}
else {
LClosure* (*load_in_lua)(lua_State * L);
load_in_lua = lsys_sym(L, reg, sym);
if (load_in_lua == NULL)
return ERRFUNC; /* unable to find function */
LClosure* cl = load_in_lua(L);
lua_assert(cl->nupvalues == cl->p->sizeupvalues);
luaF_initupvals(L, cl);
ravi_closure_setenv(L);
return 0; /* no errors */
}
}
static int ravi_loadlib (lua_State *L) {
const char *path = luaL_checkstring(L, 1);
const char *init = luaL_checkstring(L, 2);
int stat = ravi_lookforfunc(L, path, init);
if (stat == 0) /* no errors? */
return 1; /* return the loaded function */
else { /* error; error message is on stack top */
lua_pushnil(L);
lua_insert(L, -2);
lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init");
return 3; /* return nil, error message, and where */
}
}
/*
@ -707,6 +758,7 @@ static int ll_seeall (lua_State *L) {
static const luaL_Reg pk_funcs[] = {
{"loadlib", ll_loadlib},
{ "load_ravi_lib", ravi_loadlib },
{"searchpath", ll_searchpath},
#if defined(LUA_COMPAT_MODULE)
{"seeall", ll_seeall},

@ -40,14 +40,7 @@ static void setup_lua_closure(lua_State* L, LClosure* (*load_in_lua)(lua_State*)
LClosure* cl = load_in_lua(L);
lua_assert(cl->nupvalues == cl->p->sizeupvalues);
luaF_initupvals(L, cl);
if (cl->nupvalues >= 1) { /* does it have an upvalue? */
/* get global table from registry */
Table* reg = hvalue(&G(L)->l_registry);
const TValue* gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
/* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
setobj(L, cl->upvals[0]->v, gt);
luaC_upvalbarrier(L, cl->upvals[0], gt);
}
ravi_closure_setenv(L);
}
static int load_and_compile(lua_State* L) {

@ -589,8 +589,8 @@ static const char Lua_header[] =
"extern void raviV_op_setupvalai(lua_State *L, LClosure *cl, TValue *ra, int b);\n"
"extern void raviV_op_setupvalaf(lua_State *L, LClosure *cl, TValue *ra, int b);\n"
"extern void raviV_op_setupvalt(lua_State *L, LClosure *cl, TValue *ra, int b);\n"
"extern void raise_error(lua_State *L, int errorcode);\n"
"extern void raise_error_with_info(lua_State *L, int errorcode, const char *info);\n"
"extern void raviV_raise_error(lua_State *L, int errorcode);\n"
"extern void raviV_raise_error_with_info(lua_State *L, int errorcode, const char *info);\n"
"extern void luaD_call (lua_State *L, StkId func, int nResults);\n"
"extern void raviH_set_int(lua_State *L, RaviArray *t, lua_Unsigned key, lua_Integer value);\n"
"extern void raviH_set_float(lua_State *L, RaviArray *t, lua_Unsigned key, lua_Number value);\n"
@ -720,7 +720,7 @@ static void emit_IARRAY_GET(struct function *fn, int A, int B, int C, bool omitA
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_array_out_of_bounds);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_array_out_of_bounds);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_array_out_of_bounds);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -744,7 +744,7 @@ static void emit_FARRAY_GET(struct function *fn, int A, int B, int C, bool omitA
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_array_out_of_bounds);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_array_out_of_bounds);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_array_out_of_bounds);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -780,7 +780,7 @@ static void emit_IARRAY_SET(struct function *fn, int A, int B, int C, bool known
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_integer_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_integer_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_integer_expected);
#endif
membuff_add_string(&fn->body, "}\n");
membuff_add_string(&fn->body, "i = ivalue(rc);\n");
@ -821,7 +821,7 @@ static void emit_FARRAY_SET(struct function *fn, int A, int B, int C, bool known
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_number_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_number_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_number_expected);
#endif
membuff_add_string(&fn->body, "}\n");
membuff_add_string(&fn->body, "n = (ttisinteger(rc) ? (double)ivalue(rc) : fltvalue(rc));\n");
@ -1165,7 +1165,7 @@ static void emit_op_testset(struct function *fn, int A, int B, int C, int j, int
static void emit_endf(struct function *fn) {
membuff_add_string(&fn->body, "Lraise_error:\n");
membuff_add_string(&fn->body, "raise_error(L, error_code); /* does not return */\n");
membuff_add_string(&fn->body, "raviV_raise_error(L, error_code); /* does not return */\n");
membuff_add_string(&fn->body, "return 0;\n");
membuff_add_string(&fn->body, "}\n");
}
@ -1454,7 +1454,7 @@ static void emit_op_movei(struct function *fn, int A, int B, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_integer_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_integer_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_integer_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1472,7 +1472,7 @@ static void emit_op_movef(struct function *fn, int A, int B, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_number_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_number_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_number_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1487,7 +1487,7 @@ static void emit_op_MOVEIARRAY(struct function *fn, int A, int B, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_integer_array_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_integer_array_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_integer_array_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1502,7 +1502,7 @@ static void emit_op_MOVEFARRAY(struct function *fn, int A, int B, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_number_array_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_number_array_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_number_array_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1517,7 +1517,7 @@ static void emit_op_movetab(struct function *fn, int A, int B, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_table_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_table_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_table_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1532,7 +1532,7 @@ static void emit_op_toint(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_integer_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_integer_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_integer_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1549,7 +1549,7 @@ static void emit_op_toflt(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_number_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_number_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_number_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1562,7 +1562,7 @@ static void emit_op_toai(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_integer_array_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_integer_array_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_integer_array_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1575,7 +1575,7 @@ static void emit_op_toaf(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_number_array_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_number_array_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_number_array_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1588,7 +1588,7 @@ static void emit_op_totab(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_table_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_table_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_table_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1601,7 +1601,7 @@ static void emit_op_toclosure(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_closure_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_closure_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_closure_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1614,7 +1614,7 @@ static void emit_op_tostring(struct function *fn, int A, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_string_expected);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_string_expected);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_string_expected);
#endif
membuff_add_string(&fn->body, "}\n");
}
@ -1629,7 +1629,7 @@ static void emit_op_totype(struct function *fn, int A, int Bx, int pc) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_type_mismatch);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error_with_info(L, %d, getstr(tsvalue(rb)));\n", Error_type_mismatch);
membuff_add_fstring(&fn->body, " raviV_raise_error_with_info(L, %d, getstr(tsvalue(rb)));\n", Error_type_mismatch);
#endif
membuff_add_string(&fn->body, " }\n");
membuff_add_string(&fn->body, "}\n");
@ -1732,7 +1732,7 @@ static void emit_op_forprep(struct function *fn, int A, int pc, int pc1) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_for_limit_must_be_number);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_for_limit_must_be_number);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_for_limit_must_be_number);
#endif
membuff_add_string(&fn->body, " }\n");
membuff_add_fstring(&fn->body, " if (!ttisnumber(rc)) {\n", A);
@ -1740,7 +1740,7 @@ static void emit_op_forprep(struct function *fn, int A, int pc, int pc1) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_for_step_must_be_number);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_for_step_must_be_number);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_for_step_must_be_number);
#endif
membuff_add_string(&fn->body, " }\n");
membuff_add_fstring(&fn->body, " if (!ttisnumber(ra)) {\n", A);
@ -1748,7 +1748,7 @@ static void emit_op_forprep(struct function *fn, int A, int pc, int pc1) {
membuff_add_fstring(&fn->body, " error_code = %d;\n", Error_for_initial_value_must_be_number);
membuff_add_string(&fn->body, " goto Lraise_error;\n");
#else
membuff_add_fstring(&fn->body, " raise_error(L, %d);\n", Error_for_initial_value_must_be_number);
membuff_add_fstring(&fn->body, " raviV_raise_error(L, %d);\n", Error_for_initial_value_must_be_number);
#endif
membuff_add_string(&fn->body, " }\n");
membuff_add_fstring(&fn->body, " tonumberns(rb, nlimit_%d);\n", A);
@ -2335,3 +2335,32 @@ bool raviJ_codegen(struct lua_State *L, struct Proto *p, struct ravi_compile_opt
cleanup(&fn);
return true;
}
static const char *errortext[] = {"integer expected",
"number expected",
"integer[] expected",
"number[] expected",
"table expected",
"upvalue of integer type, cannot be set to non integer value",
"upvalue of number type, cannot be set to non number value",
"upvalue of integer[] type, cannot be set to non integer[] value",
"upvalue of number[] type, cannot be set to non number[] value",
"upvalue of table type, cannot be set to non table value",
"for llimit must be a number",
"for step must be a number",
"for initial value must be a number",
"array index is out of bounds",
"string expected",
"closure expected",
"type mismatch: wrong userdata type",
NULL};
void raviV_raise_error(lua_State *L, int errorcode) {
assert(errorcode >= 0 && errorcode < Error_type_mismatch);
luaG_runerror(L, errortext[errorcode]);
}
void raviV_raise_error_with_info(lua_State *L, int errorcode, const char *info) {
assert(errorcode == Error_type_mismatch);
luaG_runerror(L, "type mismatch: expected %s", info);
}

@ -57,11 +57,6 @@ static const char *errortext[] = {"integer expected",
"type mismatch: wrong userdata type",
NULL};
static void raise_error(lua_State *L, int errorcode) {
assert(errorcode >= 0 && errorcode <= Error_type_mismatch);
luaG_runerror(L, errortext[errorcode]);
}
static struct {
const char *name;
void *address;
@ -187,7 +182,7 @@ static struct {
{"raviV_op_defer", reinterpret_cast<void *>(raviV_op_defer)},
#endif
{"raviV_debug_trace", reinterpret_cast<void *>(raviV_debug_trace)},
{"raise_error", reinterpret_cast<void *>(raise_error)},
{"raviV_raise_error", reinterpret_cast<void *>(raviV_raise_error)},
{"printf", reinterpret_cast<void *>(printf)},
{"puts", reinterpret_cast<void *>(puts)},
{nullptr, nullptr}};

@ -33,34 +33,6 @@
#include "lstate.h"
#include "lua.h"
static const char *errortext[] = {"integer expected",
"number expected",
"integer[] expected",
"number[] expected",
"table expected",
"upvalue of integer type, cannot be set to non integer value",
"upvalue of number type, cannot be set to non number value",
"upvalue of integer[] type, cannot be set to non integer[] value",
"upvalue of number[] type, cannot be set to non number[] value",
"upvalue of table type, cannot be set to non table value",
"for llimit must be a number",
"for step must be a number",
"for initial value must be a number",
"array index is out of bounds",
"string expected",
"closure expected",
"type mismatch: wrong userdata type",
NULL};
static void raise_error(lua_State *L, int errorcode) {
assert(errorcode >= 0 && errorcode < Error_type_mismatch);
luaG_runerror(L, errortext[errorcode]);
}
static void raise_error_with_info(lua_State *L, int errorcode, const char *info) {
assert(errorcode == Error_type_mismatch);
luaG_runerror(L, "type mismatch: expected %s", info);
}
#if !RAVI_TARGET_X64
#error MIRJIT is currently only supported on X64 architecture
@ -73,8 +45,8 @@ typedef struct LuaFunc {
static LuaFunc Lua_functions[] = {
{ "luaF_close", luaF_close },
{ "raise_error", raise_error },
{ "raise_error_with_info", raise_error_with_info },
{ "raviV_raise_error", raviV_raise_error },
{ "raviV_raise_error_with_info", raviV_raise_error_with_info },
{ "luaV_tonumber_", luaV_tonumber_ },
{ "luaV_tointeger", luaV_tointeger },
{ "luaV_shiftl", luaV_shiftl },

@ -1,7 +1,8 @@
define Proc%1
L0 (entry)
RET {1 Kint(0), 'hello' Ks(1), 5.600000000000 Kflt(2), true} {L1}
RET {1 Kint(0), 'hello' Ks(0), 5.600000000000 Kflt(0), true} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -13,10 +14,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -545,8 +554,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -559,6 +568,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -572,8 +588,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -634,7 +649,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 0;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "hello", 5));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,10 +1,11 @@
define Proc%1
L0 (entry)
MOV {'hi' Ks(1)} {local(c, 2)}
MOV {'hi' Ks(0)} {local(c, 2)}
MOV {true} {local(b, 1)}
MOV {4.200000000000 Kflt(0)} {local(a, 0)}
RET {local(a, 0), local(b, 1), local(c, 2)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -16,10 +17,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -548,8 +557,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -562,6 +571,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -575,8 +591,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -648,7 +663,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "hi", 2));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -10,6 +10,7 @@ L2
BR {L3}
L3
RET {T(0)} {L1}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -21,10 +22,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -553,8 +562,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -567,6 +576,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -580,8 +596,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -618,7 +633,7 @@ else goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -653,4 +668,29 @@ dst_reg->value_.n = src_reg->value_.n;
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -10,6 +10,7 @@ L2
BR {L3}
L3
RET {T(0)} {L1}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -21,10 +22,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -553,8 +562,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -567,6 +576,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -580,8 +596,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -618,7 +633,7 @@ else goto L3;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -653,4 +668,29 @@ dst_reg->value_.n = src_reg->value_.n;
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -9,6 +9,7 @@ L2
BR {L3}
L3
RET {T(0)} {L1}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -20,10 +21,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -552,8 +561,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -566,6 +575,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -579,8 +595,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -611,7 +626,7 @@ else goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -646,4 +661,29 @@ dst_reg->value_.n = src_reg->value_.n;
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 2;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -9,6 +9,7 @@ L2
BR {L3}
L3
RET {T(0)} {L1}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -20,10 +21,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -552,8 +561,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -566,6 +575,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -579,8 +595,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -611,7 +626,7 @@ else goto L3;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -646,4 +661,29 @@ dst_reg->value_.n = src_reg->value_.n;
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 2;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,8 +1,9 @@
define Proc%1
L0 (entry)
STOREGLOBAL {1 Kint(1)} {Upval(_ENV), 'x' Ks(0)}
STOREGLOBAL {1 Kint(0)} {Upval(_ENV), 'x' Ks(0)}
RET {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -14,10 +15,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -546,8 +555,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -560,6 +569,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -573,8 +589,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -613,7 +628,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "x", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -4,6 +4,7 @@ L0 (entry)
LOADGLOBAL {Upval(_ENV), 'y' Ks(1)} {T(1)}
RET {T(0), T(1)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -15,10 +16,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -547,8 +556,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -561,6 +570,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -574,8 +590,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -639,7 +654,40 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 2;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "x", 1));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "y", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -6,6 +6,7 @@ L0 (entry)
STOREGLOBAL {T(2)} {Upval(_ENV), 'x' Ks(0)}
RET {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -17,10 +18,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -549,8 +558,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -563,6 +572,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -576,8 +592,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -594,28 +609,28 @@ TValue nilval; setnilvalue(&nilval);
L0:
{
TValue *tab = cl->upvals[0]->v;
TValue *name = K(0);
TValue *name = K(1);
TValue *dst = R(2);
raviV_gettable_sskey(L, tab, name, dst);
base = ci->u.l.base;
}
{
TValue *tab = cl->upvals[0]->v;
TValue *name = K(1);
TValue *name = K(0);
TValue *dst = R(3);
raviV_gettable_sskey(L, tab, name, dst);
base = ci->u.l.base;
}
{
TValue *tab = cl->upvals[0]->v;
TValue *name = K(0);
TValue *name = K(1);
TValue *src = R(3);
raviV_settable_sskey(L, tab, name, src);
base = ci->u.l.base;
}
{
TValue *tab = cl->upvals[0]->v;
TValue *name = K(1);
TValue *name = K(0);
TValue *src = R(2);
raviV_settable_sskey(L, tab, name, src);
base = ci->u.l.base;
@ -637,7 +652,40 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 4;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "x", 1));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "y", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,9 +1,10 @@
define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'g' Ks(0)} {T(0)}
CALL {T(0)} {T(0..), -1 Kint(1)}
CALL {T(0)} {T(0..), -1 Kint(0)}
RET {T(0..)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -15,10 +16,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -547,8 +556,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -561,6 +570,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -574,8 +590,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -640,7 +655,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "g", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,9 +1,10 @@
define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'g' Ks(0)} {T(0)}
CALL {T(0)} {T(0..), -1 Kint(1)}
CALL {T(0)} {T(0..), -1 Kint(0)}
RET {T(0..)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -15,10 +16,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -547,8 +556,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -561,6 +570,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -574,8 +590,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -640,7 +655,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "g", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,9 +1,10 @@
define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'g' Ks(0)} {T(0)}
CALL {T(0)} {T(0), 1 Kint(1)}
RET {T(0), 1 Kint(1)} {L1}
CALL {T(0)} {T(0), 1 Kint(0)}
RET {T(0), 1 Kint(0)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -15,10 +16,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -547,8 +556,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -561,6 +570,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -574,8 +590,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -644,7 +659,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "g", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,9 +1,10 @@
define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'g' Ks(1)} {T(0)}
CALL {T(0)} {T(0), 1 Kint(2)}
RET {0 Kint(0), T(0), 1 Kint(2)} {L1}
LOADGLOBAL {Upval(_ENV), 'g' Ks(0)} {T(0)}
CALL {T(0)} {T(0), 1 Kint(1)}
RET {0 Kint(0), T(0), 1 Kint(1)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -15,10 +16,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -547,8 +556,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -561,6 +570,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -574,8 +590,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -651,7 +666,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "g", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -1,7 +1,8 @@
define Proc%1
L0 (entry)
RET {3 Kint(0), 4.200000000000 Kflt(1)} {L1}
RET {3 Kint(0), 4.200000000000 Kflt(0)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -13,10 +14,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -545,8 +554,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -559,6 +568,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -572,8 +588,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -619,16 +634,41 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 0;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'g' Ks(1)} {T(0)}
CALL {T(0)} {T(0), 1 Kint(2)}
RET {0 Kint(0), T(0), 1 Kint(2)} {L1}
LOADGLOBAL {Upval(_ENV), 'g' Ks(0)} {T(0)}
CALL {T(0)} {T(0), 1 Kint(1)}
RET {0 Kint(0), T(0), 1 Kint(1)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -640,10 +680,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -1172,8 +1220,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -1186,6 +1234,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -1199,8 +1254,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1276,7 +1330,36 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_1(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "g", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -2,16 +2,16 @@ define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'table' Ks(0)} {T(0)}
GETsk {T(0), 'intarray' Ks(1)} {T(1)}
CALL {T(1), 10 Kint(2)} {T(1..), 1 Kint(3)}
CALL {T(1), 10 Kint(0)} {T(1..), 1 Kint(1)}
TOIARRAY {T(1[1..])}
MOV {T(1[1..])} {local(arr, 0)}
IAPUTiv {10 Kint(2)} {local(arr, 0), 0 Kint(4)}
IAPUTiv {2 Kint(6)} {local(arr, 0), 4 Kint(5)}
IAPUTiv {6 Kint(8)} {local(arr, 0), 11 Kint(7)}
MOVi {0 Kint(4)} {Tint(0)}
MOV {0 Kint(4)} {Tint(2)}
MOV {11 Kint(7)} {Tint(3)}
MOV {1 Kint(3)} {Tint(4)}
IAPUTiv {10 Kint(0)} {local(arr, 0), 0 Kint(2)}
IAPUTiv {2 Kint(4)} {local(arr, 0), 4 Kint(3)}
IAPUTiv {6 Kint(6)} {local(arr, 0), 11 Kint(5)}
MOVi {0 Kint(2)} {Tint(0)}
MOV {0 Kint(2)} {Tint(2)}
MOV {11 Kint(5)} {Tint(3)}
MOV {1 Kint(1)} {Tint(4)}
SUBii {Tint(2), Tint(4)} {Tint(2)}
BR {L2}
L1 (exit)
@ -23,15 +23,16 @@ L3
CBR {Tbool(5)} {L5, L4}
L4
MOV {Tint(2)} {Tint(1)}
LOADGLOBAL {Upval(_ENV), 'print' Ks(9)} {T(2)}
LOADGLOBAL {Upval(_ENV), 'print' Ks(2)} {T(2)}
IAGETik {local(arr, 0), Tint(1)} {Tint(6)}
CALL {T(2), Tint(6)} {T(2..), 1 Kint(3)}
CALL {T(2), Tint(6)} {T(2..), 1 Kint(1)}
IAGETik {local(arr, 0), Tint(1)} {Tint(6)}
ADDii {Tint(0), Tint(6)} {Tint(7)}
MOVi {Tint(7)} {Tint(0)}
BR {L2}
L5
RET {Tint(0), local(arr, 0)} {L1}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -43,10 +44,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -575,8 +584,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -589,6 +598,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -602,8 +618,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -704,7 +719,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_2 = i_2 + i_4; }
@ -787,6 +802,42 @@ dst_reg->value_.n = src_reg->value_.n;
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 4;
f->k = luaM_newvector(L, 3, TValue);
f->sizek = 3;
for (int i = 0; i < 3; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "intarray", 8));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "print", 5));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
10
0
@ -800,3 +851,4 @@ goto L1;
0
0
6
Ok

@ -2,12 +2,12 @@ define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'table' Ks(0)} {T(0)}
GETsk {T(0), 'intarray' Ks(1)} {T(1)}
CALL {T(1), 8190 Kint(2)} {T(1..), 1 Kint(3)}
CALL {T(1), 8190 Kint(0)} {T(1..), 1 Kint(1)}
TOIARRAY {T(1[1..])}
MOV {T(1[1..])} {local(flags, 0)}
MOV {0 Kint(4)} {Tint(5)}
MOV {100000 Kint(5)} {Tint(6)}
MOV {1 Kint(3)} {Tint(7)}
MOV {0 Kint(2)} {Tint(5)}
MOV {100000 Kint(3)} {Tint(6)}
MOV {1 Kint(1)} {Tint(7)}
SUBii {Tint(5), Tint(7)} {Tint(5)}
BR {L2}
L1 (exit)
@ -19,10 +19,10 @@ L3
CBR {Tbool(8)} {L5, L4}
L4
MOV {Tint(5)} {Tint(4)}
MOVi {0 Kint(4)} {Tint(3)}
MOV {0 Kint(4)} {Tint(10)}
MOV {8190 Kint(2)} {Tint(11)}
MOV {1 Kint(3)} {Tint(12)}
MOVi {0 Kint(2)} {Tint(3)}
MOV {0 Kint(2)} {Tint(10)}
MOV {8190 Kint(0)} {Tint(11)}
MOV {1 Kint(1)} {Tint(12)}
SUBii {Tint(10), Tint(12)} {Tint(10)}
BR {L6}
L5
@ -35,12 +35,12 @@ L7
CBR {Tbool(13)} {L9, L8}
L8
MOV {Tint(10)} {Tint(9)}
IAPUTiv {1 Kint(3)} {local(flags, 0), Tint(9)}
IAPUTiv {1 Kint(1)} {local(flags, 0), Tint(9)}
BR {L6}
L9
MOV {0 Kint(4)} {Tint(11)}
MOV {8190 Kint(2)} {Tint(12)}
MOV {1 Kint(3)} {Tint(13)}
MOV {0 Kint(2)} {Tint(11)}
MOV {8190 Kint(0)} {Tint(12)}
MOV {1 Kint(1)} {Tint(13)}
SUBii {Tint(11), Tint(13)} {Tint(11)}
BR {L10}
L10
@ -56,17 +56,17 @@ L13
BR {L2}
L14
IAGETik {local(flags, 0), Tint(10)} {Tint(14)}
EQii {Tint(14), 1 Kint(3)} {Tbool(15)}
EQii {Tint(14), 1 Kint(1)} {Tbool(15)}
CBR {Tbool(15)} {L15, L16}
L15
ADDii {Tint(10), Tint(10)} {Tint(14)}
ADDii {Tint(14), 3 Kint(6)} {Tint(16)}
ADDii {Tint(14), 3 Kint(4)} {Tint(16)}
MOVi {Tint(16)} {Tint(2)}
ADDii {Tint(10), Tint(2)} {Tint(14)}
MOV {Tint(14)} {Tint(17)}
MOV {8190 Kint(2)} {Tint(18)}
MOV {8190 Kint(0)} {Tint(18)}
MOV {Tint(2)} {Tint(19)}
LIii {0 Kint(4), Tint(19)} {Tbool(20)}
LIii {0 Kint(2), Tint(19)} {Tbool(20)}
SUBii {Tint(17), Tint(19)} {Tint(17)}
BR {L17}
L16
@ -82,12 +82,13 @@ L19
CBR {Tbool(21)} {L21, L20}
L20
MOV {Tint(17)} {Tint(16)}
IAPUTiv {0 Kint(4)} {local(flags, 0), Tint(16)}
IAPUTiv {0 Kint(2)} {local(flags, 0), Tint(16)}
BR {L17}
L21
ADDii {Tint(3), 1 Kint(3)} {Tint(17)}
ADDii {Tint(3), 1 Kint(1)} {Tint(17)}
MOVi {Tint(17)} {Tint(3)}
BR {L16}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -99,10 +100,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -631,8 +640,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -645,6 +654,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -658,8 +674,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -729,7 +744,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_5 = i_5 + i_7; }
@ -852,6 +867,39 @@ L21:
i_3 = i_17;
goto L16;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "intarray", 8));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
time taken 6.58
time taken 8.444
1899
Ok

@ -11,6 +11,7 @@ L0 (entry)
FAPUTfv {local(value, 2)} {local(arr, 0), local(i, 1)}
RET {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -22,10 +23,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -554,8 +563,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -568,6 +577,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -581,8 +597,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -626,11 +641,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_2(lua_State *L);
int __ravifunc_2(lua_State *L) {
static int __ravifunc_2(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -696,7 +710,52 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_2;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 3;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 0, Upvaldesc);
f->sizeupvalues = 0;
f = parent;
}
return cl;
}
Ok

@ -2,68 +2,69 @@ define Proc%1
L0 (entry)
LOADGLOBAL {Upval(_ENV), 'table' Ks(0)} {T(0)}
GETsk {T(0), 'intarray' Ks(1)} {T(1)}
CALL {T(1), 8190 Kint(2)} {T(1..), 1 Kint(3)}
CALL {T(1), 8190 Kint(0)} {T(1..), 1 Kint(1)}
TOIARRAY {T(1[1..])}
MOV {T(1[1..])} {local(flags, 0)}
MOVi {0 Kint(4)} {Tint(4)}
MOVi {0 Kint(2)} {Tint(4)}
BR {L2}
L1 (exit)
L2
LEii {Tint(4), 100000 Kint(5)} {Tbool(5)}
LEii {Tint(4), 100000 Kint(3)} {Tbool(5)}
CBR {Tbool(5)} {L3, L4}
L3
MOVi {0 Kint(4)} {Tint(3)}
MOVi {0 Kint(4)} {Tint(0)}
MOVi {0 Kint(2)} {Tint(3)}
MOVi {0 Kint(2)} {Tint(0)}
BR {L5}
L4
RET {Tint(3)} {L1}
L5
LEii {Tint(0), 8190 Kint(2)} {Tbool(5)}
LEii {Tint(0), 8190 Kint(0)} {Tbool(5)}
CBR {Tbool(5)} {L6, L7}
L6
IAPUTiv {1 Kint(3)} {local(flags, 0), Tint(0)}
ADDii {Tint(0), 1 Kint(3)} {Tint(5)}
IAPUTiv {1 Kint(1)} {local(flags, 0), Tint(0)}
ADDii {Tint(0), 1 Kint(1)} {Tint(5)}
MOVi {Tint(5)} {Tint(0)}
BR {L5}
L7
MOVi {0 Kint(4)} {Tint(0)}
MOVi {0 Kint(2)} {Tint(0)}
BR {L8}
L8
LEii {Tint(0), 8190 Kint(2)} {Tbool(5)}
LEii {Tint(0), 8190 Kint(0)} {Tbool(5)}
CBR {Tbool(5)} {L9, L10}
L9
BR {L11}
L10
ADDii {Tint(4), 1 Kint(3)} {Tint(7)}
ADDii {Tint(4), 1 Kint(1)} {Tint(7)}
MOVi {Tint(7)} {Tint(4)}
BR {L2}
L11
IAGETik {local(flags, 0), Tint(0)} {Tint(5)}
EQii {Tint(5), 1 Kint(3)} {Tbool(6)}
EQii {Tint(5), 1 Kint(1)} {Tbool(6)}
CBR {Tbool(6)} {L12, L13}
L12
ADDii {Tint(0), Tint(0)} {Tint(5)}
ADDii {Tint(5), 3 Kint(6)} {Tint(7)}
ADDii {Tint(5), 3 Kint(4)} {Tint(7)}
MOVi {Tint(7)} {Tint(2)}
ADDii {Tint(0), Tint(2)} {Tint(7)}
MOVi {Tint(7)} {Tint(1)}
BR {L14}
L13
ADDii {Tint(0), 1 Kint(3)} {Tint(7)}
ADDii {Tint(0), 1 Kint(1)} {Tint(7)}
MOVi {Tint(7)} {Tint(0)}
BR {L8}
L14
LEii {Tint(1), 8190 Kint(2)} {Tbool(7)}
LEii {Tint(1), 8190 Kint(0)} {Tbool(7)}
CBR {Tbool(7)} {L15, L16}
L15
IAPUTiv {0 Kint(4)} {local(flags, 0), Tint(1)}
IAPUTiv {0 Kint(2)} {local(flags, 0), Tint(1)}
ADDii {Tint(1), Tint(2)} {Tint(7)}
MOVi {Tint(7)} {Tint(1)}
BR {L14}
L16
ADDii {Tint(3), 1 Kint(3)} {Tint(7)}
ADDii {Tint(3), 1 Kint(1)} {Tint(7)}
MOVi {Tint(7)} {Tint(3)}
BR {L13}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -75,10 +76,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -607,8 +616,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -621,6 +630,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -634,8 +650,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -702,7 +717,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_5 = i_4 <= 100000; }
@ -804,6 +819,39 @@ L16:
i_3 = i_7;
goto L13;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "intarray", 8));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
time taken 6.41
time taken 8.626
1899
Ok

@ -3,9 +3,10 @@ L0 (entry)
LOADGLOBAL {Upval(_ENV), 'x' Ks(0)} {T(0)}
PUTsk {'Dibyendu' Ks(2)} {T(0), 'a' Ks(1)}
LOADGLOBAL {Upval(_ENV), 'x' Ks(0)} {T(1)}
PUTik {2 Kint(4)} {T(1), 1 Kint(3)}
PUTik {2 Kint(1)} {T(1), 1 Kint(0)}
RET {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -17,10 +18,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -549,8 +558,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -563,6 +572,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -576,8 +592,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -637,7 +652,44 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 3, TValue);
f->sizek = 3;
for (int i = 0; i < 3; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "x", 1));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "Dibyendu", 8));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "a", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -5,6 +5,7 @@ L0 (entry)
ADDff {Tflt(0), Tflt(1)} {Tflt(2)}
RET {Tflt(2)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -16,10 +17,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -548,8 +557,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -562,6 +571,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -575,8 +591,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -619,9 +634,33 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 0;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
define Proc%1
L0 (entry)
@ -630,6 +669,7 @@ L0 (entry)
MULff {Tflt(0), Tflt(1)} {Tflt(2)}
RET {Tflt(2)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -641,10 +681,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -1173,8 +1221,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -1187,6 +1235,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -1200,8 +1255,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1244,7 +1298,32 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_1(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 0;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -2,7 +2,7 @@ define Proc%1
L0 (entry)
MOVi {1 Kint(0)} {local(a, 0)}
CLOSURE {Proc%2} {T(1)}
STOREGLOBAL {T(1)} {Upval(_ENV), 'f' Ks(1)}
STOREGLOBAL {T(1)} {Upval(_ENV), 'f' Ks(0)}
CLOSE {local(a, 0)}
RET {L1}
L1 (exit)
@ -22,6 +22,7 @@ L0 (entry)
MOVi {Tint(0)} {Upval(0, Proc%1, a)}
RET {Upval(0, Proc%1, a)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -33,10 +34,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -565,8 +574,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -579,6 +588,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -592,8 +608,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -643,11 +658,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_2(lua_State *L);
int __ravifunc_2(lua_State *L) {
static int __ravifunc_2(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -700,11 +714,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_3(lua_State *L);
int __ravifunc_3(lua_State *L) {
static int __ravifunc_3(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -748,11 +761,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_4(lua_State *L);
int __ravifunc_4(lua_State *L) {
static int __ravifunc_4(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -799,7 +811,111 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "f", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_2;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 1;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 1;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_3;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 1;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 1;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_4;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 0;
f->k = luaM_newvector(L, 0, TValue);
f->sizek = 0;
for (int i = 0; i < 0; i++)
setnilvalue(&f->k[i]);
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 1;
f = parent;
}
f = parent;
}
f = parent;
}
return cl;
}
Ok

@ -36,9 +36,9 @@ L3
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)}
LOADGLOBAL {Upval(_ENV), 'table' Ks(0)} {T(0)}
GETsk {T(0), 'numarray' Ks(1)} {T(2)}
CALL {T(2), Tint(1), 0.000000000000 Kflt(0)} {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)}
@ -69,16 +69,16 @@ 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)}
TGETik {local(a, 0), 1 Kint(0)} {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)}
CALL {T(0), T(4)} {T(0..), 1 Kint(0)}
LEN {local(a, 0)} {T(4)}
TGETik {local(a, 0), 1 Kint(1)} {T(3)}
TGETik {local(a, 0), 1 Kint(0)} {T(3)}
LEN {T(3)} {T(2)}
TGETik {local(b, 1), 1 Kint(1)} {T(5)}
TGETik {local(b, 1), 1 Kint(0)} {T(5)}
LEN {T(5)} {T(6)}
NEWTABLE {T(7)}
MOV {T(7)} {local(x, 2)}
@ -88,13 +88,13 @@ L0 (entry)
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)}
GETsk {Upval(1, Proc%1, matrix), 'T' Ks(1)} {T(4)}
CALL {T(4), local(b, 1)} {T(4..), 1 Kint(0)}
TOTABLE {T(4[4..])}
MOV {T(4[4..])} {local(c, 3)}
MOV {1 Kint(1)} {Tint(4)}
MOV {1 Kint(0)} {Tint(4)}
MOV {Tint(0)} {Tint(5)}
MOV {1 Kint(1)} {Tint(6)}
MOV {1 Kint(0)} {Tint(6)}
SUBii {Tint(4), Tint(6)} {Tint(4)}
BR {L2}
L1 (exit)
@ -106,15 +106,15 @@ L3
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)}
LOADGLOBAL {Upval(_ENV), 'table' Ks(2)} {T(2)}
GETsk {T(2), 'numarray' Ks(3)} {T(6)}
CALL {T(6), Tint(2), 0.000000000000 Kflt(0)} {T(6..), 1 Kint(0)}
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 {1 Kint(0)} {Tint(9)}
MOV {Tint(2)} {Tint(10)}
MOV {1 Kint(1)} {Tint(11)}
MOV {1 Kint(0)} {Tint(11)}
SUBii {Tint(9), Tint(11)} {Tint(9)}
BR {L6}
L5
@ -133,10 +133,10 @@ L8
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)}
MOVf {0.000000000000 Kflt(0)} {Tflt(0)}
MOV {1 Kint(0)} {Tint(14)}
MOV {Tint(1)} {Tint(15)}
MOV {1 Kint(1)} {Tint(16)}
MOV {1 Kint(0)} {Tint(16)}
SUBii {Tint(14), Tint(16)} {Tint(14)}
BR {L10}
L9
@ -166,9 +166,9 @@ L0 (entry)
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 {1 Kint(0)} {Tint(1)}
MOV {local(n, 0)} {Tint(2)}
MOV {1 Kint(1)} {Tint(3)}
MOV {1 Kint(0)} {Tint(3)}
SUBii {Tint(1), Tint(3)} {Tint(1)}
BR {L2}
L1 (exit)
@ -180,15 +180,15 @@ L3
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)}
LOADGLOBAL {Upval(_ENV), 'table' Ks(0)} {T(0)}
GETsk {T(0), 'numarray' Ks(1)} {T(1)}
CALL {T(1), local(n, 0), 0.000000000000 Kflt(1)} {T(1..), 1 Kint(0)}
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 {1 Kint(0)} {Tint(6)}
MOV {local(n, 0)} {Tint(7)}
MOV {1 Kint(1)} {Tint(8)}
MOV {1 Kint(0)} {Tint(8)}
SUBii {Tint(6), Tint(8)} {Tint(6)}
BR {L6}
L5
@ -204,12 +204,13 @@ L8
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)}
SUBii {Tint(10), 2 Kint(1)} {Tint(11)}
MULfi {Tflt(1), Tint(11)} {Tflt(3)}
FAPUTfv {Tflt(3)} {local(ai, 2), Tint(5)}
BR {L6}
L9
BR {L2}
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -221,10 +222,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -753,8 +762,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -767,6 +776,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -780,8 +796,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -861,11 +876,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_2(lua_State *L);
int __ravifunc_2(lua_State *L) {
static int __ravifunc_2(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -949,7 +963,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_3 = i_3 + i_5; }
@ -1090,8 +1104,7 @@ goto L6;
L9:
goto L2;
}
extern int __ravifunc_3(lua_State *L);
int __ravifunc_3(lua_State *L) {
static int __ravifunc_3(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1313,7 +1326,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_4 = i_4 + i_6; }
@ -1502,8 +1515,7 @@ L13:
}
goto L6;
}
extern int __ravifunc_4(lua_State *L);
int __ravifunc_4(lua_State *L) {
static int __ravifunc_4(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1552,7 +1564,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{ i_1 = i_1 + i_3; }
@ -1680,6 +1692,147 @@ goto L6;
L9:
goto L2;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 5;
f->k = luaM_newvector(L, 3, TValue);
f->sizek = 3;
for (int i = 0; i < 3; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "mul", 3));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "gen", 3));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "T", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->p = luaM_newvector(L, 3, Proto *);
f->sizep = 3;
for (int i = 0; i < 3; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_2;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 1;
f->is_vararg = 0;
f->maxstacksize = 8;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "numarray", 8));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f = parent;
}
f->p[1] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[1];
f->ravi_jit.jit_function = __ravifunc_3;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 2;
f->is_vararg = 0;
f->maxstacksize = 16;
f->k = luaM_newvector(L, 4, TValue);
f->sizek = 4;
for (int i = 0; i < 4; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "assert", 6));
}
{
TValue *o = &f->k[3];
setsvalue2n(L, o, luaS_newlstr(L, "numarray", 8));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "T", 1));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
f->upvalues = luaM_newvector(L, 2, Upvaldesc);
f->sizeupvalues = 2;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->upvalues[1].instack = 1;
f->upvalues[1].idx = 0;
f->upvalues[1].name = NULL;
f->upvalues[1].usertype = NULL;
f->upvalues[1].ravi_type = 0;
f = parent;
}
f->p[2] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[2];
f->ravi_jit.jit_function = __ravifunc_4;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 1;
f->is_vararg = 0;
f->maxstacksize = 6;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "table", 5));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "numarray", 8));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f = parent;
}
return cl;
}
time taken 0.98
time taken 2.395
-95.5835833333
Ok

@ -5,6 +5,7 @@ L0 (entry)
LT {T(0), T(1)} {T(2)}
RET {T(2)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -16,10 +17,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -548,8 +557,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -562,6 +571,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -575,8 +591,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -643,9 +658,41 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "a", 1));
}
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "b", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
define Proc%1
L0 (entry)
@ -654,6 +701,7 @@ L0 (entry)
LE {T(1), T(0)} {T(2)}
RET {T(2)} {L1}
L1 (exit)
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -665,10 +713,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -1197,8 +1253,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -1211,6 +1267,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -1224,8 +1287,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1292,7 +1354,40 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
EXPORT LClosure *__luachunk_1(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 3;
f->k = luaM_newvector(L, 2, TValue);
f->sizek = 2;
for (int i = 0; i < 2; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "a", 1));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "b", 1));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
return cl;
}
Ok

@ -22,20 +22,21 @@ L5
EQ {local(what, 1), 'div' Ks(3)} {T(3)}
CBR {T(3)} {L9, L10}
L6
ADDfi {local(a, 0), 5 Kint(4)} {Tflt(0)}
ADDfi {local(a, 0), 5 Kint(0)} {Tflt(0)}
RET {Tflt(0)} {L1}
L7
SUBfi {local(a, 0), 5 Kint(4)} {Tflt(1)}
SUBfi {local(a, 0), 5 Kint(0)} {Tflt(1)}
RET {Tflt(1)} {L1}
L8
MULfi {local(a, 0), 5 Kint(4)} {Tflt(2)}
MULfi {local(a, 0), 5 Kint(0)} {Tflt(2)}
RET {Tflt(2)} {L1}
L9
DIVfi {local(a, 0), 5 Kint(4)} {Tflt(3)}
DIVfi {local(a, 0), 5 Kint(0)} {Tflt(3)}
RET {Tflt(3)} {L1}
L10
RET {0 Kint(5)} {L1}
RET {0 Kint(1)} {L1}
L11
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -47,10 +48,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -579,8 +588,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -593,6 +602,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -606,8 +622,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -649,11 +664,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_2(lua_State *L);
int __ravifunc_2(lua_State *L) {
static int __ravifunc_2(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -682,7 +696,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -871,6 +885,70 @@ setivalue(dst_reg, 0);
}
goto L1;
}
EXPORT LClosure *__luachunk_0(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 2;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "doit", 4));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_2;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 2;
f->is_vararg = 0;
f->maxstacksize = 6;
f->k = luaM_newvector(L, 4, TValue);
f->sizek = 4;
for (int i = 0; i < 4; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "sub", 3));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "add", 3));
}
{
TValue *o = &f->k[3];
setsvalue2n(L, o, luaS_newlstr(L, "div", 3));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "mul", 3));
}
f->upvalues = luaM_newvector(L, 0, Upvaldesc);
f->sizeupvalues = 0;
f = parent;
}
return cl;
}
define Proc%1
L0 (entry)
@ -896,20 +974,21 @@ L5
EQ {local(what, 1), 'div' Ks(3)} {T(3)}
CBR {T(3)} {L9, L10}
L6
ADDfi {local(a, 0), 5 Kint(4)} {Tflt(0)}
ADDfi {local(a, 0), 5 Kint(0)} {Tflt(0)}
RET {Tflt(0)} {L1}
L7
SUBif {5 Kint(4), local(a, 0)} {Tflt(1)}
SUBif {5 Kint(0), local(a, 0)} {Tflt(1)}
RET {Tflt(1)} {L1}
L8
MULfi {local(a, 0), 5 Kint(4)} {Tflt(2)}
MULfi {local(a, 0), 5 Kint(0)} {Tflt(2)}
RET {Tflt(2)} {L1}
L9
DIVif {5 Kint(4), local(a, 0)} {Tflt(3)}
DIVif {5 Kint(0), local(a, 0)} {Tflt(3)}
RET {Tflt(3)} {L1}
L10
RET {0 Kint(5)} {L1}
RET {0 Kint(1)} {L1}
L11
#ifdef __MIRC__
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __INTPTR_TYPE__ intptr_t;
@ -921,10 +1000,18 @@ typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
#define NULL ((void *)0)
#define EXPORT
#else
#include <stddef.h>
#include <stdint.h>
#ifdef _WIN32
#define EXPORT __declspec(dllexport)
#endif
#endif
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
@ -1453,8 +1540,8 @@ 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 raviV_raise_error(lua_State *L, int errorcode);
extern void raviV_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);
@ -1467,6 +1554,13 @@ extern void raviV_settable_i(lua_State *L, const TValue *t, TValue *key, TValue
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);
extern void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize);
extern LClosure *luaF_newLclosure (lua_State *L, int n);
extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
extern Proto *luaF_newproto (lua_State *L);
extern void luaD_inctop (lua_State *L);
#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))
#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))
#define R(i) (base + i)
#define K(i) (k + i)
#define S(i) (stackbase + i)
@ -1480,8 +1574,7 @@ extern void raviV_op_bnot(lua_State *L, TValue *ra, TValue *rb);
#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) {
static int __ravifunc_1(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1523,11 +1616,10 @@ goto L1;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
}
extern int __ravifunc_2(lua_State *L);
int __ravifunc_2(lua_State *L) {
static int __ravifunc_2(lua_State *L) {
int error_code = 0;
int result = 0;
CallInfo *ci = L->ci;
@ -1556,7 +1648,7 @@ goto L2;
L1:
return result;
Lraise_error:
raise_error(L, error_code); /* does not return */
raviV_raise_error(L, error_code); /* does not return */
return result;
L2:
{
@ -1745,4 +1837,69 @@ setivalue(dst_reg, 0);
}
goto L1;
}
EXPORT LClosure *__luachunk_1(lua_State *L) {
LClosure *cl = luaF_newLclosure(L, 1);
setclLvalue(L, L->top, cl);
luaD_inctop(L);
cl->p = luaF_newproto(L);
Proto *f = cl->p;
f->ravi_jit.jit_function = __ravifunc_1;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 0;
f->is_vararg = 0;
f->maxstacksize = 2;
f->k = luaM_newvector(L, 1, TValue);
f->sizek = 1;
for (int i = 0; i < 1; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "doit", 4));
}
f->upvalues = luaM_newvector(L, 1, Upvaldesc);
f->sizeupvalues = 1;
f->upvalues[0].instack = 0;
f->upvalues[0].idx = 0;
f->upvalues[0].name = NULL;
f->upvalues[0].usertype = NULL;
f->upvalues[0].ravi_type = 6;
f->p = luaM_newvector(L, 1, Proto *);
f->sizep = 1;
for (int i = 0; i < 1; i++)
f->p[i] = NULL;
f->p[0] = luaF_newproto(L);
{
Proto *parent = f; f = f->p[0];
f->ravi_jit.jit_function = __ravifunc_2;
f->ravi_jit.jit_status = RAVI_JIT_COMPILED;
f->numparams = 2;
f->is_vararg = 0;
f->maxstacksize = 6;
f->k = luaM_newvector(L, 4, TValue);
f->sizek = 4;
for (int i = 0; i < 4; i++)
setnilvalue(&f->k[i]);
{
TValue *o = &f->k[1];
setsvalue2n(L, o, luaS_newlstr(L, "sub", 3));
}
{
TValue *o = &f->k[0];
setsvalue2n(L, o, luaS_newlstr(L, "add", 3));
}
{
TValue *o = &f->k[3];
setsvalue2n(L, o, luaS_newlstr(L, "div", 3));
}
{
TValue *o = &f->k[2];
setsvalue2n(L, o, luaS_newlstr(L, "mul", 3));
}
f->upvalues = luaM_newvector(L, 0, Upvaldesc);
f->sizeupvalues = 0;
f = parent;
}
return cl;
}
Ok

Loading…
Cancel
Save