Browse Source

Merge pull request #1973 from imapp-pl/pr/evmjit_cmake_fix

Do not override CMAKE_CXX_FLAGS in evmjit.
cl-refactor
Gav Wood 10 years ago
parent
commit
0bb19d3b1c
  1. 2
      evmjit/CMakeLists.txt
  2. 4
      evmjit/include/evmjit/JIT.h
  3. 2
      evmjit/libevmjit/ExecutionEngine.cpp
  4. 8
      evmjit/libevmjit/JIT.cpp

2
evmjit/CMakeLists.txt

@ -7,7 +7,7 @@ set(CMAKE_AUTOMOC OFF)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
else() else()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas") set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas ${CMAKE_CXX_FLAGS}")
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

4
evmjit/include/evmjit/JIT.h

@ -28,8 +28,8 @@ public:
private: private:
friend class dev::eth::jit::ExecutionEngine; friend class dev::eth::jit::ExecutionEngine;
static void* getCode(h256 _codeHash); static uint64_t getCode(h256 _codeHash);
static void mapCode(h256 _codeHash, void* _funcAddr); static void mapCode(h256 _codeHash, uint64_t _funcAddr);
}; };
} }

2
evmjit/libevmjit/ExecutionEngine.cpp

@ -183,7 +183,7 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env)
entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName); entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName);
if (!CHECK(entryFuncPtr)) if (!CHECK(entryFuncPtr))
return ReturnCode::LLVMLinkError; return ReturnCode::LLVMLinkError;
JIT::mapCode(_data->codeHash, (void*)entryFuncPtr); // FIXME: Remove cast JIT::mapCode(_data->codeHash, (uint64_t)entryFuncPtr); // FIXME: Remove cast
} }
listener->stateChanged(ExecState::Execution); listener->stateChanged(ExecState::Execution);

8
evmjit/libevmjit/JIT.cpp

@ -12,7 +12,7 @@ namespace
class JITImpl: JIT class JITImpl: JIT
{ {
public: public:
std::unordered_map<h256, void*> codeMap; std::unordered_map<h256, uint64_t> codeMap;
static JITImpl& instance() static JITImpl& instance()
{ {
@ -28,16 +28,16 @@ bool JIT::isCodeReady(h256 _codeHash)
return JITImpl::instance().codeMap.count(_codeHash) != 0; return JITImpl::instance().codeMap.count(_codeHash) != 0;
} }
void* JIT::getCode(h256 _codeHash) uint64_t JIT::getCode(h256 _codeHash)
{ {
auto& codeMap = JITImpl::instance().codeMap; auto& codeMap = JITImpl::instance().codeMap;
auto it = codeMap.find(_codeHash); auto it = codeMap.find(_codeHash);
if (it != codeMap.end()) if (it != codeMap.end())
return it->second; return it->second;
return nullptr; return 0;
} }
void JIT::mapCode(h256 _codeHash, void* _funcAddr) void JIT::mapCode(h256 _codeHash, uint64_t _funcAddr)
{ {
JITImpl::instance().codeMap.insert(std::make_pair(_codeHash, _funcAddr)); JITImpl::instance().codeMap.insert(std::make_pair(_codeHash, _funcAddr));
} }

Loading…
Cancel
Save