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

Function mainLoopWithContext

_vm.go:33–61  ·  view source on GitHub ↗
(L *LState, baseframe *callFrame)

Source from the content-addressed store, hash-verified

31}
32
33func mainLoopWithContext(L *LState, baseframe *callFrame) {
34 var inst uint32
35 var cf *callFrame
36
37 if L.stack.IsEmpty() {
38 return
39 }
40
41 L.currentFrame = L.stack.Last()
42 if L.currentFrame.Fn.IsG {
43 callGFunction(L, false)
44 return
45 }
46
47 for {
48 cf = L.currentFrame
49 inst = cf.Fn.Proto.Code[cf.Pc]
50 cf.Pc++
51 select {
52 case <-L.ctx.Done():
53 L.RaiseError(L.ctx.Err().Error())
54 return
55 default:
56 if jumpTable[int(inst>>26)](L, inst, baseframe) == 1 {
57 return
58 }
59 }
60 }
61}
62
63// regv is the first target register to copy the return values to.
64// 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…