mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
A bit of work in evmcc. Not ready yet.
This commit is contained in:
parent
b98725861d
commit
adb5a6869f
1 changed files with 22 additions and 21 deletions
|
|
@ -16,8 +16,8 @@
|
||||||
#include <libdevcore/CommonIO.h>
|
#include <libdevcore/CommonIO.h>
|
||||||
#include <libevmcore/Instruction.h>
|
#include <libevmcore/Instruction.h>
|
||||||
#include <libevm/ExtVMFace.h>
|
#include <libevm/ExtVMFace.h>
|
||||||
#include <libevmjit/Compiler.h>
|
#include <evmjit/libevmjit/Compiler.h>
|
||||||
#include <libevmjit/ExecutionEngine.h>
|
#include <evmjit/libevmjit/ExecutionEngine.h>
|
||||||
|
|
||||||
|
|
||||||
void parseProgramOptions(int _argc, char** _argv, boost::program_options::variables_map& _varMap)
|
void parseProgramOptions(int _argc, char** _argv, boost::program_options::variables_map& _varMap)
|
||||||
|
|
@ -97,7 +97,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string src((std::istreambuf_iterator<char>(ifs)),
|
std::string src((std::istreambuf_iterator<char>(ifs)),
|
||||||
(std::istreambuf_iterator<char>()));
|
(std::istreambuf_iterator<char>()));
|
||||||
|
|
||||||
boost::algorithm::trim(src);
|
boost::algorithm::trim(src);
|
||||||
|
|
||||||
|
|
@ -165,8 +165,8 @@ int main(int argc, char** argv)
|
||||||
if (options.count("verbose"))
|
if (options.count("verbose"))
|
||||||
{
|
{
|
||||||
std::cerr << "*** Compilation time: "
|
std::cerr << "*** Compilation time: "
|
||||||
<< std::chrono::duration_cast<std::chrono::microseconds>(compilationEndTime - compilationStartTime).count()
|
<< std::chrono::duration_cast<std::chrono::microseconds>(compilationEndTime - compilationStartTime).count()
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.count("interpret"))
|
if (options.count("interpret"))
|
||||||
|
|
@ -174,23 +174,24 @@ int main(int argc, char** argv)
|
||||||
auto engine = eth::jit::ExecutionEngine();
|
auto engine = eth::jit::ExecutionEngine();
|
||||||
u256 gas = initialGas;
|
u256 gas = initialGas;
|
||||||
|
|
||||||
// Create fake ExtVM interface
|
// Create fake ExtVM interface
|
||||||
eth::ExtVMFace ext;
|
eth::ExtVMFace ext;
|
||||||
ext.myAddress = Address(1122334455667788);
|
ext.myAddress = Address(1122334455667788);
|
||||||
ext.caller = Address(0xfacefacefaceface);
|
ext.caller = Address(0xfacefacefaceface);
|
||||||
ext.origin = Address(101010101010101010);
|
ext.origin = Address(101010101010101010);
|
||||||
ext.value = 0xabcd;
|
ext.value = 0xabcd;
|
||||||
ext.gasPrice = 1002;
|
ext.gasPrice = 1002;
|
||||||
ext.previousBlock.hash = u256(1003);
|
ext.previousBlock.hash = u256(1003);
|
||||||
ext.currentBlock.coinbaseAddress = Address(1004);
|
ext.currentBlock.coinbaseAddress = Address(1004);
|
||||||
ext.currentBlock.timestamp = 1005;
|
ext.currentBlock.timestamp = 1005;
|
||||||
ext.currentBlock.number = 1006;
|
ext.currentBlock.number = 1006;
|
||||||
ext.currentBlock.difficulty = 1007;
|
ext.currentBlock.difficulty = 1007;
|
||||||
ext.currentBlock.gasLimit = 1008;
|
ext.currentBlock.gasLimit = 1008;
|
||||||
ext.data = std::string("Hello the Beautiful World of Ethereum!");
|
ext.data = std::string("Hello the Beautiful World of Ethereum!");
|
||||||
ext.code = { 0x0d, 0x0e, 0x0a, 0x0d, 0x0b, 0x0e, 0xe, 0xf };
|
ext.code = { 0x0d, 0x0e, 0x0a, 0x0d, 0x0b, 0x0e, 0xe, 0xf };
|
||||||
|
|
||||||
auto result = engine.run(std::move(module), gas, options.count("show-logs") > 0, ext);
|
// BROKEN: env_* functions must be implemented & RuntimeData struct created
|
||||||
|
auto result = engine.run(std::move(module), gas, ext);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue