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.
66 lines
1.1 KiB
66 lines
1.1 KiB
10 years ago
|
#pragma once
|
||
|
|
||
|
#include <vector>
|
||
10 years ago
|
#include <tuple>
|
||
10 years ago
|
#include <cstdint>
|
||
|
|
||
|
#ifdef _MSC_VER
|
||
|
#define EXPORT __declspec(dllexport)
|
||
|
#else
|
||
|
#define EXPORT
|
||
10 years ago
|
#endif
|
||
10 years ago
|
|
||
|
namespace dev
|
||
|
{
|
||
|
namespace eth
|
||
|
{
|
||
|
namespace jit
|
||
|
{
|
||
|
|
||
|
using byte = uint8_t;
|
||
|
using bytes = std::vector<byte>;
|
||
10 years ago
|
using bytes_ref = std::tuple<byte const*, size_t>;
|
||
10 years ago
|
using code_iterator = byte const*;
|
||
10 years ago
|
|
||
|
struct NoteChannel {}; // FIXME: Use some log library?
|
||
|
|
||
10 years ago
|
enum class ReturnCode
|
||
|
{
|
||
10 years ago
|
// Success codes
|
||
|
Stop = 0,
|
||
|
Return = 1,
|
||
10 years ago
|
Suicide = 2,
|
||
|
|
||
10 years ago
|
// Standard error codes
|
||
|
OutOfGas = -1,
|
||
|
StackTooSmall = -2,
|
||
|
BadJumpDestination = -3,
|
||
|
BadInstruction = -4,
|
||
|
Rejected = -5, ///< Input data (code, gas, block info, etc.) does not meet JIT requirement and execution request has been rejected
|
||
10 years ago
|
|
||
10 years ago
|
// Internal error codes
|
||
|
LLVMConfigError = -101,
|
||
|
LLVMCompileError = -102,
|
||
|
LLVMLinkError = -103,
|
||
10 years ago
|
|
||
10 years ago
|
UnexpectedException = -111,
|
||
10 years ago
|
|
||
|
LinkerWorkaround = -299,
|
||
10 years ago
|
};
|
||
|
|
||
|
/// Representation of 256-bit value binary compatible with LLVM i256
|
||
|
struct i256
|
||
|
{
|
||
10 years ago
|
uint64_t a = 0;
|
||
|
uint64_t b = 0;
|
||
|
uint64_t c = 0;
|
||
|
uint64_t d = 0;
|
||
10 years ago
|
};
|
||
|
static_assert(sizeof(i256) == 32, "Wrong i265 size");
|
||
|
|
||
10 years ago
|
#define UNTESTED assert(false)
|
||
|
|
||
10 years ago
|
}
|
||
|
}
|
||
|
}
|