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

Function luaK_dischargevars

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

Source from the content-addressed store, hash-verified

379
380
381void luaK_dischargevars (FuncState *fs, expdesc *e) {
382 switch (e->k) {
383 case VLOCAL: {
384 e->k = VNONRELOC;
385 break;
386 }
387 case VUPVAL: {
388 e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0);
389 e->k = VRELOCABLE;
390 break;
391 }
392 case VINDEXED: {
393 OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */
394 freereg(fs, e->u.ind.idx);
395 if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */
396 freereg(fs, e->u.ind.t);
397 op = OP_GETTABLE;
398 }
399 e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx);
400 e->k = VRELOCABLE;
401 break;
402 }
403 case VVARARG:
404 case VCALL: {
405 luaK_setoneret(fs, e);
406 break;
407 }
408 default: break; /* there is one value available (somewhere) */
409 }
410}
411
412
413static int code_label (FuncState *fs, int A, int b, int jump) {

Callers 9

primaryexpFunction · 0.70
discharge2regFunction · 0.70
luaK_exp2nextregFunction · 0.70
luaK_exp2anyregFunction · 0.70
luaK_exp2valFunction · 0.70
luaK_goiftrueFunction · 0.70
luaK_goiffalseFunction · 0.70
codenotFunction · 0.70
luaK_posfixFunction · 0.70

Calls 3

luaK_codeABCFunction · 0.70
freeregFunction · 0.70
luaK_setoneretFunction · 0.70

Tested by

no test coverage detected