MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / lua_settable

Function lua_settable

ogsr_engine/LuaJIT/src/lj_api.c:960–977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

958/* -- Object setters ------------------------------------------------------ */
959
960LUA_API void lua_settable(lua_State *L, int idx)
961{
962 TValue *o;
963 cTValue *t = index2adr_check(L, idx);
964 lj_checkapi_slot(2);
965 o = lj_meta_tset(L, t, L->top-2);
966 if (o) {
967 /* NOBARRIER: lj_meta_tset ensures the table is not black. */
968 L->top -= 2;
969 copyTV(L, o, L->top+1);
970 } else {
971 TValue *base = L->top;
972 copyTV(L, base+2, base-3-2*LJ_FR2);
973 L->top = base+3;
974 lj_vm_call(L, base, 0+1);
975 L->top -= 3+LJ_FR2;
976 }
977}
978
979LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
980{

Callers 15

luaL_findtableFunction · 0.70
ll_registerFunction · 0.70
script_vars_dumpFunction · 0.50
setup_auto_loadMethod · 0.50
register_Method · 0.50
operator[]Method · 0.50
register_Method · 0.50
setMethod · 0.50
copy_member_tableFunction · 0.50
stage1Method · 0.50
settableMethod · 0.50

Calls 3

index2adr_checkFunction · 0.85
lj_meta_tsetFunction · 0.85
copyTVFunction · 0.85

Tested by

no test coverage detected