ROSE 0.11.145.147
Public Member Functions | Static Public Member Functions | List of all members
Rose::BinaryAnalysis::CallingConvention::StoragePoolStack Class Reference

Description

A storage pool for stack-based argument locations.

This pool holds an ordered sequence of locations on the stack. Some of the stack properties come from the associated calling convention definition.

Definition at line 187 of file StoragePool.h.

#include <Rose/BinaryAnalysis/CallingConvention/StoragePool.h>

Inheritance diagram for Rose::BinaryAnalysis::CallingConvention::StoragePoolStack:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::CallingConvention::StoragePoolStack:
Collaboration graph
[legend]

Public Types

using Ptr = StoragePoolStackPtr
 Shared-ownership pointer.
 
using ConstPtr = StoragePoolStackConstPtr
 Shared-ownership pointer.
 
- Public Types inherited from Rose::BinaryAnalysis::CallingConvention::StoragePoolBase
using Ptr = StoragePoolBasePtr
 Shared-ownership pointer.
 
using ConstPtr = StoragePoolBaseConstPtr
 Shared-ownership pointer.
 

Public Member Functions

 StoragePoolStack (const std::string &name, const TypePredicateConstPtr &, const Rose::BinaryAnalysis::Architecture::BaseConstPtr &)
 
StoragePoolBasePtr copy () const override
 Copy constructor.
 
std::vector< ConcreteLocationconsume (SgAsmType *) override
 Consume a storage location.
 
void reset () override
 Reset allocation.
 
StackDirection stackDirection () const
 Property: Stack direction.
 
void stackDirection (StackDirection)
 Property: Stack direction.
 
int64_t initialOffset () const
 Property: Initial stack offset.
 
void initialOffset (int64_t)
 Property: Initial stack offset.
 
size_t minimumValueSize () const
 Property: Minimum value size.
 
void minimumValueSize (size_t m)
 Property: Minimum value size.
 
const AlignmentvaluePadding () const
 Property: Aligned value size.
 
void valuePadding (const Alignment &)
 Property: Aligned value size.
 
ByteOrder::Endianness valueJustification () const
 Property: Value justification within allocated storage.
 
void valueJustification (ByteOrder::Endianness)
 Property: Value justification within allocated storage.
 
const Alignmentalignment () const
 Property: Alignment of stack offsets.
 
void alignment (const Alignment &)
 Property: Alignment of stack offsets.
 
RegisterDescriptor baseRegister () const
 Property: Base register.
 
void baseRegister (RegisterDescriptor)
 Property: Base register.
 
- Public Member Functions inherited from Rose::BinaryAnalysis::CallingConvention::StoragePoolBase
virtual bool canStore (SgAsmType *) const
 Test whether locations can store type.
 
virtual std::vector< ConcreteLocationconstantLocations () const
 List of constant storage locations.
 

Static Public Member Functions

static Ptr instance (const std::string &name, const TypePredicateConstPtr &, const Architecture::BaseConstPtr &)
 Constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from Rose::BinaryAnalysis::CallingConvention::StoragePoolBase
 StoragePoolBase (const std::string &name, const TypePredicateConstPtr &)
 

Member Typedef Documentation

◆ Ptr

Shared-ownership pointer.

Definition at line 192 of file StoragePool.h.

◆ ConstPtr

Shared-ownership pointer.

Definition at line 193 of file StoragePool.h.

Member Function Documentation

◆ instance()

static Ptr Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::instance ( const std::string &  name,
const TypePredicateConstPtr ,
const Architecture::BaseConstPtr  
)
static

Constructor.

Construct a new storage pool for allocating arguments on the stack.

◆ stackDirection() [1/2]

StackDirection Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::stackDirection ( ) const

Property: Stack direction.

Determines whether the stack grows up or down when an item is pushed onto the stack. Downward-growing stacks are the usual convention, which means that a value is pushed onto the stack by placing it at the next lower stack address(es) in memory.

◆ stackDirection() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::stackDirection ( StackDirection  )

Property: Stack direction.

Determines whether the stack grows up or down when an item is pushed onto the stack. Downward-growing stacks are the usual convention, which means that a value is pushed onto the stack by placing it at the next lower stack address(es) in memory.

◆ initialOffset() [1/2]

int64_t Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::initialOffset ( ) const

Property: Initial stack offset.

Offset from the stack pointer to the first storage location.

◆ initialOffset() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::initialOffset ( int64_t  )

Property: Initial stack offset.

Offset from the stack pointer to the first storage location.

◆ minimumValueSize() [1/2]

size_t Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::minimumValueSize ( ) const

Property: Minimum value size.

When allocating space for a value of size n bytes, this pool will allocate at least m bytes.

◆ minimumValueSize() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::minimumValueSize ( size_t  m)

Property: Minimum value size.

When allocating space for a value of size n bytes, this pool will allocate at least m bytes.

◆ valuePadding() [1/2]

const Alignment & Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::valuePadding ( ) const

Property: Aligned value size.

When allocating space for a value of size n bytes, this pool will pad the size to make it a multiple of m bytes.

◆ valuePadding() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::valuePadding ( const Alignment )

Property: Aligned value size.

When allocating space for a value of size n bytes, this pool will pad the size to make it a multiple of m bytes.

◆ valueJustification() [1/2]

ByteOrder::Endianness Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::valueJustification ( ) const

Property: Value justification within allocated storage.

When allocating space for a value of of size n bytes in an allocation region of size m bytes where m is greater than n, this property determines whether the value is stored in the lowest-address bytes of the region (ORDER_LSB) or the highest bytes of the region (ORDER_MSB)

◆ valueJustification() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::valueJustification ( ByteOrder::Endianness  )

Property: Value justification within allocated storage.

When allocating space for a value of of size n bytes in an allocation region of size m bytes where m is greater than n, this property determines whether the value is stored in the lowest-address bytes of the region (ORDER_LSB) or the highest bytes of the region (ORDER_MSB)

◆ alignment() [1/2]

const Alignment & Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::alignment ( ) const

Property: Alignment of stack offsets.

After determining the padded size of the stack area that stores the value, the address on the stack is calculated as an offset from the stack pointer. The offset is then aligned according to this property.

◆ alignment() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::alignment ( const Alignment )

Property: Alignment of stack offsets.

After determining the padded size of the stack area that stores the value, the address on the stack is calculated as an offset from the stack pointer. The offset is then aligned according to this property.

◆ baseRegister() [1/2]

RegisterDescriptor Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::baseRegister ( ) const

Property: Base register.

This is the register that points to the top of the stack. The constructor initializes this with the stack pointer register obtained from the architecture description, but it can be overridden.

◆ baseRegister() [2/2]

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::baseRegister ( RegisterDescriptor  )

Property: Base register.

This is the register that points to the top of the stack. The constructor initializes this with the stack pointer register obtained from the architecture description, but it can be overridden.

◆ copy()

StoragePoolBasePtr Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::copy ( ) const
overridevirtual

Copy constructor.

Makes a new copy of this pool.

Implements Rose::BinaryAnalysis::CallingConvention::StoragePoolBase.

◆ consume()

std::vector< ConcreteLocation > Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::consume ( SgAsmType )
overridevirtual

Consume a storage location.

Given an argument type, return a location(s) if possible and remove that location from this pool.

Implements Rose::BinaryAnalysis::CallingConvention::StoragePoolBase.

◆ reset()

void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::reset ( )
overridevirtual

Reset allocation.

Resets this storage pool back to its initial state. For instance, if the storage pool contains a list of three explicit locations and some or all of them have been taken by consume, then calling this function will make all three available again.

Implements Rose::BinaryAnalysis::CallingConvention::StoragePoolBase.


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