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

Method jumpOnCondition

code.go:775–785  ·  view source on GitHub ↗
(e exprDesc, cond int)

Source from the content-addressed store, hash-verified

773}
774
775func (f *function) jumpOnCondition(e exprDesc, cond int) int {
776 if e.kind == kindRelocatable {
777 if i := f.Instruction(e); i.opCode() == opNot {
778 f.dropLastInstruction() // remove previous opNot
779 return f.conditionalJump(opTest, i.b(), 0, not(cond))
780 }
781 }
782 e = f.dischargeToAnyRegister(e)
783 f.freeExpression(e)
784 return f.conditionalJump(opTestSet, noRegister, e.info, cond)
785}
786
787func (f *function) GoIfTrue(e exprDesc) exprDesc {
788 pc := noJump

Callers 2

GoIfTrueMethod · 0.95
GoIfFalseMethod · 0.95

Calls 8

InstructionMethod · 0.95
dropLastInstructionMethod · 0.95
conditionalJumpMethod · 0.95
freeExpressionMethod · 0.95
notFunction · 0.85
opCodeMethod · 0.80
bMethod · 0.80

Tested by

no test coverage detected