Lines Matching +full:eq +full:- +full:level
47 #define obj_at(L,k) s2v(L->ci->func.p + (k))
55 lua_setfield(L, -2, name); in setnameval()
60 setobj2s(L, L->top.p, o); in pushobject()
76 const char *msg = lua_tostring(L, -1); in tpanic()
87 ** - 0.normal: messages starting with '#' are shown on standard output;
88 ** - other messages abort the tests (they represent real warning
91 ** - 1.allow: all messages are shown;
92 ** - 2.store: all warnings go to the global '_WARN';
119 if (strlen(msg) >= sizeof(buff) - strlen(buff)) in warnf()
120 badexit("warnf-buffer overflow (%s)\n", msg, buff); in warnf()
126 if (!lua_toboolean(L, -1)) in warnf()
130 lua_tostring(L, -1), buff); in warnf()
179 #define fillmem(mem,size) memset(mem, -MARK, size)
197 size_t size = block->d.size; in freeblock()
201 mc->objcount[block->d.type]--; in freeblock()
204 mc->numblocks--; /* update counts */ in freeblock()
205 mc->total -= size; in freeblock()
214 if (mc->memlimit == 0) { /* first time? */ in debug_realloc()
216 mc->memlimit = limit ? strtoul(limit, NULL, 10) : ULONG_MAX; in debug_realloc()
223 block--; /* go to real header */ in debug_realloc()
224 type = block->d.type; in debug_realloc()
225 lua_assert(oldsize == block->d.size); in debug_realloc()
231 if (mc->failnext) { in debug_realloc()
232 mc->failnext = 0; in debug_realloc()
235 if (mc->countlimit != ~0UL && size != oldsize) { /* count limit in use? */ in debug_realloc()
236 if (mc->countlimit == 0) in debug_realloc()
238 mc->countlimit--; in debug_realloc()
240 if (size > oldsize && mc->total+size-oldsize > mc->memlimit) in debug_realloc()
256 fillmem(cast_charp(newblock + 1) + commonsize, size - commonsize); in debug_realloc()
260 newblock->d.size = size; in debug_realloc()
261 newblock->d.type = type; in debug_realloc()
262 mc->total += size; in debug_realloc()
263 if (mc->total > mc->maxmem) in debug_realloc()
264 mc->maxmem = mc->total; in debug_realloc()
265 mc->numblocks++; in debug_realloc()
266 mc->objcount[type]++; in debug_realloc()
300 else if (g->gckind == KGC_INC) in testobjref1()
314 printf("||%s(%p)-%c%c(%02X)||", in printobj()
315 ttypename(novariant(o->tt)), (void *)o, in printobj()
317 "ns01oTt"[getage(o)], o->marked); in printobj()
318 if (o->tt == LUA_VSHRSTR || o->tt == LUA_VLNGSTR) in printobj()
330 printf("%d(%02X) - ", g->gcstate, g->currentwhite); in testobjref()
332 printf(" -> "); in testobjref()
364 checkobjrefN(g, hgc, h->metatable); in checktable()
366 checkvalref(g, hgc, &h->array[i]); in checktable()
370 getnodekey(g->mainthread, &k, n); in checktable()
382 checkobjrefN(g, hgc, u->metatable); in checkudata()
383 for (i = 0; i < u->nuvalue; i++) in checkudata()
384 checkvalref(g, hgc, &u->uv[i].uv); in checkudata()
391 checkobjrefN(g, fgc, f->source); in checkproto()
392 for (i=0; i<f->sizek; i++) { in checkproto()
393 if (iscollectable(f->k + i)) in checkproto()
394 checkobjref(g, fgc, gcvalue(f->k + i)); in checkproto()
396 for (i=0; i<f->sizeupvalues; i++) in checkproto()
397 checkobjrefN(g, fgc, f->upvalues[i].name); in checkproto()
398 for (i=0; i<f->sizep; i++) in checkproto()
399 checkobjrefN(g, fgc, f->p[i]); in checkproto()
400 for (i=0; i<f->sizelocvars; i++) in checkproto()
401 checkobjrefN(g, fgc, f->locvars[i].varname); in checkproto()
408 for (i = 0; i < cl->nupvalues; i++) in checkCclosure()
409 checkvalref(g, clgc, &cl->upvalue[i]); in checkCclosure()
416 checkobjrefN(g, clgc, cl->p); in checkLclosure()
417 for (i=0; i<cl->nupvalues; i++) { in checkLclosure()
418 UpVal *uv = cl->upvals[i]; in checkLclosure()
422 checkvalref(g, obj2gco(uv), uv->v.p); in checkLclosure()
431 StkId f = ci->func.p; in lua_checkpc()
432 Proto *p = clLvalue(s2v(f))->p; in lua_checkpc()
433 return p->code <= ci->u.l.savedpc && in lua_checkpc()
434 ci->u.l.savedpc <= p->code + p->sizecode; in lua_checkpc()
444 if (L1->stack.p == NULL) { /* incomplete thread? */ in checkstack()
445 assert(L1->openupval == NULL && L1->ci == NULL); in checkstack()
448 for (uv = L1->openupval; uv != NULL; uv = uv->u.open.next) in checkstack()
450 assert(L1->top.p <= L1->stack_last.p); in checkstack()
451 assert(L1->tbclist.p <= L1->top.p); in checkstack()
452 for (ci = L1->ci; ci != NULL; ci = ci->previous) { in checkstack()
453 assert(ci->top.p <= L1->stack_last.p); in checkstack()
456 for (o = L1->stack.p; o < L1->stack_last.p; o++) in checkstack()
462 switch (o->tt) { in checkrefs()
468 checkvalref(g, o, gco2upv(o)->v.p); in checkrefs()
503 ** - Dead objects can only happen in the 'allgc' list during a sweep
505 ** - During pause, all objects must be white.
506 ** - In generational mode:
517 assert(g->gcstate != GCSpause || iswhite(o)); in checkobject()
518 if (g->gckind == KGC_GEN) { /* generational mode? */ in checkobject()
525 o->tt == LUA_VTHREAD || in checkobject()
526 (o->tt == LUA_VUPVAL && upisopen(gco2upv(o)))); in checkobject()
539 assert(!testbit(o->marked, TESTBIT)); in checkgraylist()
541 l_setbit(o->marked, TESTBIT); /* mark that object is in a gray list */ in checkgraylist()
543 switch (o->tt) { in checkgraylist()
544 case LUA_VTABLE: o = gco2t(o)->gclist; break; in checkgraylist()
545 case LUA_VLCL: o = gco2lcl(o)->gclist; break; in checkgraylist()
546 case LUA_VCCL: o = gco2ccl(o)->gclist; break; in checkgraylist()
547 case LUA_VTHREAD: o = gco2th(o)->gclist; break; in checkgraylist()
548 case LUA_VPROTO: o = gco2p(o)->gclist; break; in checkgraylist()
550 assert(gco2u(o)->nuvalue > 0); in checkgraylist()
551 o = gco2u(o)->gclist; in checkgraylist()
566 total += checkgraylist(g, g->gray); in checkgrays()
567 total += checkgraylist(g, g->grayagain); in checkgrays()
568 total += checkgraylist(g, g->weak); in checkgrays()
569 total += checkgraylist(g, g->allweak); in checkgrays()
570 total += checkgraylist(g, g->ephemeron); in checkgrays()
583 if (o->tt == LUA_VUPVAL) { in incifingray()
591 assert(testbit(o->marked, TESTBIT)); in incifingray()
592 resetbit(o->marked, TESTBIT); /* prepare for next cycle */ in incifingray()
601 for (o = newl; o != survival; o = o->next) { in checklist()
606 for (o = survival; o != old; o = o->next) { in checklist()
611 for (o = old; o != reallyold; o = o->next) { in checklist()
616 for (o = reallyold; o != NULL; o = o->next) { in checklist()
632 assert(!iswhite(g->mainthread)); in lua_checkmemory()
633 assert(!iswhite(gcvalue(&g->l_registry))); in lua_checkmemory()
635 assert(!isdead(g, gcvalue(&g->l_registry))); in lua_checkmemory()
636 assert(g->sweepgc == NULL || issweepphase(g)); in lua_checkmemory()
640 for (o = g->fixedgc; o != NULL; o = o->next) { in lua_checkmemory()
641 assert(o->tt == LUA_VSHRSTR && isgray(o) && getage(o) == G_OLD); in lua_checkmemory()
645 maybedead = (GCSatomic < g->gcstate && g->gcstate <= GCSswpallgc); in lua_checkmemory()
646 totalshould = checklist(g, maybedead, 0, g->allgc, in lua_checkmemory()
647 g->survival, g->old1, g->reallyold); in lua_checkmemory()
650 totalshould += checklist(g, 0, 1, g->finobj, in lua_checkmemory()
651 g->finobjsur, g->finobjold1, g->finobjrold); in lua_checkmemory()
654 for (o = g->tobefnz; o != NULL; o = o->next) { in lua_checkmemory()
658 assert(o->tt == LUA_VUSERDATA || o->tt == LUA_VTABLE); in lua_checkmemory()
678 Instruction i = p->code[pc]; in buildop()
682 int lineinfo = (p->lineinfo != NULL) ? p->lineinfo[pc] : 0; in buildop()
687 buff += sprintf(buff, " - %4d) %4d - ", line, pc); in buildop()
690 sprintf(buff, "%-12s%4d %4d %4d%s", name, in buildop()
695 sprintf(buff, "%-12s%4d %4d", name, GETARG_A(i), GETARG_Bx(i)); in buildop()
698 sprintf(buff, "%-12s%4d %4d", name, GETARG_A(i), GETARG_sBx(i)); in buildop()
701 sprintf(buff, "%-12s%4d", name, GETARG_Ax(i)); in buildop()
704 sprintf(buff, "%-12s%4d", name, GETARG_sJ(i)); in buildop()
718 printf("-------\n");
736 setnameval(L, "maxstack", p->maxstacksize); in listcode()
737 setnameval(L, "numparams", p->numparams); in listcode()
738 for (pc=0; pc<p->sizecode; pc++) { in listcode()
742 lua_settable(L, -3); in listcode()
754 printf("maxstack: %d\n", p->maxstacksize); in printcode()
755 printf("numparams: %d\n", p->numparams); in printcode()
756 for (pc=0; pc<p->sizecode; pc++) { in printcode()
770 lua_createtable(L, p->sizek, 0); in listk()
771 for (i=0; i<p->sizek; i++) { in listk()
772 pushobject(L, p->k+i); in listk()
773 lua_rawseti(L, -2, i+1); in listk()
785 luaL_argcheck(L, p->abslineinfo != NULL, 1, "function has no debug info"); in listabslineinfo()
786 lua_createtable(L, 2 * p->sizeabslineinfo, 0); in listabslineinfo()
787 for (i=0; i < p->sizeabslineinfo; i++) { in listabslineinfo()
788 lua_pushinteger(L, p->abslineinfo[i].pc); in listabslineinfo()
789 lua_rawseti(L, -2, 2 * i + 1); in listabslineinfo()
790 lua_pushinteger(L, p->abslineinfo[i].line); in listabslineinfo()
791 lua_rawseti(L, -2, 2 * i + 2); in listabslineinfo()
799 int pc = cast_int(luaL_checkinteger(L, 2)) - 1; in listlocals()
807 return i-1; in listlocals()
854 for (i = LUA_NUMTAGS - 1; i >= 0; i--) { in mem_query()
943 GCSswptobefnz, GCSswpend, GCScallfin, GCSpause, -1}; in gc_state()
945 if (option == -1) { in gc_state()
946 lua_pushstring(L, statenames[G(L)->gcstate]); in gc_state()
951 if (G(L)->gckind == KGC_GEN) in gc_state()
954 if (option < g->gcstate) { /* must cross 'pause'? */ in gc_state()
958 lua_assert(G(L)->gcstate == option); in gc_state()
968 lua_pushinteger(L, tsvalue(obj_at(L, 1))->hash); in hash_query()
975 lua_pushinteger(L, luaH_mainposition(t, o) - t->node); in hash_query()
983 lua_pushinteger(L, (L->top.p - L->stack.p)); in stacklevel()
985 lua_pushinteger(L, L->nCcalls); in stacklevel()
986 lua_pushinteger(L, L->nci); in stacklevel()
994 int i = cast_int(luaL_optinteger(L, 2, -1)); in table_query()
999 if (i == -1) { in table_query()
1002 lua_pushinteger(L, isdummy(t) ? 0 : t->lastfree - t->node); in table_query()
1003 lua_pushinteger(L, t->alimit); in table_query()
1008 pushobject(L, &t->array[i]); in table_query()
1011 else if ((i -= asize) < sizenode(t)) { in table_query()
1022 if (gnext(&t->node[i]) != 0) in table_query()
1023 lua_pushinteger(L, gnext(&t->node[i])); in table_query()
1032 stringtable *tb = &G(L)->strt; in string_query()
1033 int s = cast_int(luaL_optinteger(L, 1, 0)) - 1; in string_query()
1034 if (s == -1) { in string_query()
1035 lua_pushinteger(L ,tb->size); in string_query()
1036 lua_pushinteger(L ,tb->nuse); in string_query()
1039 else if (s < tb->size) { in string_query()
1042 for (ts = tb->hash[s]; ts != NULL; ts = ts->u.hnext) { in string_query()
1043 setsvalue2s(L, L->top.p, ts); in string_query()
1054 int level = lua_gettop(L); in tref() local
1058 cast_void(level); /* to avoid warnings */ in tref()
1059 lua_assert(lua_gettop(L) == level+1); /* +1 for result */ in tref()
1064 int level = lua_gettop(L); in getref() local
1066 cast_void(level); /* to avoid warnings */ in getref()
1067 lua_assert(lua_gettop(L) == level+1); in getref()
1072 int level = lua_gettop(L); in unref() local
1074 cast_void(level); /* to avoid warnings */ in unref()
1075 lua_assert(lua_gettop(L) == level); in unref()
1101 while (size--) *p++ = '\0'; in newuserdata()
1187 lua_assert(lua_type(L1, -1) == LUA_TTABLE); in loadlib()
1191 lua_assert(lua_compare(L1, -1, -2, LUA_OPEQ)); in loadlib()
1195 lua_setfield(L1, -2, libs[i].name); in loadlib()
1217 lua_pushstring(L, lua_tostring(L1, -1)); in doremote()
1225 lua_pop(L1, i-1); in doremote()
1226 return i-1; in doremote()
1241 ** does a long-jump back to "main program".
1247 b = (struct Aux *)lua_touserdata(L, -1); in panicback()
1249 runC(b->L, L, b->paniccode); /* run optional panic code */ in panicback()
1250 longjmp(b->jb, 1); in panicback()
1276 lua_pushstring(L, lua_tostring(L1, -1)); in checkpanic()
1300 while (**pc != '\n' && **pc != '\0') (*pc)++; /* until end-of-line */ in skip()
1311 res = cast_int(lua_tointeger(L1, -1)); in getnum_aux()
1321 else if (**pc == '-') { in getnum_aux()
1322 sig = -1; in getnum_aux()
1327 while (lisdigit(cast_uchar(**pc))) res = res*10 + (*(*pc)++) - '0'; in getnum_aux()
1357 default: (*pc)--; return getnum_aux(L, L1, pc); in getindex_aux()
1378 #define EQ(s1) (strcmp(s1, inst) == 0) macro
1390 ** LUA_OPIDIV -> \
1391 ** LUA_OPSHL -> <
1392 ** LUA_OPSHR -> >
1393 ** LUA_OPUNM -> _
1394 ** LUA_OPBNOT -> !
1396 static const char ops[] = "+-*%^/\\&|~<>_!";
1404 if EQ("") return 0; in runC()
1405 else if EQ("absindex") { in runC()
1408 else if EQ("append") { in runC()
1413 else if EQ("arith") { in runC()
1416 op = strchr(ops, *pc++) - ops; in runC()
1419 else if EQ("call") { in runC()
1424 else if EQ("callk") { in runC()
1430 else if EQ("checkstack") { in runC()
1437 else if EQ("rawcheckstack") { in runC()
1441 else if EQ("compare") { in runC()
1442 const char *opt = getstring; /* EQ, LT, or LE */ in runC()
1449 else if EQ("concat") { in runC()
1452 else if EQ("copy") { in runC()
1456 else if EQ("func2num") { in runC()
1460 else if EQ("getfield") { in runC()
1464 else if EQ("getglobal") { in runC()
1467 else if EQ("getmetatable") { in runC()
1471 else if EQ("gettable") { in runC()
1474 else if EQ("gettop") { in runC()
1477 else if EQ("gsub") { in runC()
1483 else if EQ("insert") { in runC()
1486 else if EQ("iscfunction") { in runC()
1489 else if EQ("isfunction") { in runC()
1492 else if EQ("isnil") { in runC()
1495 else if EQ("isnull") { in runC()
1498 else if EQ("isnumber") { in runC()
1501 else if EQ("isstring") { in runC()
1504 else if EQ("istable") { in runC()
1507 else if EQ("isudataval") { in runC()
1510 else if EQ("isuserdata") { in runC()
1513 else if EQ("len") { in runC()
1516 else if EQ("Llen") { in runC()
1519 else if EQ("loadfile") { in runC()
1522 else if EQ("loadstring") { in runC()
1526 else if EQ("newmetatable") { in runC()
1529 else if EQ("newtable") { in runC()
1532 else if EQ("newthread") { in runC()
1535 else if EQ("resetthread") { in runC()
1538 else if EQ("newuserdata") { in runC()
1541 else if EQ("next") { in runC()
1542 lua_next(L1, -2); in runC()
1544 else if EQ("objsize") { in runC()
1547 else if EQ("pcall") { in runC()
1552 else if EQ("pcallk") { in runC()
1558 else if EQ("pop") { in runC()
1561 else if EQ("printstack") { in runC()
1569 else if EQ("print") { in runC()
1573 else if EQ("warningC") { in runC()
1577 else if EQ("warning") { in runC()
1581 else if EQ("pushbool") { in runC()
1584 else if EQ("pushcclosure") { in runC()
1587 else if EQ("pushint") { in runC()
1590 else if EQ("pushnil") { in runC()
1593 else if EQ("pushnum") { in runC()
1596 else if EQ("pushstatus") { in runC()
1599 else if EQ("pushstring") { in runC()
1602 else if EQ("pushupvalueindex") { in runC()
1605 else if EQ("pushvalue") { in runC()
1608 else if EQ("pushfstringI") { in runC()
1609 lua_pushfstring(L1, lua_tostring(L, -2), (int)lua_tointeger(L, -1)); in runC()
1611 else if EQ("pushfstringS") { in runC()
1612 lua_pushfstring(L1, lua_tostring(L, -2), lua_tostring(L, -1)); in runC()
1614 else if EQ("pushfstringP") { in runC()
1615 lua_pushfstring(L1, lua_tostring(L, -2), lua_topointer(L, -1)); in runC()
1617 else if EQ("rawget") { in runC()
1621 else if EQ("rawgeti") { in runC()
1625 else if EQ("rawgetp") { in runC()
1629 else if EQ("rawset") { in runC()
1633 else if EQ("rawseti") { in runC()
1637 else if EQ("rawsetp") { in runC()
1641 else if EQ("remove") { in runC()
1644 else if EQ("replace") { in runC()
1647 else if EQ("resume") { in runC()
1652 else if EQ("return") { in runC()
1657 int idx = -(n - i); in runC()
1670 else if EQ("rotate") { in runC()
1674 else if EQ("setfield") { in runC()
1679 else if EQ("seti") { in runC()
1683 else if EQ("setglobal") { in runC()
1687 else if EQ("sethook") { in runC()
1693 else if EQ("setmetatable") { in runC()
1697 else if EQ("settable") { in runC()
1700 else if EQ("settop") { in runC()
1703 else if EQ("testudata") { in runC()
1707 else if EQ("error") { in runC()
1710 else if EQ("abort") { in runC()
1713 else if EQ("throw") { in runC()
1722 else if EQ("tobool") { in runC()
1725 else if EQ("tocfunction") { in runC()
1728 else if EQ("tointeger") { in runC()
1731 else if EQ("tonumber") { in runC()
1734 else if EQ("topointer") { in runC()
1737 else if EQ("touserdata") { in runC()
1740 else if EQ("tostring") { in runC()
1746 else if EQ("Ltolstring") { in runC()
1749 else if EQ("type") { in runC()
1752 else if EQ("xmove") { in runC()
1761 else if EQ("isyieldable") { in runC()
1764 else if EQ("yield") { in runC()
1767 else if EQ("yieldk") { in runC()
1772 else if EQ("toclose") { in runC()
1775 else if EQ("closeslot") { in runC()
1841 lua_gettable(L, -2); /* get C_HOOK[L] (script saved by sethookaux) */ in Chook()
1842 scpt = lua_tostring(L, -1); /* not very religious (string will be popped) */ in Chook()
1844 lua_pushstring(L, events[ar->event]); /* may be used by script */ in Chook()
1845 lua_pushinteger(L, ar->currentline); /* may be used by script */ in Chook()
1859 if (!lua_istable(L, -1)) { /* no hook table? */ in sethookaux()
1862 lua_pushvalue(L, -1); in sethookaux()
1867 lua_settable(L, -3); /* C_HOOK[L] = script */ in sethookaux()
1897 lua_insert(L, -2); in coresume()