You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tree:
396fe954b6
cl-refactor
master
opencl1.1
v0.10.0
v0.10.0.dev2
v0.10.0.dev3
v0.10.0rc1
v0.10.0rc2
v0.10.0rc3
v0.10.0rc4
v0.11.0
v0.11.0rc1
v0.11.0rc2
${ noResults }
36 lines
762 B
36 lines
762 B
|
|||
#include "Runtime.h"
|
|||
|
|||
#include <llvm/IR/GlobalVariable.h>
|
|||
#include <llvm/IR/Function.h>
|
|||
#include <llvm/IR/IntrinsicInst.h>
|
|||
|
|||
namespace dev
|
|||
{
|
|||
namespace eth
|
|||
{
|
|||
namespace jit
|
|||
{
|
|||
|
|||
Runtime::Runtime(RuntimeData* _data, Env* _env) :
|
|||
m_data(*_data),
|
|||
m_env(*_env),
|
|||
m_currJmpBuf(m_jmpBuf)
|
|||
{}
|
|||
|
|||
bytes Runtime::getReturnData() const // FIXME: Reconsider returning by copy
|
|||
{
|
|||
// TODO: Handle large indexes
|
|||
auto offset = static_cast<size_t>(llvm2eth(m_data.elems[RuntimeData::ReturnDataOffset]));
|
|||
auto size = static_cast<size_t>(llvm2eth(m_data.elems[RuntimeData::ReturnDataSize]));
|
|||
|
|||
assert(offset + size <= m_memory.size());
|
|||
// TODO: Handle invalid data access by returning empty ref
|
|||
auto dataBeg = m_memory.begin() + offset;
|
|||
return {dataBeg, dataBeg + size};
|
|||
}
|
|||
|
|||
}
|
|||
}
|
|||
}
|