Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Typedefs | Enumerations | Functions
dev::evmjit Namespace Reference

Classes

class  Cache
 
class  ExecStats
 
class  ExecutionContext
 
struct  i256
 Representation of 256-bit value binary compatible with LLVM i256. More...
 
class  JITListener
 
struct  JITSchedule
 
class  ObjectCache
 
struct  RuntimeData
 
class  StatsCollector
 

Typedefs

using byte = uint8_t
 
using code_iterator = byte const *
 
using bytes_ref = std::tuple< byte const *, size_t >
 

Enumerations

enum  CacheMode {
  CacheMode::off, CacheMode::on, CacheMode::read, CacheMode::write,
  CacheMode::clear, CacheMode::preload
}
 
enum  ExecState {
  ExecState::Started, ExecState::CacheLoad, ExecState::CacheWrite, ExecState::Compilation,
  ExecState::Optimization, ExecState::CodeGen, ExecState::Execution, ExecState::Return,
  ExecState::Finished
}
 
enum  Instruction : uint8_t {
  Instruction::STOP = 0x00, Instruction::ADD, Instruction::MUL, Instruction::SUB,
  Instruction::DIV, Instruction::SDIV, Instruction::MOD, Instruction::SMOD,
  Instruction::ADDMOD, Instruction::MULMOD, Instruction::EXP, Instruction::SIGNEXTEND,
  Instruction::LT = 0x10, Instruction::GT, Instruction::SLT, Instruction::SGT,
  Instruction::EQ, Instruction::ISZERO, Instruction::AND, Instruction::OR,
  Instruction::XOR, Instruction::NOT, Instruction::BYTE, Instruction::SHA3 = 0x20,
  Instruction::ADDRESS = 0x30, Instruction::BALANCE, Instruction::ORIGIN, Instruction::CALLER,
  Instruction::CALLVALUE, Instruction::CALLDATALOAD, Instruction::CALLDATASIZE, Instruction::CALLDATACOPY,
  Instruction::CODESIZE, Instruction::CODECOPY, Instruction::GASPRICE, Instruction::EXTCODESIZE,
  Instruction::EXTCODECOPY, Instruction::BLOCKHASH = 0x40, Instruction::COINBASE, Instruction::TIMESTAMP,
  Instruction::NUMBER, Instruction::DIFFICULTY, Instruction::GASLIMIT, Instruction::POP = 0x50,
  Instruction::MLOAD, Instruction::MSTORE, Instruction::MSTORE8, Instruction::SLOAD,
  Instruction::SSTORE, Instruction::JUMP, Instruction::JUMPI, Instruction::PC,
  Instruction::MSIZE, Instruction::GAS, Instruction::JUMPDEST, Instruction::PUSH1 = 0x60,
  Instruction::PUSH2, Instruction::PUSH3, Instruction::PUSH4, Instruction::PUSH5,
  Instruction::PUSH6, Instruction::PUSH7, Instruction::PUSH8, Instruction::PUSH9,
  Instruction::PUSH10, Instruction::PUSH11, Instruction::PUSH12, Instruction::PUSH13,
  Instruction::PUSH14, Instruction::PUSH15, Instruction::PUSH16, Instruction::PUSH17,
  Instruction::PUSH18, Instruction::PUSH19, Instruction::PUSH20, Instruction::PUSH21,
  Instruction::PUSH22, Instruction::PUSH23, Instruction::PUSH24, Instruction::PUSH25,
  Instruction::PUSH26, Instruction::PUSH27, Instruction::PUSH28, Instruction::PUSH29,
  Instruction::PUSH30, Instruction::PUSH31, Instruction::PUSH32, Instruction::DUP1 = 0x80,
  Instruction::DUP2, Instruction::DUP3, Instruction::DUP4, Instruction::DUP5,
  Instruction::DUP6, Instruction::DUP7, Instruction::DUP8, Instruction::DUP9,
  Instruction::DUP10, Instruction::DUP11, Instruction::DUP12, Instruction::DUP13,
  Instruction::DUP14, Instruction::DUP15, Instruction::DUP16, Instruction::SWAP1 = 0x90,
  Instruction::SWAP2, Instruction::SWAP3, Instruction::SWAP4, Instruction::SWAP5,
  Instruction::SWAP6, Instruction::SWAP7, Instruction::SWAP8, Instruction::SWAP9,
  Instruction::SWAP10, Instruction::SWAP11, Instruction::SWAP12, Instruction::SWAP13,
  Instruction::SWAP14, Instruction::SWAP15, Instruction::SWAP16, Instruction::LOG0 = 0xa0,
  Instruction::LOG1, Instruction::LOG2, Instruction::LOG3, Instruction::LOG4,
  Instruction::CREATE = 0xf0, Instruction::CALL, Instruction::CALLCODE, Instruction::RETURN,
  Instruction::DELEGATECALL, Instruction::SUICIDE = 0xff
}
 Virtual machine bytecode instruction. More...
 
enum  ReturnCode {
  ReturnCode::Stop = 0, ReturnCode::Return = 1, ReturnCode::OutOfGas = -1, ReturnCode::LLVMError = -101,
  ReturnCode::UnexpectedException = -111
}
 

Functions

llvm::APInt readPushData (code_iterator &_curr, code_iterator _end)
 Reads PUSH data from pointed fragment of bytecode and constructs number out of it Reading out of bytecode means reading 0. More...
 
void skipPushData (code_iterator &_curr, code_iterator _end)
 Skips PUSH data in pointed fragment of bytecode. More...
 
EXPORT evm_factory evmjit_get_factory ()
 Get EVMJIT instance. More...
 
std::ostream & getLogStream (char const *_channel)
 
void keccak (uint8_t const *_data, uint64_t _size, uint8_t *o_hash)
 

Typedef Documentation

typedef uint8_t dev::evmjit::byte

Definition at line 10 of file Common.h.

using dev::evmjit::bytes_ref = typedef std::tuple<byte const*, size_t>

Definition at line 16 of file JIT.h.

using dev::evmjit::code_iterator = typedef byte const*

Definition at line 11 of file Common.h.

Enumeration Type Documentation

Enumerator
off 
on 
read 
write 
clear 
preload 

Definition at line 22 of file Cache.h.

Enumerator
Started 
CacheLoad 
CacheWrite 
Compilation 
Optimization 
CodeGen 
Execution 
Return 
Finished 

Definition at line 13 of file ExecStats.h.

enum dev::evmjit::Instruction : uint8_t
strong

Virtual machine bytecode instruction.

Enumerator
STOP 

halts execution

ADD 

addition operation

MUL 

mulitplication operation

SUB 

subtraction operation

DIV 

integer division operation

SDIV 

signed integer division operation

MOD 

modulo remainder operation

SMOD 

signed modulo remainder operation

ADDMOD 

unsigned modular addition

MULMOD 

unsigned modular multiplication

EXP 

exponential operation

SIGNEXTEND 

extend length of signed integer

LT 

less-than comparision

GT 

greater-than comparision

SLT 

signed less-than comparision

SGT 

signed greater-than comparision

EQ 

equality comparision

ISZERO 

simple not operator

AND 

bitwise AND operation

OR 

bitwise OR operation

XOR 

bitwise XOR operation

NOT 

bitwise NOT opertation

BYTE 

retrieve single byte from word

SHA3 

compute SHA3-256 hash

ADDRESS 

get address of currently executing account

BALANCE 

get balance of the given account

ORIGIN 

get execution origination address

CALLER 

get caller address

CALLVALUE 

get deposited value by the instruction/transaction responsible for this execution

CALLDATALOAD 

get input data of current environment

CALLDATASIZE 

get size of input data in current environment

CALLDATACOPY 

copy input data in current environment to memory

CODESIZE 

get size of code running in current environment

CODECOPY 

copy code running in current environment to memory

GASPRICE 

get price of gas in current environment

EXTCODESIZE 

get external code size (from another contract)

EXTCODECOPY 

copy external code (from another contract)

BLOCKHASH 

get hash of most recent complete block

COINBASE 

get the block's coinbase address

TIMESTAMP 

get the block's timestamp

NUMBER 

get the block's number

DIFFICULTY 

get the block's difficulty

GASLIMIT 

get the block's gas limit

POP 

remove item from stack

MLOAD 

load word from memory

MSTORE 

save word to memory

MSTORE8 

save byte to memory

SLOAD 

load word from storage

SSTORE 

save word to storage

JUMP 

alter the program counter

JUMPI 

conditionally alter the program counter

PC 

get the program counter

MSIZE 

get the size of active memory

GAS 

get the amount of available gas

JUMPDEST 

set a potential jump destination

PUSH1 

place 1 byte item on stack

PUSH2 

place 2 byte item on stack

PUSH3 

place 3 byte item on stack

PUSH4 

place 4 byte item on stack

PUSH5 

place 5 byte item on stack

PUSH6 

place 6 byte item on stack

PUSH7 

place 7 byte item on stack

PUSH8 

place 8 byte item on stack

PUSH9 

place 9 byte item on stack

PUSH10 

place 10 byte item on stack

PUSH11 

place 11 byte item on stack

PUSH12 

place 12 byte item on stack

PUSH13 

place 13 byte item on stack

PUSH14 

place 14 byte item on stack

PUSH15 

place 15 byte item on stack

PUSH16 

place 16 byte item on stack

PUSH17 

place 17 byte item on stack

PUSH18 

place 18 byte item on stack

PUSH19 

place 19 byte item on stack

PUSH20 

place 20 byte item on stack

PUSH21 

place 21 byte item on stack

PUSH22 

place 22 byte item on stack

PUSH23 

place 23 byte item on stack

PUSH24 

place 24 byte item on stack

PUSH25 

place 25 byte item on stack

PUSH26 

place 26 byte item on stack

PUSH27 

place 27 byte item on stack

PUSH28 

place 28 byte item on stack

PUSH29 

place 29 byte item on stack

PUSH30 

place 30 byte item on stack

PUSH31 

place 31 byte item on stack

PUSH32 

place 32 byte item on stack

DUP1 

copies the highest item in the stack to the top of the stack

DUP2 

copies the second highest item in the stack to the top of the stack

DUP3 

copies the third highest item in the stack to the top of the stack

DUP4 

copies the 4th highest item in the stack to the top of the stack

DUP5 

copies the 5th highest item in the stack to the top of the stack

DUP6 

copies the 6th highest item in the stack to the top of the stack

DUP7 

copies the 7th highest item in the stack to the top of the stack

DUP8 

copies the 8th highest item in the stack to the top of the stack

DUP9 

copies the 9th highest item in the stack to the top of the stack

DUP10 

copies the 10th highest item in the stack to the top of the stack

DUP11 

copies the 11th highest item in the stack to the top of the stack

DUP12 

copies the 12th highest item in the stack to the top of the stack

DUP13 

copies the 13th highest item in the stack to the top of the stack

DUP14 

copies the 14th highest item in the stack to the top of the stack

DUP15 

copies the 15th highest item in the stack to the top of the stack

DUP16 

copies the 16th highest item in the stack to the top of the stack

SWAP1 

swaps the highest and second highest value on the stack

SWAP2 

swaps the highest and third highest value on the stack

SWAP3 

swaps the highest and 4th highest value on the stack

SWAP4 

swaps the highest and 5th highest value on the stack

SWAP5 

swaps the highest and 6th highest value on the stack

SWAP6 

swaps the highest and 7th highest value on the stack

SWAP7 

swaps the highest and 8th highest value on the stack

SWAP8 

swaps the highest and 9th highest value on the stack

SWAP9 

swaps the highest and 10th highest value on the stack

SWAP10 

swaps the highest and 11th highest value on the stack

SWAP11 

swaps the highest and 12th highest value on the stack

SWAP12 

swaps the highest and 13th highest value on the stack

SWAP13 

swaps the highest and 14th highest value on the stack

SWAP14 

swaps the highest and 15th highest value on the stack

SWAP15 

swaps the highest and 16th highest value on the stack

SWAP16 

swaps the highest and 17th highest value on the stack

LOG0 

Makes a log entry; no topics.

LOG1 

Makes a log entry; 1 topic.

LOG2 

Makes a log entry; 2 topics.

LOG3 

Makes a log entry; 3 topics.

LOG4 

Makes a log entry; 4 topics.

CREATE 

create a new account with associated code

CALL 

message-call into an account

CALLCODE 

message-call with another account's code only

RETURN 

halt execution returning output data

DELEGATECALL 

like CALLCODE but keeps caller's value and sender (only from homestead on)

SUICIDE 

halt execution and register account for later deletion

Definition at line 16 of file Instruction.h.

Enumerator
Stop 
Return 
OutOfGas 
LLVMError 
UnexpectedException 

Definition at line 86 of file JIT.h.

Function Documentation

EXPORT evm_factory dev::evmjit::evmjit_get_factory ( void  )

Get EVMJIT instance.

Returns
The EVMJIT instance.

Definition at line 389 of file JIT.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream & dev::evmjit::getLogStream ( char const *  _channel)

Definition at line 16 of file Utils.cpp.

void dev::evmjit::keccak ( uint8_t const *  _data,
uint64_t  _size,
uint8_t *  o_hash 
)

Definition at line 178 of file Utils.cpp.

llvm::APInt dev::evmjit::readPushData ( code_iterator _curr,
code_iterator  _end 
)

Reads PUSH data from pointed fragment of bytecode and constructs number out of it Reading out of bytecode means reading 0.

Parameters
_curris updated and points the last real byte read

Definition at line 12 of file Instruction.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev::evmjit::skipPushData ( code_iterator _curr,
code_iterator  _end 
)

Skips PUSH data in pointed fragment of bytecode.

Parameters
_curris updated and points the last real byte skipped

Definition at line 29 of file Instruction.cpp.

Here is the call graph for this function: