Browse Source

Merge commit 'ae7919722a73430ca76d764038daa024ae03d79c' into pr/evmjit-v0.1

cl-refactor
Paweł Bylica 10 years ago
parent
commit
104c14330d
  1. 16
      evmjit/libevmjit-cpp/JitVM.cpp
  2. 2
      evmjit/libevmjit/Common.h

16
evmjit/libevmjit-cpp/JitVM.cpp

@ -9,6 +9,8 @@ namespace dev
namespace eth namespace eth
{ {
extern "C" void env_sload(); // fake declaration for linker symbol stripping workaround, see a call below
bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const&, uint64_t) bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const&, uint64_t)
{ {
using namespace jit; using namespace jit;
@ -58,6 +60,9 @@ bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const&, uint64_t)
BOOST_THROW_EXCEPTION(StackTooSmall()); BOOST_THROW_EXCEPTION(StackTooSmall());
case ReturnCode::BadInstruction: case ReturnCode::BadInstruction:
BOOST_THROW_EXCEPTION(BadInstruction()); BOOST_THROW_EXCEPTION(BadInstruction());
case ReturnCode::LinkerWorkaround: // never happens
env_sload(); // but forces linker to include env_* JIT callback functions
break;
default: default:
break; break;
} }
@ -68,14 +73,3 @@ bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const&, uint64_t)
} }
} }
namespace
{
// MSVS linker ignores export symbols in Env.cpp if nothing points at least one of them
extern "C" void env_sload();
void linkerWorkaround()
{
env_sload();
(void)&linkerWorkaround; // suppress unused function warning from GCC
}
}

2
evmjit/libevmjit/Common.h

@ -39,6 +39,8 @@ enum class ReturnCode
LLVMLinkError = -7, LLVMLinkError = -7,
UnexpectedException = -8, UnexpectedException = -8,
LinkerWorkaround = -299,
}; };
/// Representation of 256-bit value binary compatible with LLVM i256 /// Representation of 256-bit value binary compatible with LLVM i256

Loading…
Cancel
Save