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

Method expressionToRegister

code.go:655–675  ·  view source on GitHub ↗
(e exprDesc, r int)

Source from the content-addressed store, hash-verified

653}
654
655func (f *function) expressionToRegister(e exprDesc, r int) exprDesc {
656 if e = f.dischargeToRegister(e, r); e.kind == kindJump {
657 e.t = f.Concatenate(e.t, e.info)
658 }
659 if e.hasJumps() {
660 loadFalse, loadTrue := noJump, noJump
661 if f.needValue(e.t) || f.needValue(e.f) {
662 jump := noJump
663 if e.kind != kindJump {
664 jump = f.Jump()
665 }
666 loadFalse, loadTrue = f.encodeLabel(r, 0, 1), f.encodeLabel(r, 1, 0)
667 f.PatchToHere(jump)
668 }
669 end := f.Label()
670 f.patchListHelper(e.f, end, r, loadFalse)
671 f.patchListHelper(e.t, end, r, loadTrue)
672 }
673 e.f, e.t, e.info, e.kind = noJump, noJump, r, kindNonRelocatable
674 return e
675}
676
677func (f *function) ExpressionToNextRegister(e exprDesc) exprDesc {
678 e = f.DischargeVariables(e)

Callers 3

StoreVariableMethod · 0.95

Calls 9

dischargeToRegisterMethod · 0.95
ConcatenateMethod · 0.95
needValueMethod · 0.95
JumpMethod · 0.95
encodeLabelMethod · 0.95
PatchToHereMethod · 0.95
LabelMethod · 0.95
patchListHelperMethod · 0.95
hasJumpsMethod · 0.80

Tested by

no test coverage detected