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

Function callTM

freebsd/contrib/openzfs/module/lua/lvm.c:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92static void callTM (lua_State *L, const TValue *f, const TValue *p1,
93 const TValue *p2, TValue *p3, int hasres) {
94 if (L == NULL) return;
95
96 ptrdiff_t result = savestack(L, p3);
97 setobj2s(L, L->top++, f); /* push function */
98 setobj2s(L, L->top++, p1); /* 1st argument */
99 setobj2s(L, L->top++, p2); /* 2nd argument */
100 if (!hasres) /* no result? 'p3' is third argument */
101 setobj2s(L, L->top++, p3); /* 3rd argument */
102 /* metamethod may yield only when called from Lua code */
103 luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci));
104 if (hasres) { /* if has result, move it to its place */
105 p3 = restorestack(L, result);
106 setobjs2s(L, p3, --L->top);
107 }
108}
109
110
111void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {

Callers 5

luaV_gettableFunction · 0.70
luaV_settableFunction · 0.70
call_binTMFunction · 0.70
luaV_equalobj_Function · 0.70
luaV_objlenFunction · 0.70

Calls 1

luaD_callFunction · 0.70

Tested by

no test coverage detected