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

Function luaK_exp2RK

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

Source from the content-addressed store, hash-verified

524
525
526int luaK_exp2RK (FuncState *fs, expdesc *e) {
527 luaK_exp2val(fs, e);
528 switch (e->k) {
529 case VTRUE:
530 case VFALSE:
531 case VNIL: {
532 if (fs->nk <= MAXINDEXRK) { /* constant fits in RK operand? */
533 e->u.info = (e->k == VNIL) ? nilK(fs) : boolK(fs, (e->k == VTRUE));
534 e->k = VK;
535 return RKASK(e->u.info);
536 }
537 else break;
538 }
539 case VKNUM: {
540 e->u.info = luaK_numberK(fs, e->u.nval);
541 e->k = VK;
542 /* go through */
543 }
544 case VK: {
545 if (e->u.info <= MAXINDEXRK) /* constant fits in argC? */
546 return RKASK(e->u.info);
547 else break;
548 }
549 default: break;
550 }
551 /* not a constant in the right range: put it in a register */
552 return luaK_exp2anyreg(fs, e);
553}
554
555
556void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {

Callers 7

recfieldFunction · 0.70
luaK_storevarFunction · 0.70
luaK_selfFunction · 0.70
luaK_indexedFunction · 0.70
codearithFunction · 0.70
codecompFunction · 0.70
luaK_infixFunction · 0.70

Calls 5

luaK_exp2valFunction · 0.70
nilKFunction · 0.70
boolKFunction · 0.70
luaK_numberKFunction · 0.70
luaK_exp2anyregFunction · 0.70

Tested by

no test coverage detected