MCPcopy Create free account
hub / github.com/yuin/gopher-lua / callR

Method callR

state.go:1246–1274  ·  view source on GitHub ↗

+inline-end

(nargs, nret, rbase int)

Source from the content-addressed store, hash-verified

1244} // +inline-end
1245
1246func (ls *LState) callR(nargs, nret, rbase int) {
1247 base := ls.reg.Top() - nargs - 1
1248 if rbase < 0 {
1249 rbase = base
1250 }
1251 lv := ls.reg.Get(base)
1252 fn, meta := ls.metaCall(lv)
1253 ls.pushCallFrame(callFrame{
1254 Fn: fn,
1255 Pc: 0,
1256 Base: base,
1257 LocalBase: base + 1,
1258 ReturnBase: rbase,
1259 NArgs: nargs,
1260 NRet: nret,
1261 Parent: ls.currentFrame,
1262 TailCall: 0,
1263 }, lv, meta)
1264 if ls.G.MainThread == nil {
1265 ls.G.MainThread = ls
1266 ls.G.CurrentThread = ls
1267 ls.mainLoop(ls, nil)
1268 } else {
1269 ls.mainLoop(ls, ls.currentFrame)
1270 }
1271 if nret != MultRet {
1272 ls.reg.SetTop(rbase + nret)
1273 }
1274}
1275
1276func (ls *LState) getField(obj LValue, key LValue) LValue {
1277 curobj := obj

Callers 3

CallMethod · 0.95
initFunction · 0.45
initFunction · 0.45

Calls 5

metaCallMethod · 0.95
pushCallFrameMethod · 0.95
TopMethod · 0.45
GetMethod · 0.45
SetTopMethod · 0.45

Tested by

no test coverage detected