mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change the way VMs are created (mostly for tracking where are created)
This commit is contained in:
parent
d740145ecc
commit
6ac0c1302a
7
vm.cpp
7
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());
|
m_cache[_newAddress] = AddressState(0, balance(_newAddress) + _endowment, h256(), h256());
|
||||||
|
|
||||||
// Execute init code.
|
// 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);
|
ExtVM evm(*this, _newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _code, o_ms, _level);
|
||||||
bool revert = false;
|
bool revert = false;
|
||||||
bytesConstRef out;
|
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 argv = boost::unit_test::framework::master_test_suite().argv;
|
||||||
auto useJit = argc >= 2 && std::string(argv[1]) == "--jit";
|
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);
|
auto vmKind = useJit ? VMFace::JIT : VMFace::Interpreter;
|
||||||
vm->reset(fev.gas);
|
auto vm = VMFace::create(vmKind, fev.gas);
|
||||||
bytes output;
|
bytes output;
|
||||||
auto outOfGas = false;
|
auto outOfGas = false;
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user