vm: extract shared parts of the Context

Local calls reuse them, cross-contract calls create new ones. This allows to
avoid some allocations and use a little less memory.
This commit is contained in:
Roman Khimov 2022-08-04 16:15:51 +03:00
parent e5c59f8ddd
commit 13f5fdbe8a
7 changed files with 112 additions and 108 deletions

View file

@ -56,7 +56,7 @@ func opParamSlotsPushVM(op opcode.Opcode, param []byte, sslot int, slotloc int,
return nil
}
if sslot != 0 {
v.Context().static.init(sslot, &v.refs)
v.Context().sc.static.init(sslot, &v.refs)
}
if slotloc != 0 && slotarg != 0 {
v.Context().local.init(slotloc, &v.refs)