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

Function init

vm.go:301–2207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299var jumpTable [opCodeMax + 1]instFunc
300
301func init() {
302 jumpTable = [opCodeMax + 1]instFunc{
303 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVE
304 reg := L.reg
305 cf := L.currentFrame
306 lbase := cf.LocalBase
307 A := int(inst>>18) & 0xff //GETA
308 RA := lbase + A
309 B := int(inst & 0x1ff) //GETB
310 v := reg.Get(lbase + B)
311 // this section is inlined by go-inline
312 // source function is 'func (rg *registry) Set(regi int, vali LValue) ' in '_state.go'
313 {
314 rg := reg
315 regi := RA
316 vali := v
317 newSize := regi + 1
318 // this section is inlined by go-inline
319 // source function is 'func (rg *registry) checkSize(requiredSize int) ' in '_state.go'
320 {
321 requiredSize := newSize
322 if requiredSize > cap(rg.array) {
323 rg.resize(requiredSize)
324 }
325 }
326 rg.array[regi] = vali
327 if regi >= rg.top {
328 rg.top = regi + 1
329 }
330 }
331 return 0
332 },
333 func(L *LState, inst uint32, baseframe *callFrame) int { //OP_MOVEN
334 reg := L.reg
335 cf := L.currentFrame
336 lbase := cf.LocalBase
337 A := int(inst>>18) & 0xff //GETA
338 B := int(inst & 0x1ff) //GETB
339 C := int(inst>>9) & 0x1ff //GETC
340 v := reg.Get(lbase + B)
341 // this section is inlined by go-inline
342 // source function is 'func (rg *registry) Set(regi int, vali LValue) ' in '_state.go'
343 {
344 rg := reg
345 regi := lbase + A
346 vali := v
347 newSize := regi + 1
348 // this section is inlined by go-inline
349 // source function is 'func (rg *registry) checkSize(requiredSize int) ' in '_state.go'
350 {
351 requiredSize := newSize
352 if requiredSize > cap(rg.array) {
353 rg.resize(requiredSize)
354 }
355 }
356 rg.array[regi] = vali
357 if regi >= rg.top {
358 rg.top = regi + 1

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…