Merge branch 'master' into lua54

lua54
Dibyendu Majumdar 6 years ago
commit 6cea3bc383

@ -110,6 +110,7 @@ typedef struct CallInfo {
unsigned short callstatus;
unsigned short stacklevel; /* RAVI extension - stack level, bottom level is 0 */
lu_byte jitstatus; /* RAVI extension: Only valid if Lua function - if 1 means JITed - RAVI extension */
lu_byte magic;
} CallInfo;
@ -237,6 +238,7 @@ struct lua_State {
** pending
*/
unsigned short nci; /* number of items in 'ci' list */
lu_byte magic;
};

@ -22,6 +22,8 @@ _soft = rawget(_G, "_soft") or false
_port = rawget(_G, "_port") or false
-- Make true to avoid messages about tests not performed
_nomsg = rawget(_G, "_nomsg") or false
-- JIT test mode, 1 = some time consuming tests skipped, 2 = all tests
_jit = rawget(_G, "_jit") or 1
local usertests = rawget(_G, "_U")
@ -150,9 +152,7 @@ end
report"gc.lua"
local f = assert(loadfile('gc.lua'))
if ravi then ravi.gcstep(0) end
f()
if ravi then ravi.gcstep(300) end
if not ravi or not ravi.auto() or ravi.tracehook() then
-- in JIT mode we need tracehook enabled
dofile('db.lua')

@ -278,7 +278,7 @@ local function createcases (n)
end
-- do not do too many combinations for soft tests
local level = _soft and 3 or 4
local level = (_soft or _jit == 1) and 3 or 4
cases[1] = basiccases
for i = 2, level do cases[i] = createcases(i) end
@ -294,6 +294,9 @@ for n = 1, level do
IX = false
assert(p() == v[2] and IX == not not v[2])
i = i + 1
if _jit > 0 and i % 1000 == 0 then
collectgarbage()
end
if i % 60000 == 0 then print('+') end
end
end

@ -377,6 +377,8 @@ static int moveresults (lua_State *L, const TValue *firstResult, StkId res,
*/
int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, int nres) {
StkId res;
lua_assert(L->magic == 42);
lua_assert(ci->magic == 42);
int wanted = ci->nresults;
if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) {
if (L->hookmask & LUA_MASKRET) {

@ -113,6 +113,7 @@ CallInfo *luaE_extendCI (lua_State *L) {
L->ci->next = ci;
ci->previous = L->ci;
ci->next = NULL;
ci->magic = 42;
L->nci++;
return ci;
}
@ -164,6 +165,7 @@ static void stack_init (lua_State *L1, lua_State *L) {
ci->next = ci->previous = NULL;
ci->callstatus = 0;
ci->jitstatus = 0; /* RAVI extension */
ci->magic = 42; /* RAVI extension */
ci->func = L1->top;
setnilvalue(L1->top++); /* 'function' entry for this 'ci' */
ci->top = L1->top + LUA_MINSTACK;
@ -241,6 +243,8 @@ static void preinit_thread (lua_State *L, global_State *g) {
L->status = LUA_OK;
L->errfunc = 0;
L->base_ci.stacklevel = 0; /* RAVI base stack level */
L->base_ci.magic = 42;
L->magic = 42; /* RAVI extension */
}

Loading…
Cancel
Save