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.
40 lines
626 B
40 lines
626 B
#pragma once
|
|
|
|
#include <memory>
|
|
#include <llvm/ExecutionEngine/ExecutionEngine.h>
|
|
|
|
|
|
namespace dev
|
|
{
|
|
namespace eth
|
|
{
|
|
namespace jit
|
|
{
|
|
|
|
/// A bundle of objects and information needed for a contract execution
|
|
class ExecBundle
|
|
{
|
|
public:
|
|
std::unique_ptr<llvm::ExecutionEngine> engine;
|
|
|
|
ExecBundle() = default;
|
|
ExecBundle(ExecBundle&& _other):
|
|
engine(std::move(_other.engine))
|
|
{}
|
|
|
|
ExecBundle(ExecBundle const&) = delete;
|
|
void operator=(ExecBundle) = delete;
|
|
};
|
|
|
|
class Cache
|
|
{
|
|
public:
|
|
using Key = std::string;
|
|
|
|
static ExecBundle& registerExec(Key _key, ExecBundle&& _exec);
|
|
static ExecBundle* findExec(Key _key);
|
|
};
|
|
|
|
}
|
|
}
|
|
}
|
|
|