|
@ -26,12 +26,13 @@ namespace jit |
|
|
|
|
|
|
|
|
using StackImpl = std::vector<i256>; |
|
|
using StackImpl = std::vector<i256>; |
|
|
using MemoryImpl = bytes; |
|
|
using MemoryImpl = bytes; |
|
|
using JmpBufRef = decltype(&jmp_buf{}[0]); |
|
|
using jmp_buf_ref = decltype(&std::jmp_buf{}[0]); |
|
|
|
|
|
|
|
|
class Runtime |
|
|
class Runtime |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
public: |
|
|
Runtime(RuntimeData* _data, Env* _env, JmpBufRef _jmpBuf); |
|
|
Runtime(RuntimeData* _data, Env* _env); |
|
|
|
|
|
~Runtime(); |
|
|
|
|
|
|
|
|
Runtime(const Runtime&) = delete; |
|
|
Runtime(const Runtime&) = delete; |
|
|
void operator=(const Runtime&) = delete; |
|
|
void operator=(const Runtime&) = delete; |
|
@ -42,12 +43,15 @@ public: |
|
|
|
|
|
|
|
|
u256 getGas() const; |
|
|
u256 getGas() const; |
|
|
bytes getReturnData() const; |
|
|
bytes getReturnData() const; |
|
|
JmpBufRef getJmpBuf() { return m_jmpBuf; } |
|
|
jmp_buf_ref getJmpBuf() { return m_jmpBuf; } |
|
|
|
|
|
static jmp_buf_ref getCurrJmpBuf(); |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
RuntimeData& m_data; |
|
|
RuntimeData& m_data; ///< Pointer to data. Expected by compiled contract.
|
|
|
Env& m_env; |
|
|
Env& m_env; ///< Pointer to environment proxy. Expected by compiled contract.
|
|
|
JmpBufRef m_jmpBuf; |
|
|
jmp_buf_ref m_currJmpBuf; ///< Pointer to jump buffer. Expected by compiled contract.
|
|
|
|
|
|
jmp_buf_ref m_prevJmpBuf; |
|
|
|
|
|
std::jmp_buf m_jmpBuf; |
|
|
StackImpl m_stack; |
|
|
StackImpl m_stack; |
|
|
MemoryImpl m_memory; |
|
|
MemoryImpl m_memory; |
|
|
}; |
|
|
}; |
|
|