Browse Source

Remove terminate() function

cl-refactor
Paweł Bylica 10 years ago
parent
commit
86553cda81
  1. 21
      libevmjit/Runtime.cpp
  2. 3
      libevmjit/Runtime.h
  3. 9
      libevmjit/Utils.cpp
  4. 2
      libevmjit/Utils.h

21
libevmjit/Runtime.cpp

@ -11,29 +11,12 @@ namespace eth
{
namespace jit
{
namespace
{
jmp_buf_ref g_currJmpBuf;
}
jmp_buf_ref Runtime::getCurrJmpBuf()
{
return g_currJmpBuf;
}
Runtime::Runtime(RuntimeData* _data, Env* _env) :
m_data(*_data),
m_env(*_env),
m_currJmpBuf(m_jmpBuf),
m_prevJmpBuf(g_currJmpBuf)
{
g_currJmpBuf = m_jmpBuf;
}
Runtime::~Runtime()
{
g_currJmpBuf = m_prevJmpBuf;
}
m_currJmpBuf(m_jmpBuf)
{}
bytes Runtime::getReturnData() const // FIXME: Reconsider returning by copy
{

3
libevmjit/Runtime.h

@ -32,7 +32,6 @@ class Runtime
{
public:
Runtime(RuntimeData* _data, Env* _env);
~Runtime();
Runtime(const Runtime&) = delete;
void operator=(const Runtime&) = delete;
@ -43,7 +42,6 @@ public:
bytes getReturnData() const;
jmp_buf_ref getJmpBuf() { return m_jmpBuf; }
static jmp_buf_ref getCurrJmpBuf();
private:
RuntimeData& m_data; ///< Pointer to data. Expected by compiled contract.
@ -51,7 +49,6 @@ private:
jmp_buf_ref m_currJmpBuf; ///< Pointer to jump buffer. Expected by compiled contract.
byte* m_memoryData = nullptr;
i256 m_memorySize = {};
jmp_buf_ref m_prevJmpBuf;
std::jmp_buf m_jmpBuf;
StackImpl m_stack;
MemoryImpl m_memory;

9
libevmjit/Utils.cpp

@ -1,8 +1,7 @@
#include <csetjmp>
#include <llvm/ADT/APInt.h>
#include "Utils.h"
#include "Instruction.h"
#include "Runtime.h"
namespace dev
{
@ -55,12 +54,6 @@ llvm::APInt readPushData(bytes::const_iterator& _curr, bytes::const_iterator _en
return value;
}
void terminate(ReturnCode _returnCode)
{
auto jmpBuf = Runtime::getCurrJmpBuf();
std::longjmp(jmpBuf, static_cast<int>(_returnCode));
}
}
}
}

2
libevmjit/Utils.h

@ -17,8 +17,6 @@ struct JIT: public NoteChannel { static const char* name() { return "JIT"; } };
u256 llvm2eth(i256);
i256 eth2llvm(u256);
void terminate(ReturnCode _returnCode);
}
}
}

Loading…
Cancel
Save