MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaK_dischargevars

Function luaK_dischargevars

src/Chain/libraries/glua/lcode.cpp:407–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405
406
407void luaK_dischargevars(FuncState *fs, expdesc *e) {
408 switch (e->k) {
409 case VLOCAL: {
410 e->k = VNONRELOC;
411 break;
412 }
413 case VUPVAL: {
414 e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0);
415 e->k = VRELOCABLE;
416 break;
417 }
418 case VINDEXED: {
419 OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */
420 freereg(fs, e->u.ind.idx);
421 if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */
422 freereg(fs, e->u.ind.t);
423 op = OP_GETTABLE;
424 }
425 e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx);
426 e->k = VRELOCABLE;
427 break;
428 }
429 case VVARARG:
430 case VCALL: {
431 luaK_setoneret(fs, e);
432 break;
433 }
434 default: break; /* there is one value available (somewhere) */
435 }
436}
437
438
439static int code_label(FuncState *fs, int A, int b, int jump) {

Callers 9

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

Calls 3

luaK_codeABCFunction · 0.85
freeregFunction · 0.85
luaK_setoneretFunction · 0.85

Tested by

no test coverage detected