mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-07 05:07:36 +00:00
vm: embed reference counter in compound items
``` name old time/op new time/op delta RefCounter_Add-8 44.8ns ± 4% 11.7ns ± 3% -73.94% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
dc9287bf5c
commit
4f98ec2f53
7 changed files with 99 additions and 55 deletions
|
@ -105,7 +105,6 @@ func NewWithTrigger(t trigger.Type) *VM {
|
|||
Invocations: make(map[util.Uint160]int),
|
||||
}
|
||||
|
||||
vm.refs.items = make(map[stackitem.Item]int)
|
||||
initStack(&vm.istack, "invocation", nil)
|
||||
vm.estack = newStack("evaluation", &vm.refs)
|
||||
return vm
|
||||
|
@ -520,7 +519,7 @@ func (v *VM) execute(ctx *Context, op opcode.Opcode, parameter []byte) (err erro
|
|||
if errRecover := recover(); errRecover != nil {
|
||||
v.state = FaultState
|
||||
err = newError(ctx.ip, op, errRecover)
|
||||
} else if v.refs.size > MaxStackSize {
|
||||
} else if v.refs > MaxStackSize {
|
||||
v.state = FaultState
|
||||
err = newError(ctx.ip, op, "stack is too big")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue