aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-10-23 00:48:14 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-10-23 00:48:14 +0800
commit6ac0c1302adbe9781a945377e369432bf37d0ea6 (patch)
tree472a1ddb8bb9d4ba05af6d16f8ea67fb2eb357a6
parentd740145ecc4b5185fc2c1cab2f195501341e9edf (diff)
downloaddexon-solidity-6ac0c1302adbe9781a945377e369432bf37d0ea6.tar.gz
dexon-solidity-6ac0c1302adbe9781a945377e369432bf37d0ea6.tar.zst
dexon-solidity-6ac0c1302adbe9781a945377e369432bf37d0ea6.zip
Change the way VMs are created (mostly for tracking where are created)
-rw-r--r--vm.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm.cpp b/vm.cpp
index 4671a92b..d62329af 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -436,7 +436,8 @@ h160 FakeState::createNewAddress(Address _newAddress, Address _sender, u256 _end
m_cache[_newAddress] = AddressState(0, balance(_newAddress) + _endowment, h256(), h256());
// Execute init code.
- VM vm(*_gas);
+ auto vmObj = VMFace::create(VMFace::Interpreter, *_gas);
+ VMFace& vm = *vmObj;
ExtVM evm(*this, _newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _code, o_ms, _level);
bool revert = false;
bytesConstRef out;
@@ -517,8 +518,8 @@ void doTests(json_spirit::mValue& v, bool _fillin)
auto argv = boost::unit_test::framework::master_test_suite().argv;
auto useJit = argc >= 2 && std::string(argv[1]) == "--jit";
- auto vm = useJit ? std::unique_ptr<VMFace>(new jit::VM) : std::unique_ptr<VMFace>(new VM);
- vm->reset(fev.gas);
+ auto vmKind = useJit ? VMFace::JIT : VMFace::Interpreter;
+ auto vm = VMFace::create(vmKind, fev.gas);
bytes output;
auto outOfGas = false;
try