Running vm_tests with JIT

This commit is contained in:
Paweł Bylica 2014-10-17 10:58:10 +02:00
parent 09a50c84a5
commit 8c871d0f9a

11
vm.cpp
View File

@ -22,6 +22,7 @@
#include "vm.h" #include "vm.h"
#include <libdevcore/CommonIO.h> #include <libdevcore/CommonIO.h>
#include <libevmjit/VM.h>
#define FILL_TESTS #define FILL_TESTS
@ -510,11 +511,21 @@ void doTests(json_spirit::mValue& v, bool _fillin)
bytes output; bytes output;
u256 gas; u256 gas;
try try
{
auto useJit = true;
if (useJit)
{
jit::VM vm(fev.gas);
output = vm.go(fev);
gas = vm.gas();
}
else
{ {
VM vm(fev.gas); VM vm(fev.gas);
output = vm.go(fev).toVector(); output = vm.go(fev).toVector();
gas = vm.gas(); // Get the remaining gas gas = vm.gas(); // Get the remaining gas
} }
}
catch (Exception const& _e) catch (Exception const& _e)
{ {
cnote << "VM did throw an exception: " << diagnostic_information(_e); cnote << "VM did throw an exception: " << diagnostic_information(_e);