MCPcopy Index your code
hub / github.com/yuin/gopher-lua / mainLoopWithContext

Function mainLoopWithContext

vm.go:37–65  ·  view source on GitHub ↗
(L *LState, baseframe *callFrame)

Source from the content-addressed store, hash-verified

35}
36
37func mainLoopWithContext(L *LState, baseframe *callFrame) {
38 var inst uint32
39 var cf *callFrame
40
41 if L.stack.IsEmpty() {
42 return
43 }
44
45 L.currentFrame = L.stack.Last()
46 if L.currentFrame.Fn.IsG {
47 callGFunction(L, false)
48 return
49 }
50
51 for {
52 cf = L.currentFrame
53 inst = cf.Fn.Proto.Code[cf.Pc]
54 cf.Pc++
55 select {
56 case <-L.ctx.Done():
57 L.RaiseError(L.ctx.Err().Error())
58 return
59 default:
60 if jumpTable[int(inst>>26)](L, inst, baseframe) == 1 {
61 return
62 }
63 }
64 }
65}
66
67// regv is the first target register to copy the return values to.
68// It can be reg.top, indicating that the copied values are going into new registers, or it can be below reg.top

Callers

nothing calls this directly

Calls 5

callGFunctionFunction · 0.70
IsEmptyMethod · 0.65
LastMethod · 0.65
ErrorMethod · 0.65
RaiseErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…