aboutsummaryrefslogtreecommitdiffstats
path: root/vm.cpp
diff options
context:
space:
mode:
authorPaweł Bylica <pawel.bylica@imapp.pl>2014-10-22 22:52:47 +0800
committerPaweł Bylica <pawel.bylica@imapp.pl>2014-10-22 22:52:47 +0800
commitd740145ecc4b5185fc2c1cab2f195501341e9edf (patch)
tree8c5e3d07eaed6a747ee55d5e25cf516162e123da /vm.cpp
parent44536d4327b6a67604db22cc9c8fe8e28b7c78bb (diff)
downloaddexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar.gz
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar.bz2
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar.lz
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar.xz
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.tar.zst
dexon-solidity-d740145ecc4b5185fc2c1cab2f195501341e9edf.zip
Update VM test engine to use VMFace interface
Diffstat (limited to 'vm.cpp')
-rw-r--r--vm.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/vm.cpp b/vm.cpp
index 179a47b9..4671a92b 100644
--- a/vm.cpp
+++ b/vm.cpp
@@ -517,16 +517,13 @@ 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";
- jit::VM jit(fev.gas);
- VM interpreter(fev.gas);
+ auto vm = useJit ? std::unique_ptr<VMFace>(new jit::VM) : std::unique_ptr<VMFace>(new VM);
+ vm->reset(fev.gas);
bytes output;
auto outOfGas = false;
try
{
- if (useJit)
- output = jit.go(fev).toVector();
- else
- output = interpreter.go(fev).toVector();
+ output = vm->go(fev).toVector();
}
catch (OutOfGas const&)
{
@@ -540,7 +537,7 @@ void doTests(json_spirit::mValue& v, bool _fillin)
{
cnote << "VM did throw an exception: " << _e.what();
}
- auto gas = useJit ? jit.gas() : interpreter.gas();
+ auto gas = vm->gas();
// delete null entries in storage for the sake of comparison