Lines Matching full:e1

524 ** Free registers used by expressions 'e1' and 'e2' (if any) in proper
527 static void freeexps (FuncState *fs, expdesc *e1, expdesc *e2) { in freeexps() argument
528 int r1 = (e1->k == VNONRELOC) ? e1->u.info : -1; in freeexps()
1338 ** (In this case, 'e1' has the final result.)
1340 static int constfolding (FuncState *fs, int op, expdesc *e1, in constfolding() argument
1343 if (!tonumeral(e1, &v1) || !tonumeral(e2, &v2) || !validop(op, &v1, &v2)) in constfolding()
1347 e1->k = VKINT; in constfolding()
1348 e1->u.ival = ivalue(&res); in constfolding()
1354 e1->k = VKFLT; in constfolding()
1355 e1->u.nval = n; in constfolding()
1408 ** Expression to produce final result will be encoded in 'e1'.
1410 static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2, in finishbinexpval() argument
1413 int v1 = luaK_exp2anyreg(fs, e1); in finishbinexpval()
1415 freeexps(fs, e1, e2); in finishbinexpval()
1416 e1->u.info = pc; in finishbinexpval()
1417 e1->k = VRELOC; /* all those operations are relocatable */ in finishbinexpval()
1429 expdesc *e1, expdesc *e2, int line) { in codebinexpval() argument
1432 /* 'e1' must be already in a register or it is a constant */ in codebinexpval()
1433 lua_assert((VNIL <= e1->k && e1->k <= VKSTR) || in codebinexpval()
1434 e1->k == VNONRELOC || e1->k == VRELOC); in codebinexpval()
1436 finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, binopr2TM(opr)); in codebinexpval()
1444 expdesc *e1, expdesc *e2, int flip, int line, in codebini() argument
1448 finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINI, event); in codebini()
1456 expdesc *e1, expdesc *e2, int flip, int line) { in codebinK() argument
1460 finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event); in codebinK()
1467 static int finishbinexpneg (FuncState *fs, expdesc *e1, expdesc *e2, in finishbinexpneg() argument
1477 finishbinexpval(fs, e1, e2, op, int2sC(-v2), 0, line, OP_MMBINI, event); in finishbinexpneg()
1486 static void swapexps (expdesc *e1, expdesc *e2) { in swapexps() argument
1487 expdesc temp = *e1; *e1 = *e2; *e2 = temp; /* swap 'e1' and 'e2' */ in swapexps()
1495 expdesc *e1, expdesc *e2, int flip, int line) { in codebinNoK() argument
1497 swapexps(e1, e2); /* back to original order */ in codebinNoK()
1498 codebinexpval(fs, opr, e1, e2, line); /* use standard operators */ in codebinNoK()
1507 expdesc *e1, expdesc *e2, int flip, int line) { in codearith() argument
1509 codebinK(fs, opr, e1, e2, flip, line); in codearith()
1511 codebinNoK(fs, opr, e1, e2, flip, line); in codearith()
1521 expdesc *e1, expdesc *e2, int line) { in codecommutative() argument
1523 if (tonumeral(e1, NULL)) { /* is first operand a numeric constant? */ in codecommutative()
1524 swapexps(e1, e2); /* change order */ in codecommutative()
1528 codebini(fs, OP_ADDI, e1, e2, flip, line, TM_ADD); in codecommutative()
1530 codearith(fs, op, e1, e2, flip, line); in codecommutative()
1539 expdesc *e1, expdesc *e2, int line) { in codebitwise() argument
1541 if (e1->k == VKINT) { in codebitwise()
1542 swapexps(e1, e2); /* 'e2' will be the constant operand */ in codebitwise()
1546 codebinK(fs, opr, e1, e2, flip, line); in codebitwise()
1548 codebinNoK(fs, opr, e1, e2, flip, line); in codebitwise()
1556 static void codeorder (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { in codeorder() argument
1563 r1 = luaK_exp2anyreg(fs, e1); in codeorder()
1567 else if (isSCnumber(e1, &im, &isfloat)) { in codeorder()
1574 r1 = luaK_exp2anyreg(fs, e1); in codeorder()
1578 freeexps(fs, e1, e2); in codeorder()
1579 e1->u.info = condjump(fs, op, r1, r2, isfloat, 1); in codeorder()
1580 e1->k = VJMP; in codeorder()
1586 ** 'e1' was already put as RK by 'luaK_infix'.
1588 static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { in codeeq() argument
1593 if (e1->k != VNONRELOC) { in codeeq()
1594 lua_assert(e1->k == VK || e1->k == VKINT || e1->k == VKFLT); in codeeq()
1595 swapexps(e1, e2); in codeeq()
1597 r1 = luaK_exp2anyreg(fs, e1); /* 1st expression must be in register */ in codeeq()
1610 freeexps(fs, e1, e2); in codeeq()
1611 e1->u.info = condjump(fs, op, r1, r2, isfloat, (opr == OPR_EQ)); in codeeq()
1612 e1->k = VJMP; in codeeq()
1685 ** Create code for '(e1 .. e2)'.
1686 ** For '(e1 .. e2.1 .. e2.2)' (which is '(e1 .. (e2.1 .. e2.2))',
1689 static void codeconcat (FuncState *fs, expdesc *e1, expdesc *e2, int line) { in codeconcat() argument
1693 lua_assert(e1->u.info + 1 == GETARG_A(*ie2)); in codeconcat()
1695 SETARG_A(*ie2, e1->u.info); /* correct first element ('e1') */ in codeconcat()
1699 luaK_codeABC(fs, OP_CONCAT, e1->u.info, 2, 0); /* new concat opcode */ in codeconcat()
1710 expdesc *e1, expdesc *e2, int line) { in luaK_posfix() argument
1712 if (foldbinop(opr) && constfolding(fs, opr + LUA_OPADD, e1, e2)) in luaK_posfix()
1716 lua_assert(e1->t == NO_JUMP); /* list closed by 'luaK_infix' */ in luaK_posfix()
1717 luaK_concat(fs, &e2->f, e1->f); in luaK_posfix()
1718 *e1 = *e2; in luaK_posfix()
1722 lua_assert(e1->f == NO_JUMP); /* list closed by 'luaK_infix' */ in luaK_posfix()
1723 luaK_concat(fs, &e2->t, e1->t); in luaK_posfix()
1724 *e1 = *e2; in luaK_posfix()
1727 case OPR_CONCAT: { /* e1 .. e2 */ in luaK_posfix()
1729 codeconcat(fs, e1, e2, line); in luaK_posfix()
1733 codecommutative(fs, opr, e1, e2, line); in luaK_posfix()
1737 if (finishbinexpneg(fs, e1, e2, OP_ADDI, line, TM_SUB)) in luaK_posfix()
1742 codearith(fs, opr, e1, e2, 0, line); in luaK_posfix()
1746 codebitwise(fs, opr, e1, e2, line); in luaK_posfix()
1750 if (isSCint(e1)) { in luaK_posfix()
1751 swapexps(e1, e2); in luaK_posfix()
1752 codebini(fs, OP_SHLI, e1, e2, 1, line, TM_SHL); /* I << r2 */ in luaK_posfix()
1754 else if (finishbinexpneg(fs, e1, e2, OP_SHRI, line, TM_SHL)) { in luaK_posfix()
1758 codebinexpval(fs, opr, e1, e2, line); in luaK_posfix()
1763 codebini(fs, OP_SHRI, e1, e2, 0, line, TM_SHR); /* r1 >> I */ in luaK_posfix()
1765 codebinexpval(fs, opr, e1, e2, line); in luaK_posfix()
1769 codeeq(fs, opr, e1, e2); in luaK_posfix()
1774 swapexps(e1, e2); in luaK_posfix()
1778 codeorder(fs, opr, e1, e2); in luaK_posfix()