MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / reglevel

Function reglevel

3rd/lua-5.4.3/src/lparser.c:229–236  ·  view source on GitHub ↗

** Convert 'nvar', a compiler index level, to its corresponding ** register. For that, search for the highest variable below that level ** that is in a register and uses its register index ('ridx') plus one. */

Source from the content-addressed store, hash-verified

227** that is in a register and uses its register index ('ridx') plus one.
228*/
229static int reglevel (FuncState *fs, int nvar) {
230 while (nvar-- > 0) {
231 Vardesc *vd = getlocalvardesc(fs, nvar); /* get previous variable */
232 if (vd->vd.kind != RDKCTC) /* is in a register? */
233 return vd->vd.ridx + 1;
234 }
235 return 0; /* no variables in registers */
236}
237
238
239/*

Callers 6

luaY_nvarstackFunction · 0.85
movegotosoutFunction · 0.85
leaveblockFunction · 0.85
gotostatFunction · 0.85
repeatstatFunction · 0.85
checktocloseFunction · 0.85

Calls 1

getlocalvardescFunction · 0.85

Tested by

no test coverage detected