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

Method loadNil

code.go:355–367  ·  view source on GitHub ↗
(from, n int)

Source from the content-addressed store, hash-verified

353}
354
355func (f *function) loadNil(from, n int) {
356 if len(f.f.code) > f.lastTarget { // no jumps to current position
357 if previous := &f.f.code[len(f.f.code)-1]; previous.opCode() == opLoadNil {
358 if pf, pl, l := previous.a(), previous.a()+previous.b(), from+n-1; pf <= from && from <= pl+1 || from <= pf && pf <= l+1 { // can connect both
359 from, l = min(from, pf), max(l, pl)
360 previous.setA(from)
361 previous.setB(l - from)
362 return
363 }
364 }
365 }
366 f.EncodeABC(opLoadNil, from, n-1, 0)
367}
368
369func (f *function) Jump() int {
370 f.assert(f.isJumpListWalkable(f.jumpPC))

Callers 2

dischargeToRegisterMethod · 0.95
AdjustAssignmentMethod · 0.95

Calls 8

EncodeABCMethod · 0.95
minFunction · 0.85
maxFunction · 0.85
opCodeMethod · 0.80
aMethod · 0.80
bMethod · 0.80
setAMethod · 0.80
setBMethod · 0.80

Tested by

no test coverage detected