aboutsummaryrefslogtreecommitdiffstats
path: root/vm/common.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/common.go')
-rw-r--r--vm/common.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/vm/common.go b/vm/common.go
index acf18eede..45a7187a9 100644
--- a/vm/common.go
+++ b/vm/common.go
@@ -9,15 +9,27 @@ import (
var vmlogger = logger.NewLogger("VM")
-type Type int
+type Type byte
const (
- StandardVmTy Type = iota
- DebugVmTy
+ StdVmTy Type = iota
+ JitVmTy
MaxVmTy
)
+func NewVm(env Environment) VirtualMachine {
+ switch env.VmType() {
+ case JitVmTy:
+ return NewJitVm(env)
+ default:
+ vmlogger.Infoln("unsupported vm type %d", env.VmType())
+ fallthrough
+ case StdVmTy:
+ return New(env)
+ }
+}
+
var (
GasStep = big.NewInt(1)
GasSha = big.NewInt(10)
@@ -49,7 +61,7 @@ var (
S256 = ethutil.S256
)
-const MaxCallDepth = 1024
+const MaxCallDepth = 1025
func calcMemSize(off, l *big.Int) *big.Int {
if l.Cmp(ethutil.Big0) == 0 {