aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jit_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/jit_test.go')
-rw-r--r--core/vm/jit_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/vm/jit_test.go b/core/vm/jit_test.go
index 43b1dee2a..c503a3a81 100644
--- a/core/vm/jit_test.go
+++ b/core/vm/jit_test.go
@@ -84,7 +84,7 @@ func TestCompiling(t *testing.T) {
func TestResetInput(t *testing.T) {
var sender account
- env := NewEnv()
+ env := NewEnv(false, true)
contract := NewContract(sender, sender, big.NewInt(100), big.NewInt(10000), big.NewInt(0))
contract.CodeAddr = &common.Address{}
@@ -143,10 +143,7 @@ func runVmBench(test vmBench, b *testing.B) {
if test.precompile && !test.forcejit {
NewProgram(test.code)
}
- env := NewEnv()
-
- EnableJit = !test.nojit
- ForceJit = test.forcejit
+ env := NewEnv(test.nojit, test.forcejit)
b.ResetTimer()
@@ -168,12 +165,16 @@ type Env struct {
evm *EVM
}
-func NewEnv() *Env {
+func NewEnv(noJit, forceJit bool) *Env {
env := &Env{gasLimit: big.NewInt(10000), depth: 0}
- env.evm = New(env, nil)
+ env.evm = New(env, Config{
+ EnableJit: !noJit,
+ ForceJit: forceJit,
+ })
return env
}
+func (self *Env) RuleSet() RuleSet { return ruleSet{new(big.Int)} }
func (self *Env) Vm() Vm { return self.evm }
func (self *Env) Origin() common.Address { return common.Address{} }
func (self *Env) BlockNumber() *big.Int { return big.NewInt(0) }