Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dev::eth::jit::LocalStack Class Reference

#include <BasicBlock.h>

Inheritance diagram for dev::eth::jit::LocalStack:
[legend]
Collaboration diagram for dev::eth::jit::LocalStack:
[legend]

Public Member Functions

 LocalStack (IRBuilder &_builder, RuntimeManager &_runtimeManager)
 
void push (llvm::Value *_value)
 Pushes value on stack. More...
 
llvm::Value * pop ()
 Pops and returns top value. More...
 
void dup (size_t _index)
 Duplicates _index'th value on stack. More...
 
void swap (size_t _index)
 Swaps _index'th value on stack with a value on stack top. More...
 
ssize_t size () const
 
ssize_t minSize () const
 
ssize_t maxSize () const
 
void finalize ()
 Finalize local stack: check the requirements and update of the global stack. More...
 

Private Member Functions

llvm::Value * get (size_t _index)
 Gets _index'th value from top (counting from 0) More...
 
void set (size_t _index, llvm::Value *_value)
 Sets _index'th value from top (counting from 0) More...
 
llvm::Function * getStackPrepareFunc ()
 

Private Attributes

std::vector< llvm::Value * > m_input
 Items fetched from global stack. More...
 
std::vector< llvm::Value * > m_local
 Local stack items that has not been pushed to global stack. First item is just above global stack. More...
 
llvm::CallInst * m_sp = nullptr
 Call to stack.prepare function which returns stack pointer for current basic block. More...
 
ssize_t m_globalPops = 0
 Number of items poped from global stack. In other words: global - local stack overlap. More...
 
ssize_t m_minSize = 0
 Minimum reached local stack size. Can be negative. More...
 
ssize_t m_maxSize = 0
 Maximum reached local stack size. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dev::eth::jit::CompilerHelper
 CompilerHelper (IRBuilder &_builder)
 
 CompilerHelper (const CompilerHelper &)=delete
 
CompilerHelperoperator= (CompilerHelper)=delete
 
llvm::Module * getModule ()
 Reference to the IR module being compiled. More...
 
llvm::Function * getMainFunction ()
 Reference to the main module function. More...
 
- Protected Attributes inherited from dev::eth::jit::CompilerHelper
IRBuilderm_builder
 Reference to parent compiler IR builder. More...
 

Detailed Description

Definition at line 19 of file BasicBlock.h.

Constructor & Destructor Documentation

dev::eth::jit::LocalStack::LocalStack ( IRBuilder _builder,
RuntimeManager _runtimeManager 
)
explicit

Definition at line 33 of file BasicBlock.cpp.

Here is the call graph for this function:

Member Function Documentation

void dev::eth::jit::LocalStack::dup ( size_t  _index)

Duplicates _index'th value on stack.

Copies the _index-th element of the local stack and pushes it back on the top.

Definition at line 65 of file BasicBlock.cpp.

Here is the call graph for this function:

void dev::eth::jit::LocalStack::finalize ( )

Finalize local stack: check the requirements and update of the global stack.

Definition at line 117 of file BasicBlock.cpp.

Here is the call graph for this function:

llvm::Value * dev::eth::jit::LocalStack::get ( size_t  _index)
private

Gets _index'th value from top (counting from 0)

Definition at line 81 of file BasicBlock.cpp.

llvm::Function * dev::eth::jit::LocalStack::getStackPrepareFunc ( )
private

Definition at line 146 of file BasicBlock.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ssize_t dev::eth::jit::LocalStack::maxSize ( ) const
inline

Definition at line 39 of file BasicBlock.h.

Here is the caller graph for this function:

ssize_t dev::eth::jit::LocalStack::minSize ( ) const
inline

Definition at line 38 of file BasicBlock.h.

Here is the caller graph for this function:

llvm::Value * dev::eth::jit::LocalStack::pop ( )

Pops and returns top value.

Definition at line 50 of file BasicBlock.cpp.

Here is the call graph for this function:

void dev::eth::jit::LocalStack::push ( llvm::Value *  _value)

Pushes value on stack.

Definition at line 43 of file BasicBlock.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void dev::eth::jit::LocalStack::set ( size_t  _index,
llvm::Value *  _value 
)
private

Sets _index'th value from top (counting from 0)

Definition at line 103 of file BasicBlock.cpp.

Here is the call graph for this function:

ssize_t dev::eth::jit::LocalStack::size ( ) const
inline

Definition at line 37 of file BasicBlock.h.

Here is the caller graph for this function:

void dev::eth::jit::LocalStack::swap ( size_t  _index)

Swaps _index'th value on stack with a value on stack top.

Swaps the top element with the _index-th element of the local stack.

Parameters
_indexIndex of value to be swaped. Must be > 0.

< _index must not be 0.

Definition at line 72 of file BasicBlock.cpp.

Here is the call graph for this function:

Member Data Documentation

ssize_t dev::eth::jit::LocalStack::m_globalPops = 0
private

Number of items poped from global stack. In other words: global - local stack overlap.

Definition at line 62 of file BasicBlock.h.

std::vector<llvm::Value*> dev::eth::jit::LocalStack::m_input
private

Items fetched from global stack.

First element matches the top of the global stack. Can contain nulls if some items has been skipped.

Definition at line 55 of file BasicBlock.h.

std::vector<llvm::Value*> dev::eth::jit::LocalStack::m_local
private

Local stack items that has not been pushed to global stack. First item is just above global stack.

Definition at line 58 of file BasicBlock.h.

ssize_t dev::eth::jit::LocalStack::m_maxSize = 0
private

Maximum reached local stack size.

Definition at line 64 of file BasicBlock.h.

ssize_t dev::eth::jit::LocalStack::m_minSize = 0
private

Minimum reached local stack size. Can be negative.

Definition at line 63 of file BasicBlock.h.

llvm::CallInst* dev::eth::jit::LocalStack::m_sp = nullptr
private

Call to stack.prepare function which returns stack pointer for current basic block.

Definition at line 60 of file BasicBlock.h.


The documentation for this class was generated from the following files: