mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 19:29:39 +00:00
vm: remove alt.stack
It is no longer present in NEO3.
This commit is contained in:
parent
d6342ab68c
commit
261ff3c655
4 changed files with 0 additions and 18 deletions
|
@ -51,7 +51,6 @@ func evalWithArgs(t *testing.T, src string, op []byte, args []stackitem.Item, re
|
|||
|
||||
func assertResult(t *testing.T, vm *vm.VM, result interface{}) {
|
||||
assert.Equal(t, result, vm.PopResult())
|
||||
assert.Equal(t, 0, vm.Astack().Len())
|
||||
assert.Equal(t, 0, vm.Istack().Len())
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@ type Context struct {
|
|||
// Evaluation stack pointer.
|
||||
estack *Stack
|
||||
|
||||
// Alt stack pointer.
|
||||
astack *Stack
|
||||
|
||||
static *Slot
|
||||
local *Slot
|
||||
arguments *Slot
|
||||
|
|
13
pkg/vm/vm.go
13
pkg/vm/vm.go
|
@ -70,7 +70,6 @@ type VM struct {
|
|||
|
||||
istack *Stack // invocation stack.
|
||||
estack *Stack // execution stack.
|
||||
astack *Stack // alt stack.
|
||||
|
||||
refs *refCounter
|
||||
|
||||
|
@ -100,7 +99,6 @@ func NewWithTrigger(t trigger.Type) *VM {
|
|||
}
|
||||
|
||||
vm.estack = vm.newItemStack("evaluation")
|
||||
vm.astack = vm.newItemStack("alt")
|
||||
|
||||
vm.RegisterInteropGetter(getDefaultVMInterop)
|
||||
return vm
|
||||
|
@ -142,11 +140,6 @@ func (v *VM) Estack() *Stack {
|
|||
return v.estack
|
||||
}
|
||||
|
||||
// Astack returns the alt stack so interop hooks can utilize this.
|
||||
func (v *VM) Astack() *Stack {
|
||||
return v.astack
|
||||
}
|
||||
|
||||
// Istack returns the invocation stack so interop hooks can utilize this.
|
||||
func (v *VM) Istack() *Stack {
|
||||
return v.istack
|
||||
|
@ -264,7 +257,6 @@ func (v *VM) Load(prog []byte) {
|
|||
// Clear all stacks and state, it could be a reload.
|
||||
v.istack.Clear()
|
||||
v.estack.Clear()
|
||||
v.astack.Clear()
|
||||
v.state = noneState
|
||||
v.gasConsumed = 0
|
||||
v.LoadScript(prog)
|
||||
|
@ -281,7 +273,6 @@ func (v *VM) LoadScript(b []byte) {
|
|||
func (v *VM) LoadScriptWithFlags(b []byte, f smartcontract.CallFlag) {
|
||||
ctx := NewContext(b)
|
||||
ctx.estack = v.estack
|
||||
ctx.astack = v.astack
|
||||
ctx.callFlag = f
|
||||
v.istack.PushVal(ctx)
|
||||
}
|
||||
|
@ -319,9 +310,6 @@ func (v *VM) PopResult() interface{} {
|
|||
// Stack returns json formatted representation of the given stack.
|
||||
func (v *VM) Stack(n string) string {
|
||||
var s *Stack
|
||||
if n == "astack" {
|
||||
s = v.astack
|
||||
}
|
||||
if n == "istack" {
|
||||
s = v.istack
|
||||
}
|
||||
|
@ -1304,7 +1292,6 @@ func (v *VM) execute(ctx *Context, op opcode.Opcode, parameter []byte) (err erro
|
|||
newEstack.Push(elem)
|
||||
}
|
||||
v.estack = newEstack
|
||||
v.astack = v.Context().astack
|
||||
}
|
||||
|
||||
case opcode.NEWMAP:
|
||||
|
|
|
@ -149,7 +149,6 @@ func TestPushBytes1to75(t *testing.T) {
|
|||
errExec := vm.execute(nil, opcode.RET, nil)
|
||||
require.NoError(t, errExec)
|
||||
|
||||
assert.Equal(t, 0, vm.astack.Len())
|
||||
assert.Equal(t, 0, vm.istack.Len())
|
||||
buf.Reset()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue