CACAO
Public Member Functions | Private Member Functions | Private Attributes | Friends
cacao::jit::compiler2::ManagedStackSlot Class Reference

A "virtual" slot that will eventually be mapped to a machine-level slot. More...

Inheritance diagram for cacao::jit::compiler2::ManagedStackSlot:
cacao::jit::compiler2::MachineOperand cacao::jit::compiler2::memory::ManagerMixin< MachineOperand >

Public Member Functions

virtual ManagedStackSlotto_ManagedStackSlot ()
 Conversion method. More...
 
virtual const char * get_name () const
 
u4 get_index () const
 
void set_index (unsigned index)
 Set the index of the slot. More...
 
StackSlotManagerget_parent () const
 
virtual OStreamprint (OStream &OS) const
 Print a human-readable representation of this slot. More...
 
- Public Member Functions inherited from cacao::jit::compiler2::MachineOperand
std::size_t get_id () const
 
 MachineOperand (OperandID op_id, Type::TypeID type)
 
OperandID get_OperandID () const
 
Type::TypeID get_type () const
 
virtual ~MachineOperand ()
 
virtual MachineOperandto_MachineOperand ()
 
virtual VoidOperandto_VoidOperand ()
 
virtual Registerto_Register ()
 
virtual StackSlotto_StackSlot ()
 
virtual Immediateto_Immediate ()
 
virtual Addressto_Address ()
 
bool is_MachineOperand () const
 
bool is_VoidOperand () const
 
bool is_Register () const
 
bool is_StackSlot () const
 
bool is_ManagedStackSlot () const
 
bool is_Immediate () const
 
bool is_Address () const
 
bool is_stackslot () const
 
bool aquivalence_less (const MachineOperand &MO) const
 
bool aquivalent (const MachineOperand &MO) const
 
virtual bool is_virtual () const
 True if operand is virtual and must be assigned during register allocation. More...
 
virtual bool needs_allocation () const
 Return true if operand is processed during register allocation. More...
 
bool has_embedded_operands ()
 
std::size_t op_size () const
 
EmbeddedMachineOperandoperator[] (std::size_t i)
 
const EmbeddedMachineOperandget (std::size_t i) const
 
EmbeddedMachineOperandget (std::size_t i)
 
operand_iterator begin ()
 
operand_iterator end ()
 
operand_iterator find (MachineOperand *op)
 
EmbeddedMachineOperandfront ()
 
EmbeddedMachineOperandback ()
 
const_operand_iterator begin () const
 
const_operand_iterator end () const
 

Private Member Functions

 ManagedStackSlot (StackSlotManager *SSM, Type::TypeID type)
 Construct a ManagedStackSlot. More...
 

Private Attributes

StackSlotManagerparent
 The StackSlotManager that created (and owns) this slot. More...
 
u4 index
 Represents the slot's position in the virtual stack frame. More...
 

Friends

class StackSlotManager
 

Additional Inherited Members

- Public Types inherited from cacao::jit::compiler2::MachineOperand
enum  OperandID {
  MachineOperandID, RegisterID, StackSlotID, ManagedStackSlotID,
  ImmediateID, AddressID, VoidOperandID
}
 
typedef const voidIdentifyTy
 
typedef std::size_t IdentifyOffsetTy
 
typedef std::size_t IdentifySizeTy
 
typedef alloc::vector
< EmbeddedMachineOperand >
::type 
embedded_operand_list
 
typedef
embedded_operand_list::iterator 
operand_iterator
 
typedef
embedded_operand_list::const_iterator 
const_operand_iterator
 
- Static Public Member Functions inherited from cacao::jit::compiler2::memory::ManagerMixin< MachineOperand >
static voidoperator new (std::size_t size) throw (std::bad_alloc)
 normal new More...
 
static voidoperator new (std::size_t size, void *ptr) throw ()
 placement new More...
 
static voidoperator new (std::size_t size, const std::nothrow_t &nt) throw ()
 nothrow new More...
 
static void operator delete (void *pMemory) throw ()
 normal delete More...
 
static void operator delete (void *pMemory, void *ptr) throw ()
 placement delete More...
 
static void operator delete (void *pMemory, const std::nothrow_t &) throw ()
 nothrow delete More...
 
static voidoperator new[] (std::size_t size) throw (std::bad_alloc)
 normal new[] More...
 
static voidoperator new[] (std::size_t size, void *ptr) throw ()
 placement new[] More...
 
static voidoperator new[] (std::size_t size, const std::nothrow_t &nt) throw ()
 nothrow new[] More...
 
static void operator delete[] (void *pMemory) throw ()
 normal delete[] More...
 
static void operator delete[] (void *pMemory, void *ptr) throw ()
 placement delete[] More...
 
static void operator delete[] (void *pMemory, const std::nothrow_t &) throw ()
 nothrow delete[] More...
 
- Protected Member Functions inherited from cacao::jit::compiler2::MachineOperand
virtual IdentifyTy id_base () const
 
virtual IdentifyOffsetTy id_offset () const
 
virtual IdentifySizeTy id_size () const
 
- Protected Attributes inherited from cacao::jit::compiler2::MachineOperand
embedded_operand_list embedded_operands
 TODO describe. More...
 

Detailed Description

A "virtual" slot that will eventually be mapped to a machine-level slot.

A ManagedStackSlot may be used to store spill-registers (as needed during register allocation) or to store arguments of method invocations. ManagedStackSlots may only be constructed via a corresponding StackSlotManager and will eventually be mapped to actual machine-level slots during code generation.

Note that there is no one-to-one mapping between actual machine-level slots and ManagedStackSlots. Multiple ManagedStackSlots might map to the same machine-level slot which is the case for those slots that are used for storing arguments for method invocations.

Definition at line 292 of file MachineOperand.hpp.

Constructor & Destructor Documentation

cacao::jit::compiler2::ManagedStackSlot::ManagedStackSlot ( StackSlotManager SSM,
Type::TypeID  type 
)
inlineprivate

Construct a ManagedStackSlot.

Parameters
SSMThe StackSlotManager that created (and owns) this slot.
typeThe type of the slot.

Definition at line 315 of file MachineOperand.hpp.

Member Function Documentation

u4 cacao::jit::compiler2::ManagedStackSlot::get_index ( ) const
inline
Returns
The index representing this slot's position in the virtual stack frame.

Definition at line 336 of file MachineOperand.hpp.

virtual const char* cacao::jit::compiler2::ManagedStackSlot::get_name ( ) const
inlinevirtual
Returns
A human-readable name of this slot.

Implements cacao::jit::compiler2::MachineOperand.

Definition at line 328 of file MachineOperand.hpp.

StackSlotManager* cacao::jit::compiler2::ManagedStackSlot::get_parent ( ) const
inline
Returns
The StackSlotManager that created (and owns) this slot.

Definition at line 348 of file MachineOperand.hpp.

virtual OStream& cacao::jit::compiler2::ManagedStackSlot::print ( OStream OS) const
inlinevirtual

Print a human-readable representation of this slot.

Parameters
OSThe stream to print to.
Returns
The corresponding stream.

Reimplemented from cacao::jit::compiler2::MachineOperand.

Definition at line 357 of file MachineOperand.hpp.

void cacao::jit::compiler2::ManagedStackSlot::set_index ( unsigned  index)
inline

Set the index of the slot.

Parameters
indexThe corresponding index.

Definition at line 343 of file MachineOperand.hpp.

virtual ManagedStackSlot* cacao::jit::compiler2::ManagedStackSlot::to_ManagedStackSlot ( )
inlinevirtual

Conversion method.

Reimplemented from cacao::jit::compiler2::MachineOperand.

Definition at line 323 of file MachineOperand.hpp.

Friends And Related Function Documentation

friend class StackSlotManager
friend

Definition at line 361 of file MachineOperand.hpp.

Field Documentation

u4 cacao::jit::compiler2::ManagedStackSlot::index
private

Represents the slot's position in the virtual stack frame.

Note that multiple ManagedStackSlots might use the same index, since they may be mapped to the same position in the stack frame (which is the case for slots that are used for storing arguments for method invocations).

Definition at line 307 of file MachineOperand.hpp.

StackSlotManager* cacao::jit::compiler2::ManagedStackSlot::parent
private

The StackSlotManager that created (and owns) this slot.

Definition at line 298 of file MachineOperand.hpp.


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