(L *LState, tailcall bool)
| 103 | } |
| 104 | |
| 105 | func callGFunction(L *LState, tailcall bool) bool { |
| 106 | frame := L.currentFrame |
| 107 | gfnret := frame.Fn.GFunction(L) |
| 108 | if tailcall { |
| 109 | L.currentFrame = L.RemoveCallerFrame() |
| 110 | } |
| 111 | |
| 112 | if gfnret < 0 { |
| 113 | switchToParentThread(L, L.GetTop(), false, false) |
| 114 | return true |
| 115 | } |
| 116 | |
| 117 | wantret := frame.NRet |
| 118 | if wantret == MultRet { |
| 119 | wantret = gfnret |
| 120 | } |
| 121 | |
| 122 | if tailcall && L.Parent != nil && L.stack.Sp() == 1 { |
| 123 | switchToParentThread(L, wantret, false, true) |
| 124 | return true |
| 125 | } |
| 126 | |
| 127 | // +inline-call L.reg.CopyRange frame.ReturnBase L.reg.Top()-gfnret -1 wantret |
| 128 | L.stack.Pop() |
| 129 | L.currentFrame = L.stack.Last() |
| 130 | return false |
| 131 | } |
| 132 | |
| 133 | func threadRun(L *LState) { |
| 134 | if L.stack.IsEmpty() { |
no test coverage detected
searching dependent graphs…