MCPcopy Index your code
hub / github.com/Shopify/go-lua / init

Function init

vm.go:305–928  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303var jumpTable []engineOp
304
305func init() {
306 jumpTable = []engineOp{
307 func(e *engine, i instruction) (engineOp, instruction) { // opMove
308 e.frame[i.a()] = e.frame[i.b()]
309 if e.hooked() {
310 e.hook()
311 }
312 i = e.callInfo.step()
313 return jumpTable[i.opCode()], i
314 },
315 func(e *engine, i instruction) (engineOp, instruction) { // opLoadConstant
316 e.frame[i.a()] = e.constants[i.bx()]
317 if e.hooked() {
318 e.hook()
319 }
320 i = e.callInfo.step()
321 return jumpTable[i.opCode()], i
322 },
323 func(e *engine, i instruction) (engineOp, instruction) { // opLoadConstantEx
324 e.frame[i.a()] = e.constants[e.expectNext(opExtraArg).ax()]
325 if e.hooked() {
326 e.hook()
327 }
328 i = e.callInfo.step()
329 return jumpTable[i.opCode()], i
330 },
331 func(e *engine, i instruction) (engineOp, instruction) { // opLoadBool
332 e.frame[i.a()] = i.b() != 0
333 if i.c() != 0 {
334 e.callInfo.skip()
335 }
336 if e.hooked() {
337 e.hook()
338 }
339 i = e.callInfo.step()
340 return jumpTable[i.opCode()], i
341 },
342 func(e *engine, i instruction) (engineOp, instruction) { // opLoadNil
343 a, b := i.a(), i.b()
344 clear(e.frame[a : a+b+1])
345 if e.hooked() {
346 e.hook()
347 }
348 i = e.callInfo.step()
349 return jumpTable[i.opCode()], i
350 },
351 func(e *engine, i instruction) (engineOp, instruction) { // opGetUpValue
352 e.frame[i.a()] = e.closure.upValue(i.b())
353 if e.hooked() {
354 e.hook()
355 }
356 i = e.callInfo.step()
357 return jumpTable[i.opCode()], i
358 },
359 func(e *engine, i instruction) (engineOp, instruction) { // opGetTableUp
360 tmp := e.l.tableAt(e.closure.upValue(i.b()), e.k(i.c()))
361 e.frame = e.callInfo.frame
362 e.frame[i.a()] = tmp

Callers

nothing calls this directly

Calls 15

clearFunction · 0.85
float8TypeAlias · 0.85
newTableWithSizeFunction · 0.85
intFromFloat8Function · 0.85
newTableFunction · 0.85
isFalseFunction · 0.85
cachedFunction · 0.85
aMethod · 0.80
bMethod · 0.80
hookedMethod · 0.80
stepMethod · 0.80
opCodeMethod · 0.80

Tested by

no test coverage detected