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

Method DischargeVariables

code.go:597–614  ·  view source on GitHub ↗
(e exprDesc)

Source from the content-addressed store, hash-verified

595}
596
597func (f *function) DischargeVariables(e exprDesc) exprDesc {
598 switch e.kind {
599 case kindLocal:
600 e.kind = kindNonRelocatable
601 case kindUpValue:
602 e.kind, e.info = kindRelocatable, f.EncodeABC(opGetUpValue, 0, e.info, 0)
603 case kindIndexed:
604 if f.freeRegister(e.index); e.tableType == kindLocal {
605 f.freeRegister(e.table)
606 e.kind, e.info = kindRelocatable, f.EncodeABC(opGetTable, 0, e.table, e.index)
607 } else {
608 e.kind, e.info = kindRelocatable, f.EncodeABC(opGetTableUp, 0, e.table, e.index)
609 }
610 case kindVarArg, kindCall:
611 e = f.SetReturn(e)
612 }
613 return e
614}
615
616func (f *function) dischargeToRegister(e exprDesc, r int) exprDesc {
617 switch e = f.DischargeVariables(e); e.kind {

Callers 9

dischargeToRegisterMethod · 0.95
ExpressionToValueMethod · 0.95
GoIfTrueMethod · 0.95
GoIfFalseMethod · 0.95
encodeNotMethod · 0.95
PostfixMethod · 0.95
primaryExpressionMethod · 0.80

Calls 3

EncodeABCMethod · 0.95
freeRegisterMethod · 0.95
SetReturnMethod · 0.95

Tested by

no test coverage detected