cmd/evm, core/vm, tests: changed DisableVm to EnableVm
This commit is contained in:
@ -27,14 +27,13 @@ import (
|
||||
func init() {
|
||||
if os.Getenv("JITVM") == "true" {
|
||||
vm.ForceJit = true
|
||||
} else {
|
||||
vm.DisableJit = true
|
||||
vm.EnableJit = true
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkStateCall1024(b *testing.B) {
|
||||
fn := filepath.Join(stateTestDir, "stCallCreateCallCodeTest.json")
|
||||
if err := BenchVmTest(fn, bconf{"Call1024BalanceTooLow", true, false}, b); err != nil {
|
||||
if err := BenchVmTest(fn, bconf{"Call1024BalanceTooLow", true, os.Getenv("JITVM") == "true"}, b); err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ func BenchStateTest(p string, conf bconf, b *testing.B) error {
|
||||
return fmt.Errorf("test not found: %s", conf.name)
|
||||
}
|
||||
|
||||
pNoJit := vm.DisableJit
|
||||
vm.DisableJit = conf.nojit
|
||||
pJit := vm.EnableJit
|
||||
vm.EnableJit = conf.jit
|
||||
pForceJit := vm.ForceJit
|
||||
vm.ForceJit = conf.precomp
|
||||
|
||||
@ -94,7 +94,7 @@ func BenchStateTest(p string, conf bconf, b *testing.B) error {
|
||||
benchStateTest(test, env, b)
|
||||
}
|
||||
|
||||
vm.DisableJit = pNoJit
|
||||
vm.EnableJit = pJit
|
||||
vm.ForceJit = pForceJit
|
||||
|
||||
return nil
|
||||
|
@ -17,20 +17,21 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkVmAckermann32Tests(b *testing.B) {
|
||||
fn := filepath.Join(vmTestDir, "vmPerformanceTest.json")
|
||||
if err := BenchVmTest(fn, bconf{"ackermann32", true, false}, b); err != nil {
|
||||
if err := BenchVmTest(fn, bconf{"ackermann32", true, os.Getenv("JITVM") == "true"}, b); err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkVmFibonacci16Tests(b *testing.B) {
|
||||
fn := filepath.Join(vmTestDir, "vmPerformanceTest.json")
|
||||
if err := BenchVmTest(fn, bconf{"fibonacci16", true, false}, b); err != nil {
|
||||
if err := BenchVmTest(fn, bconf{"fibonacci16", true, os.Getenv("JITVM") == "true"}, b); err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func RunVmTestWithReader(r io.Reader, skipTests []string) error {
|
||||
type bconf struct {
|
||||
name string
|
||||
precomp bool
|
||||
nojit bool
|
||||
jit bool
|
||||
}
|
||||
|
||||
func BenchVmTest(p string, conf bconf, b *testing.B) error {
|
||||
@ -67,8 +67,8 @@ func BenchVmTest(p string, conf bconf, b *testing.B) error {
|
||||
return fmt.Errorf("test not found: %s", conf.name)
|
||||
}
|
||||
|
||||
pNoJit := vm.DisableJit
|
||||
vm.DisableJit = conf.nojit
|
||||
pJit := vm.EnableJit
|
||||
vm.EnableJit = conf.jit
|
||||
pForceJit := vm.ForceJit
|
||||
vm.ForceJit = conf.precomp
|
||||
|
||||
@ -99,7 +99,7 @@ func BenchVmTest(p string, conf bconf, b *testing.B) error {
|
||||
benchVmTest(test, env, b)
|
||||
}
|
||||
|
||||
vm.DisableJit = pNoJit
|
||||
vm.EnableJit = pJit
|
||||
vm.ForceJit = pForceJit
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user