MCPcopy Create free account
hub / github.com/yuin/gopher-lua / PropagateKMV

Method PropagateKMV

compile.go:203–222  ·  view source on GitHub ↗
(top int, save *int, reg *int, inc int)

Source from the content-addressed store, hash-verified

201}
202
203func (cd *codeStore) PropagateKMV(top int, save *int, reg *int, inc int) {
204 lastinst := cd.Last()
205 if opGetArgA(lastinst) >= top {
206 switch opGetOpCode(lastinst) {
207 case OP_LOADK:
208 cindex := opGetArgBx(lastinst)
209 if cindex <= opMaxIndexRk {
210 cd.Pop()
211 *save = opRkAsk(cindex)
212 return
213 }
214 case OP_MOVE:
215 cd.Pop()
216 *save = opGetArgB(lastinst)
217 return
218 }
219 }
220 *save = *reg
221 *reg = *reg + inc
222}
223
224func (cd *codeStore) PropagateMV(top int, save *int, reg *int, inc int) {
225 lastinst := cd.Last()

Callers 1

compileAssignStmtRightFunction · 0.80

Calls 7

LastMethod · 0.95
PopMethod · 0.95
opGetArgAFunction · 0.85
opGetOpCodeFunction · 0.85
opGetArgBxFunction · 0.85
opRkAskFunction · 0.85
opGetArgBFunction · 0.85

Tested by

no test coverage detected