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

Function init

_vm.go:167–829  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165var jumpTable [opCodeMax + 1]instFunc
166
167func init() {
168 jumpTable = [opCodeMax + 1]instFunc{
169 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVE
170 reg := L.reg
171 cf := L.currentFrame
172 lbase := cf.LocalBase
173 A := int(inst>>18) & 0xff //GETA
174 RA := lbase + A
175 B := int(inst & 0x1ff) //GETB
176 v := reg.Get(lbase + B)
177 // +inline-call reg.Set RA v
178 return 0
179 },
180 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVEN
181 reg := L.reg
182 cf := L.currentFrame
183 lbase := cf.LocalBase
184 A := int(inst>>18) & 0xff //GETA
185 B := int(inst & 0x1ff) //GETB
186 C := int(inst>>9) & 0x1ff //GETC
187 v := reg.Get(lbase + B)
188 // +inline-call reg.Set lbase+A v
189 code := cf.Fn.Proto.Code
190 pc := cf.Pc
191 for i := 0; i < C; i++ {
192 inst = code[pc]
193 pc++
194 A = int(inst>>18) & 0xff //GETA
195 B = int(inst & 0x1ff) //GETB
196 v := reg.Get(lbase + B)
197 // +inline-call reg.Set lbase+A v
198 }
199 cf.Pc = pc
200 return 0
201 },
202 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_LOADK
203 reg := L.reg
204 cf := L.currentFrame
205 lbase := cf.LocalBase
206 A := int(inst>>18) & 0xff //GETA
207 RA := lbase + A
208 Bx := int(inst & 0x3ffff) //GETBX
209 v := cf.Fn.Proto.Constants[Bx]
210 // +inline-call reg.Set RA v
211 return 0
212 },
213 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_LOADBOOL
214 reg := L.reg
215 cf := L.currentFrame
216 lbase := cf.LocalBase
217 A := int(inst>>18) & 0xff //GETA
218 RA := lbase + A
219 B := int(inst & 0x1ff) //GETB
220 C := int(inst>>9) & 0x1ff //GETC
221 if B != 0 {
222 // +inline-call reg.Set RA LTrue
223 } else {
224 // +inline-call reg.Set RA LFalse

Callers

nothing calls this directly

Calls 15

newLTableFunction · 0.85
parseNumberFunction · 0.85
LVIsFalseFunction · 0.85
strCmpFunction · 0.85
LVAsBoolFunction · 0.85
LNumberTypeAlias · 0.85
newLFunctionLFunction · 0.85
opGetArgBFunction · 0.85
opGetOpCodeFunction · 0.85
ValueMethod · 0.80
SetValueMethod · 0.80
stringConcatFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…