Browse Source

--vm command line option replacing --jit.

cl-refactor
Paweł Bylica 10 years ago
parent
commit
5df0d1b872
  1. 15
      eth/main.cpp
  2. 9
      ethvm/main.cpp
  3. 15
      neth/main.cpp
  4. 4
      test/TestHelper.cpp

15
eth/main.cpp

@ -193,7 +193,7 @@ void help()
<< "General Options:" << endl
<< " -d,--db-path <path> Load database from path (default: " << getDataDir() << ")" << endl
#if ETH_EVMJIT || !ETH_TRUE
<< " -J,--jit Enable EVM JIT (default: off)." << endl
<< " --vm=<vm-kind> Select VM. Options are: jit, smart. (default: interpreter)" << endl
#endif
<< " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 8)." << endl
<< " -V,--version Show the version and exit." << endl
@ -313,7 +313,6 @@ int main(int argc, char** argv)
string jsonAdmin;
bool upnp = true;
WithExisting killChain = WithExisting::Trust;
bool jit = false;
string sentinel;
/// Networking params.
@ -667,10 +666,10 @@ int main(int argc, char** argv)
}
}
#if ETH_EVMJIT
else if (arg == "-J" || arg == "--jit")
{
jit = true;
}
else if (arg == "--vm=jit")
VMFactory::setKind(VMKind::JIT);
else if (arg == "--vm=smart")
VMFactory::setKind(VMKind::Smart);
#endif
else if (arg == "-h" || arg == "--help")
help();
@ -707,7 +706,7 @@ int main(int argc, char** argv)
g_logPost = [&](std::string const& a, char const*){
static SpinLock s_lock;
SpinGuard l(s_lock);
if (g_silence)
logbuf += a + "\n";
else
@ -735,7 +734,6 @@ int main(int argc, char** argv)
};
StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat, structuredLoggingURL);
VMFactory::setKind(jit ? VMKind::JIT : VMKind::Interpreter);
auto netPrefs = publicIP.empty() ? NetworkPreferences(listenIP ,listenPort, upnp) : NetworkPreferences(publicIP, listenIP ,listenPort, upnp);
netPrefs.discovery = !disableDiscovery;
netPrefs.pin = pinning;
@ -1864,4 +1862,3 @@ int main(int argc, char** argv)
writeFile((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp", netData);
return 0;
}

9
ethvm/main.cpp

@ -43,11 +43,10 @@ void help()
<< " --gas-price <n> Transaction's gas price' should be <n> (default: 0)." << endl
<< " --sender <a> Transaction sender should be <a> (default: 0000...0069)." << endl
<< " --origin <a> Transaction origin should be <a> (default: 0000...0069)." << endl
#if ETH_EVMJIT || !ETH_TRUE
#if ETH_EVMJIT || !ETH_TRUETRUE
<< endl
<< "VM options:" << endl
<< " -J,--jit Enable LLVM VM (default: off)." << endl
<< " --smart Enable smart VM (default: off)." << endl
<< " --vm=<vm-kind> Select VM. Options are: jit, smart. (default: interpreter)" << endl
#endif
<< endl
<< "Options for trace:" << endl
@ -97,9 +96,9 @@ int main(int argc, char** argv)
else if (arg == "-V" || arg == "--version")
version();
#if ETH_EVMJIT
else if (arg == "-J" || arg == "--jit")
else if (arg == "--vm=jit")
VMFactory::setKind(VMKind::JIT);
else if (arg == "--smart")
else if (arg == "--vm=smart")
VMFactory::setKind(VMKind::Smart);
#endif
else if (arg == "--mnemonics")

15
neth/main.cpp

@ -101,7 +101,7 @@ void help()
<< " -x,--peers <number> Attempt to connect to given number of peers (default: 5)." << endl
<< " -V,--version Show the version and exit." << endl
#if ETH_EVMJIT
<< " --jit Use EVM JIT (default: off)." << endl
<< " --vm=<vm-kind> Select VM. Options are: jit, smart. (default: interpreter)" << endl
#endif
;
exit(0);
@ -514,15 +514,12 @@ int main(int argc, char** argv)
return -1;
}
}
else if (arg == "--jit")
{
#if ETH_EVMJIT
jit = true;
#else
cerr << "EVM JIT not enabled" << endl;
return -1;
else if (arg == "--vm=jit")
VMFactory::setKind(VMKind::JIT);
else if (arg == "--vm=smart")
VMFactory::setKind(VMKind::Smart);
#endif
}
else if (arg == "-h" || arg == "--help")
help();
else if (arg == "-V" || arg == "--version")
@ -551,7 +548,7 @@ int main(int argc, char** argv)
mode == NodeMode::Full ? set<string>{"eth", "shh"} : set<string>(),
netPrefs,
&nodesState);
web3.setIdealPeerCount(peers);
std::shared_ptr<eth::BasicGasPricer> gasPricer = make_shared<eth::BasicGasPricer>(u256(double(ether / 1000) / etherPrice), u256(blockFees * 1000));
eth::Client* c = mode == NodeMode::Full ? web3.ethereum() : nullptr;

4
test/TestHelper.cpp

@ -235,7 +235,7 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state)
}
void ImportTest::importTransaction(json_spirit::mObject& _o)
{
{
if (_o.count("secretKey") > 0)
{
assert(_o.count("nonce") > 0);
@ -728,7 +728,7 @@ Options::Options()
for (auto i = 0; i < argc; ++i)
{
auto arg = std::string{argv[i]};
if (arg == "--jit")
if (arg == "--jit" || arg == "--vm=jit") // TODO: Remove deprecated option "--jit"
eth::VMFactory::setKind(eth::VMKind::JIT);
else if (arg == "--vm=smart")
eth::VMFactory::setKind(eth::VMKind::Smart);

Loading…
Cancel
Save