interop/contract: micro-optimize argument pushes
Calling Estack() again and again is not very productive.
This commit is contained in:
parent
d1f4928e29
commit
8c704a49b5
1 changed files with 2 additions and 2 deletions
|
@ -115,8 +115,8 @@ func callExFromNative(ic *interop.Context, caller util.Uint160, cs *state.Contra
|
||||||
ic.VM.Invocations[cs.Hash]++
|
ic.VM.Invocations[cs.Hash]++
|
||||||
ic.VM.LoadScriptWithCallingHash(caller, cs.NEF.Script, cs.Hash, ic.VM.Context().GetCallFlags()&f, hasReturn, uint16(len(args)))
|
ic.VM.LoadScriptWithCallingHash(caller, cs.NEF.Script, cs.Hash, ic.VM.Context().GetCallFlags()&f, hasReturn, uint16(len(args)))
|
||||||
ic.VM.Context().NEF = &cs.NEF
|
ic.VM.Context().NEF = &cs.NEF
|
||||||
for i := len(args) - 1; i >= 0; i-- {
|
for e, i := ic.VM.Estack(), len(args)-1; i >= 0; i-- {
|
||||||
ic.VM.Estack().PushItem(args[i])
|
e.PushItem(args[i])
|
||||||
}
|
}
|
||||||
// use Jump not Call here because context was loaded in LoadScript above.
|
// use Jump not Call here because context was loaded in LoadScript above.
|
||||||
ic.VM.Jump(ic.VM.Context(), md.Offset)
|
ic.VM.Jump(ic.VM.Context(), md.Offset)
|
||||||
|
|
Loading…
Reference in a new issue