mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
minor changes in the compiler driver
This commit is contained in:
parent
c4eb835aba
commit
1cf3549116
1 changed files with 11 additions and 13 deletions
|
|
@ -91,12 +91,12 @@ int main(int argc, char** argv)
|
||||||
std::cout << assembly << std::endl;
|
std::cout << assembly << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_compile)
|
if (opt_compile || opt_interpret)
|
||||||
{
|
{
|
||||||
auto compiler = eth::jit::Compiler();
|
auto compiler = eth::jit::Compiler();
|
||||||
auto module = compiler.compile({bytecode.data(), bytecode.size()});
|
auto module = compiler.compile({bytecode.data(), bytecode.size()});
|
||||||
llvm::raw_os_ostream out(std::cout);
|
|
||||||
module->print(out, nullptr);
|
module->dump();
|
||||||
|
|
||||||
if (opt_dump_graph)
|
if (opt_dump_graph)
|
||||||
{
|
{
|
||||||
|
|
@ -105,17 +105,15 @@ int main(int argc, char** argv)
|
||||||
ofs.close();
|
ofs.close();
|
||||||
std::cout << "Basic blocks graph written to block.dot\n";
|
std::cout << "Basic blocks graph written to block.dot\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (opt_interpret)
|
if (opt_interpret)
|
||||||
{
|
{
|
||||||
auto engine = eth::jit::ExecutionEngine();
|
auto engine = eth::jit::ExecutionEngine();
|
||||||
auto module = eth::jit::Compiler().compile({bytecode.data(), bytecode.size()});
|
u256 gas = 10000;
|
||||||
module->dump();
|
auto result = engine.run(std::move(module), gas);
|
||||||
u256 gas = 10000;
|
return result;
|
||||||
auto result = engine.run(std::move(module), gas);
|
}
|
||||||
return result;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue