MCPcopy Create free account
hub / github.com/F-Stack/f-stack / exp2reg

Function exp2reg

freebsd/contrib/openzfs/module/lua/lcode.c:466–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464
465
466static void exp2reg (FuncState *fs, expdesc *e, int reg) {
467 discharge2reg(fs, e, reg);
468 if (e->k == VJMP)
469 luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */
470 if (hasjumps(e)) {
471 int final; /* position after whole expression */
472 int p_f = NO_JUMP; /* position of an eventual LOAD false */
473 int p_t = NO_JUMP; /* position of an eventual LOAD true */
474 if (need_value(fs, e->t) || need_value(fs, e->f)) {
475 int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs);
476 p_f = code_label(fs, reg, 0, 1);
477 p_t = code_label(fs, reg, 1, 0);
478 luaK_patchtohere(fs, fj);
479 }
480 final = luaK_getlabel(fs);
481 patchlistaux(fs, e->f, final, reg, p_f);
482 patchlistaux(fs, e->t, final, reg, p_t);
483 }
484 e->f = e->t = NO_JUMP;
485 e->u.info = reg;
486 e->k = VNONRELOC;
487}
488
489
490void luaK_exp2nextreg (FuncState *fs, expdesc *e) {

Callers 3

luaK_exp2nextregFunction · 0.70
luaK_exp2anyregFunction · 0.70
luaK_storevarFunction · 0.70

Calls 8

discharge2regFunction · 0.70
luaK_concatFunction · 0.70
need_valueFunction · 0.70
luaK_jumpFunction · 0.70
code_labelFunction · 0.70
luaK_patchtohereFunction · 0.70
luaK_getlabelFunction · 0.70
patchlistauxFunction · 0.70

Tested by

no test coverage detected