aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-01-13 07:29:41 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-01-13 07:29:41 +0800
commit5b561f434d888b750bb9b29726a86d664ac89660 (patch)
treebca348257d0f28f3f126788768c50d11e9ecc335 /vm
parent750d70c2024784227c8ac920d651c337c2de207e (diff)
parentba225017c4c1b60dff57ad56da4e8972812a17e2 (diff)
downloadgo-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar.gz
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar.bz2
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar.lz
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar.xz
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.tar.zst
go-tangerine-5b561f434d888b750bb9b29726a86d664ac89660.zip
Merge pull request #254 from chfast/pr/jitvm_stub
JitVm struct stub. Forwards calls to DebugVm.
Diffstat (limited to 'vm')
-rw-r--r--vm/common.go1
-rw-r--r--vm/vm.go2
-rw-r--r--vm/vm_jit.go31
3 files changed, 34 insertions, 0 deletions
diff --git a/vm/common.go b/vm/common.go
index f19b0fe4b..ed250dab1 100644
--- a/vm/common.go
+++ b/vm/common.go
@@ -14,6 +14,7 @@ type Type int
const (
StandardVmTy Type = iota
DebugVmTy
+ JitVmTy
MaxVmTy
)
diff --git a/vm/vm.go b/vm/vm.go
index a5ea297b3..b795bb86e 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -15,6 +15,8 @@ func New(env Environment, typ Type) VirtualMachine {
switch typ {
case DebugVmTy:
return NewDebugVm(env)
+ case JitVmTy:
+ return NewJitVm(env)
default:
return &Vm{env: env}
}
diff --git a/vm/vm_jit.go b/vm/vm_jit.go
new file mode 100644
index 000000000..c715abab0
--- /dev/null
+++ b/vm/vm_jit.go
@@ -0,0 +1,31 @@
+package vm
+
+import "math/big"
+
+type JitVm struct {
+ env Environment
+ backup *DebugVm
+}
+
+func NewJitVm(env Environment) *JitVm {
+ backupVm := NewDebugVm(env)
+ return &JitVm{env: env, backup: backupVm}
+}
+
+func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) {
+ return self.backup.Run(me, caller, code, value, gas, price, callData)
+}
+
+func (self *JitVm) Printf(format string, v ...interface{}) VirtualMachine {
+ return self.backup.Printf(format, v)
+}
+
+func (self *JitVm) Endl() VirtualMachine {
+ return self.backup.Endl()
+}
+
+func (self *JitVm) Env() Environment {
+ return self.env
+}
+
+//go is nice \ No newline at end of file