Lines Matching refs:k
40 static int codesJ (FuncState *fs, OpCode o, int sj, int k);
58 switch (e->k) { in tonumeral()
74 lua_assert(e->k == VCONST); in const2val()
75 return &fs->ls->dyd->actvar.arr[e->u.info].k; in const2val()
86 switch (e->k) { in luaK_exp2const()
221 static int condjump (FuncState *fs, OpCode op, int A, int B, int C, int k) { in condjump() argument
222 luaK_codeABCk(fs, op, A, B, C, k); in condjump()
396 int luaK_codeABCk (FuncState *fs, OpCode o, int a, int b, int c, int k) { in luaK_codeABCk() argument
399 c <= MAXARG_C && (k & ~1) == 0); in luaK_codeABCk()
400 return luaK_code(fs, CREATE_ABCk(o, a, b, c, k)); in luaK_codeABCk()
428 static int codesJ (FuncState *fs, OpCode o, int sj, int k) { in codesJ() argument
431 lua_assert(j <= MAXARG_sJ && (k & ~1) == 0); in codesJ()
432 return luaK_code(fs, CREATE_sJ(o, j, k)); in codesJ()
450 static int luaK_codek (FuncState *fs, int reg, int k) { in luaK_codek() argument
451 if (k <= MAXARG_Bx) in luaK_codek()
452 return luaK_codeABx(fs, OP_LOADK, reg, k); in luaK_codek()
455 codeextraarg(fs, k); in luaK_codek()
517 if (e->k == VNONRELOC) in freeexp()
527 int r1 = (e1->k == VNONRELOC) ? e1->u.info : -1; in freeexps()
528 int r2 = (e2->k == VNONRELOC) ? e2->u.info : -1; in freeexps()
547 int k, oldsize; in addk() local
549 k = cast_int(ivalue(idx)); in addk()
551 if (k < fs->nk && ttypetag(&f->k[k]) == ttypetag(v) && in addk()
552 luaV_rawequalobj(&f->k[k], v)) in addk()
553 return k; /* reuse index */ in addk()
557 k = fs->nk; in addk()
560 setivalue(&val, k); in addk()
562 luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); in addk()
563 while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); in addk()
564 setobj(L, &f->k[k], v); in addk()
567 return k; in addk()
588 TValue k, o; in luaK_intK() local
589 setpvalue(&k, cast_voidp(cast_sizet(n))); in luaK_intK()
591 return addk(fs, &k, &o); in luaK_intK()
628 TValue k, v; in nilK() local
631 sethvalue(fs->ls->L, &k, fs->ls->h); in nilK()
632 return addk(fs, &k, &v); in nilK()
677 e->k = VKINT; e->u.ival = ivalue(v); in const2exp()
680 e->k = VKFLT; e->u.nval = fltvalue(v); in const2exp()
683 e->k = VFALSE; in const2exp()
686 e->k = VTRUE; in const2exp()
689 e->k = VNIL; in const2exp()
692 e->k = VKSTR; e->u.strval = tsvalue(v); in const2exp()
705 if (e->k == VCALL) /* expression is an open function call? */ in luaK_setreturns()
708 lua_assert(e->k == VVARARG); in luaK_setreturns()
720 lua_assert(e->k == VKSTR); in str2K()
722 e->k = VK; in str2K()
737 if (e->k == VCALL) { /* expression is an open function call? */ in luaK_setoneret()
740 e->k = VNONRELOC; /* result has fixed position */ in luaK_setoneret()
743 else if (e->k == VVARARG) { in luaK_setoneret()
745 e->k = VRELOC; /* can relocate its simple result */ in luaK_setoneret()
755 switch (e->k) { in luaK_dischargevars()
762 e->k = VNONRELOC; /* becomes a non-relocatable value */ in luaK_dischargevars()
767 e->k = VRELOC; in luaK_dischargevars()
772 e->k = VRELOC; in luaK_dischargevars()
778 e->k = VRELOC; in luaK_dischargevars()
784 e->k = VRELOC; in luaK_dischargevars()
790 e->k = VRELOC; in luaK_dischargevars()
809 switch (e->k) { in discharge2reg()
848 lua_assert(e->k == VJMP); in discharge2reg()
853 e->k = VNONRELOC; in discharge2reg()
863 if (e->k != VNONRELOC) { /* no fixed register yet? */ in discharge2anyreg()
898 if (e->k == VJMP) /* expression itself is a test? */ in exp2reg()
905 int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); in exp2reg()
917 e->k = VNONRELOC; in exp2reg()
938 if (e->k == VNONRELOC) { /* expression already has a register? */ in luaK_exp2anyreg()
959 if (e->k != VUPVAL || hasjumps(e)) in luaK_exp2anyregup()
983 switch (e->k) { /* move constants to 'k' */ in luaK_exp2K()
994 e->k = VK; /* make expression a 'K' expression */ in luaK_exp2K()
1022 int k = luaK_exp2RK(fs, ec); in codeABRK() local
1023 luaK_codeABCk(fs, o, a, b, ec->u.info, k); in codeABRK()
1031 switch (var->k) { in luaK_storevar()
1073 e->k = VNONRELOC; /* self expression has a fixed register */ in luaK_self()
1098 if (e->k == VRELOC) { in jumponcond()
1118 switch (e->k) { in luaK_goiftrue()
1145 switch (e->k) { in luaK_goiffalse()
1169 switch (e->k) { in codenot()
1171 e->k = VTRUE; /* true == not nil == not false */ in codenot()
1175 e->k = VFALSE; /* false == not "x" == not 0.5 == not 1 == not true */ in codenot()
1187 e->k = VRELOC; in codenot()
1203 return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B && in isKstr()
1204 ttisshrstring(&fs->f->k[e->u.info])); in isKstr()
1211 return (e->k == VKINT && !hasjumps(e)); in luaK_isKint()
1239 if (e->k == VKINT) in isSCnumber()
1241 else if (e->k == VKFLT && luaV_flttointeger(e->u.nval, &i, F2Ieq)) in isSCnumber()
1260 void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { in luaK_indexed() argument
1261 if (k->k == VKSTR) in luaK_indexed()
1262 str2K(fs, k); in luaK_indexed()
1264 (t->k == VLOCAL || t->k == VNONRELOC || t->k == VUPVAL)); in luaK_indexed()
1265 if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ in luaK_indexed()
1267 if (t->k == VUPVAL) { in luaK_indexed()
1269 t->u.ind.idx = k->u.info; /* literal string */ in luaK_indexed()
1270 t->k = VINDEXUP; in luaK_indexed()
1274 t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info; in luaK_indexed()
1275 if (isKstr(fs, k)) { in luaK_indexed()
1276 t->u.ind.idx = k->u.info; /* literal string */ in luaK_indexed()
1277 t->k = VINDEXSTR; in luaK_indexed()
1279 else if (isCint(k)) { in luaK_indexed()
1280 t->u.ind.idx = cast_int(k->u.ival); /* int. constant in proper range */ in luaK_indexed()
1281 t->k = VINDEXI; in luaK_indexed()
1284 t->u.ind.idx = luaK_exp2anyreg(fs, k); /* register */ in luaK_indexed()
1285 t->k = VINDEXED; in luaK_indexed()
1322 e1->k = VKINT; in constfolding()
1329 e1->k = VKFLT; in constfolding()
1345 e->k = VRELOC; /* all those operations are relocatable */ in codeunexpval()
1363 e1->k = VRELOC; /* all those operations are relocatable */ in finishbinexpval()
1390 lua_assert(e2->k == VKINT); in codebini()
1471 if (e1->k == VKINT && luaK_exp2RK(fs, e1)) { in codebitwise()
1475 else if (!(e2->k == VKINT && luaK_exp2RK(fs, e2))) { /* no constants? */ in codebitwise()
1482 lua_assert(ttisinteger(&fs->f->k[v2])); in codebitwise()
1514 e1->k = VJMP; in codeorder()
1527 if (e1->k != VNONRELOC) { in codeeq()
1528 lua_assert(e1->k == VK || e1->k == VKINT || e1->k == VKFLT); in codeeq()
1546 e1->k = VJMP; in codeeq()
1737 int k = (extra > 0); /* true iff needs extra argument */ in luaK_settablesize() local
1738 *inst = CREATE_ABCk(OP_NEWTABLE, ra, rb, rc, k); in luaK_settablesize()