ROSE 0.11.145.147
|
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>
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< ConcreteLocation > | consume (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 Alignment & | valuePadding () 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 Alignment & | alignment () 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< ConcreteLocation > | constantLocations () 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 &) | |
Shared-ownership pointer.
Definition at line 192 of file StoragePool.h.
using Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::ConstPtr = StoragePoolStackConstPtr |
Shared-ownership pointer.
Definition at line 193 of file StoragePool.h.
|
static |
Constructor.
Construct a new storage pool for allocating arguments on the stack.
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.
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.
int64_t Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::initialOffset | ( | ) | const |
Property: Initial stack offset.
Offset from the stack pointer to the first storage location.
void Rose::BinaryAnalysis::CallingConvention::StoragePoolStack::initialOffset | ( | int64_t | ) |
Property: Initial stack offset.
Offset from the stack pointer to the first storage location.
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.
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.
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.
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.
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
)
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
)
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.
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.
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.
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.
|
overridevirtual |
Copy constructor.
Makes a new copy of this pool.
Implements Rose::BinaryAnalysis::CallingConvention::StoragePoolBase.
|
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.
|
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.