mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
Merge branch 'develop-evmcc' of github.com:imapp-pl/ethereum into develop-evmcc
This commit is contained in:
commit
ce889fc338
3 changed files with 16 additions and 14 deletions
|
|
@ -156,8 +156,8 @@ void Compiler::createBasicBlocks(bytesConstRef bytecode)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "Bad JUMP at PC " << it->first
|
clog(JIT) << "Bad JUMP at PC " << it->first
|
||||||
<< ": " << it->second << " is not a valid PC\n";
|
<< ": " << it->second << " is not a valid PC";
|
||||||
m_directJumpTargets[it->first] = m_badJumpBlock->llvm();
|
m_directJumpTargets[it->first] = m_badJumpBlock->llvm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,8 @@ int ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, u256& _gas, ExtV
|
||||||
auto finalizationStartTime = std::chrono::high_resolution_clock::now();
|
auto finalizationStartTime = std::chrono::high_resolution_clock::now();
|
||||||
exec->finalizeObject();
|
exec->finalizeObject();
|
||||||
auto finalizationEndTime = std::chrono::high_resolution_clock::now();
|
auto finalizationEndTime = std::chrono::high_resolution_clock::now();
|
||||||
std::cerr << "*** Module finalization time: "
|
clog(JIT) << "Module finalization time: "
|
||||||
<< std::chrono::duration_cast<std::chrono::microseconds>(finalizationEndTime - finalizationStartTime).count()
|
<< std::chrono::duration_cast<std::chrono::microseconds>(finalizationEndTime - finalizationStartTime).count();
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
// Create fake ExtVM interface
|
// Create fake ExtVM interface
|
||||||
if (!_ext)
|
if (!_ext)
|
||||||
|
|
@ -117,9 +116,8 @@ int ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, u256& _gas, ExtV
|
||||||
returnCode = static_cast<ReturnCode>(result.IntVal.getZExtValue());
|
returnCode = static_cast<ReturnCode>(result.IntVal.getZExtValue());
|
||||||
|
|
||||||
auto executionEndTime = std::chrono::high_resolution_clock::now();
|
auto executionEndTime = std::chrono::high_resolution_clock::now();
|
||||||
std::cerr << "*** Execution time: "
|
clog(JIT) << "Execution time : "
|
||||||
<< std::chrono::duration_cast<std::chrono::microseconds>(executionEndTime - executionStartTime).count()
|
<< std::chrono::duration_cast<std::chrono::microseconds>(executionEndTime - executionStartTime).count();
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -128,19 +126,20 @@ int ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, u256& _gas, ExtV
|
||||||
// Return remaining gas
|
// Return remaining gas
|
||||||
_gas = returnCode == ReturnCode::OutOfGas ? 0 : runtime.getGas();
|
_gas = returnCode == ReturnCode::OutOfGas ? 0 : runtime.getGas();
|
||||||
|
|
||||||
std::cout << "Max stack size: " << Stack::maxStackSize << std::endl;
|
clog(JIT) << "Max stack size: " << Stack::maxStackSize;
|
||||||
|
|
||||||
if (returnCode == ReturnCode::Return)
|
if (returnCode == ReturnCode::Return)
|
||||||
{
|
{
|
||||||
returnData = runtime.getReturnData().toVector(); // TODO: It might be better to place is in Runtime interface
|
returnData = runtime.getReturnData().toVector(); // TODO: It might be better to place is in Runtime interface
|
||||||
|
|
||||||
std::cout << "RETURN [ ";
|
auto&& log = clog(JIT);
|
||||||
|
log << "RETURN [ ";
|
||||||
for (auto it = returnData.begin(), end = returnData.end(); it != end; ++it)
|
for (auto it = returnData.begin(), end = returnData.end(); it != end; ++it)
|
||||||
std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)*it << " ";
|
log << std::hex << std::setw(2) << std::setfill('0') << (int)*it << " ";
|
||||||
std::cout << "]\n";
|
log << "]";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
std::cout << "RETURN CODE: " << (int)returnCode << std::endl;
|
cslog(JIT) << "RETURN " << (int)returnCode;
|
||||||
|
|
||||||
return static_cast<int>(returnCode);
|
return static_cast<int>(returnCode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include <llvm/IR/IRBuilder.h>
|
#include <llvm/IR/IRBuilder.h>
|
||||||
|
|
||||||
#include <libdevcore/Common.h>
|
#include <libdevcore/Common.h>
|
||||||
|
#include <libdevcore/Log.h>
|
||||||
|
|
||||||
namespace dev
|
namespace dev
|
||||||
{
|
{
|
||||||
|
|
@ -12,6 +13,8 @@ namespace eth
|
||||||
namespace jit
|
namespace jit
|
||||||
{
|
{
|
||||||
|
|
||||||
|
struct JIT: public NoteChannel { static const char* name() { return "JIT"; } };
|
||||||
|
|
||||||
/// Representation of 256-bit value binary compatible with LLVM i256
|
/// Representation of 256-bit value binary compatible with LLVM i256
|
||||||
// TODO: Replace with h256
|
// TODO: Replace with h256
|
||||||
struct i256
|
struct i256
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue