diff --git a/Makefile b/Makefile index f825e2a..52a5546 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,11 @@ TEST_RUNNER:=target/test_runner # Run all test fixtures .PHONY: test -test: testsuite test_runner wast $(patsubst ${JSON_DIR}/%.json, ${NO_TEST}, $(wildcard ${JSON_DIR}/*.json)) +test: build testsuite test_runner wast $(patsubst ${JSON_DIR}/%.json, ${NO_TEST}, $(wildcard ${JSON_DIR}/*.json)) + +.PHONY: build +build: + go build . target/test_runner: go build -o ${TEST_RUNNER} ./spec/test_runner diff --git a/compiler/module.go b/compiler/module.go index e85e8d7..040d994 100644 --- a/compiler/module.go +++ b/compiler/module.go @@ -144,7 +144,7 @@ func (m *Module) CompileWithNGen(gp GasPolicy, numGlobals uint64) (out string, r for i, f := range m.Base.FunctionIndexSpace { //fmt.Printf("Compiling function %d (%+v) with %d locals\n", i, f.Sig, len(f.Body.Locals)) - d, err := disasm.Disassemble(f, m.Base) + d, err := disasm.NewDisassembly(f, m.Base) if err != nil { panic(err) } @@ -220,7 +220,7 @@ func (m *Module) CompileForInterpreter(gp GasPolicy) (_retCode []InterpreterCode for i, f := range m.Base.FunctionIndexSpace { //fmt.Printf("Compiling function %d (%+v) with %d locals\n", i, f.Sig, len(f.Body.Locals)) - d, err := disasm.Disassemble(f, m.Base) + d, err := disasm.NewDisassembly(f, m.Base) if err != nil { panic(err) } diff --git a/compiler/serialize.go b/compiler/serialize.go index 3994daa..4408ae7 100644 --- a/compiler/serialize.go +++ b/compiler/serialize.go @@ -722,10 +722,10 @@ func (c *SSAFunctionCompiler) Serialize() []byte { binary.Write(buf, binary.LittleEndian, uint32(v)) } - case "current_memory": + case "memory.size": binary.Write(buf, binary.LittleEndian, opcodes.CurrentMemory) - case "grow_memory": + case "memory.grow": binary.Write(buf, binary.LittleEndian, opcodes.GrowMemory) binary.Write(buf, binary.LittleEndian, uint32(ins.Values[0])) diff --git a/go.mod b/go.mod index 2550d46..7596d46 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/perlin-network/life -replace github.com/go-interpreter/wagon v0.0.0 => github.com/perlin-network/wagon v0.3.1-0.20180825141017-f8cb99b55a39 +go 1.13 require ( - github.com/go-interpreter/wagon v0.0.0 + github.com/go-interpreter/wagon v0.6.1-0.20190923081222-01d3d3376951 + github.com/kr/pretty v0.1.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible - golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e // indirect + google.golang.org/appengine v1.6.5 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) - -go 1.13