aboutsummaryrefslogtreecommitdiffstats
path: root/vm/common.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-13 22:05:56 +0800
committerobscuren <geffobscura@gmail.com>2015-02-13 22:05:56 +0800
commita5ea21cd85530eee6eb1bb83c37c20d009f11f74 (patch)
treee5be5bd595139ff7dfbe6261e1e659d8e7dd6f9c /vm/common.go
parentdb24fb792cf0dab91bc85e79aecf6758349002a4 (diff)
parent38faf2c51a1e4a86cda5dfa1b4f7fdae4fd7f58d (diff)
downloaddexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.gz
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.bz2
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.lz
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.xz
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.tar.zst
dexon-a5ea21cd85530eee6eb1bb83c37c20d009f11f74.zip
merge
Diffstat (limited to 'vm/common.go')
-rw-r--r--vm/common.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vm/common.go b/vm/common.go
index ff187001f..45a7187a9 100644
--- a/vm/common.go
+++ b/vm/common.go
@@ -18,6 +18,18 @@ const (
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)