Browse Source

forgot to add new source files

cl-refactor
Artur Zawłocki 10 years ago
parent
commit
5a173029ad
  1. 28
      libethereum/VMFactory.cpp
  2. 28
      libethereum/VMFactory.h

28
libethereum/VMFactory.cpp

@ -0,0 +1,28 @@
#include <libevm/VM.h>
#if ETH_EVMJIT
#include<libevmjit/VM.h>
#endif
#include "VMFactory.h"
namespace dev
{
namespace eth
{
std::unique_ptr<VMFace> VMFactory::create(VMFactory::Kind _kind, u256 _gas)
{
#if ETH_EVMJIT
auto vm = _kind == Kind::JIT ? static_cast<VMFace*>(new jit::VM)
: static_cast<VMFace*>(new VM);
#else
VMFace* vm = new VM;
#endif
vm->reset(_gas);
return std::unique_ptr<VMFace>(vm);
}
}
}

28
libethereum/VMFactory.h

@ -0,0 +1,28 @@
#pragma once
#include <libevm/VMFace.h>
namespace dev
{
namespace eth
{
/**
*/
class VMFactory
{
public:
enum Kind: bool {
Interpreter,
#if ETH_EVMJIT
JIT
#endif
};
static std::unique_ptr<VMFace> create(Kind, u256 _gas = 0);
};
}
}
Loading…
Cancel
Save