CACAO
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
cacao::jit::compiler2::CodeGenPass Class Reference

CodeGenPass TODO: more info. More...

Inheritance diagram for cacao::jit::compiler2::CodeGenPass:
cacao::jit::compiler2::Pass cacao::jit::compiler2::memory::ManagerMixin< CodeGenPass >

Public Types

typedef alloc::map
< MachineBasicBlock
*, std::size_t, MBBCompare >
::type 
BasicBlockMap
 

Public Member Functions

 CodeGenPass ()
 
virtual bool run (JITData &JD)
 Run the Pass. More...
 
virtual PassUsageget_PassUsage (PassUsage &PU) const
 Set the requirements for the pass. More...
 
std::size_t get_block_size (MachineBasicBlock *MBB) const
 
BasicBlockMap::const_iterator begin () const
 
BasicBlockMap::const_iterator end () const
 
- Public Member Functions inherited from cacao::jit::compiler2::Pass
 Pass ()
 
void set_PassRunner (PassRunner *pr)
 
template<class _PassClass >
_PassClass * get_Pass () const
 Get the result of a previous compiler pass. More...
 
template<class _PassClass >
_PassClass * get_Pass_if_available () const
 Get the result of a previous compiler pass. More...
 
virtual bool is_enabled () const
 Allows concrete passes to enable/disable themselves the way they like. More...
 
virtual void initialize ()
 Initialize the Pass. More...
 
virtual void finalize ()
 Finalize the Pass. More...
 
virtual bool verify () const
 Verify the Result. More...
 
virtual ~Pass ()
 Destructor. More...
 

Private Types

typedef std::vector
< MachineInstruction * > 
MInstListTy
 
typedef alloc::map
< MachineInstruction
*, std::size_t >::type 
InstructionPositionMap
 
typedef alloc::map
< MachineInstruction
*, std::size_t >::type 
InstructionSizeMap
 

Private Member Functions

template<class ForwardIt >
void resolve_replacement_points (ForwardIt first, ForwardIt last, JITData &JD)
 Create the final rplpoint structures for the current method. More...
 
void finish (JITData &JD)
 finish code generation More...
 

Private Attributes

InstructionPositionMap instruction_positions
 Map a MachineInstruction to a offset in the current CodeMemory. More...
 
InstructionSizeMap instruction_sizes
 Map a MachineInstruction to its size in the code memory (number of emitted bytes) More...
 
BasicBlockMap bbmap
 

Additional Inherited Members

- Static Public Member Functions inherited from cacao::jit::compiler2::Pass
template<class T >
static PassInfo::IDTy ID ()
 This template will return a unique ID for each type that it is called with. More...
 
- Static Public Member Functions inherited from cacao::jit::compiler2::memory::ManagerMixin< CodeGenPass >
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...
 

Detailed Description

CodeGenPass TODO: more info.

Definition at line 49 of file CodeGenPass.hpp.

Member Typedef Documentation

Definition at line 51 of file CodeGenPass.hpp.

Definition at line 59 of file CodeGenPass.hpp.

Definition at line 60 of file CodeGenPass.hpp.

Definition at line 58 of file CodeGenPass.hpp.

Constructor & Destructor Documentation

cacao::jit::compiler2::CodeGenPass::CodeGenPass ( )
inline

Definition at line 93 of file CodeGenPass.hpp.

Member Function Documentation

BasicBlockMap::const_iterator cacao::jit::compiler2::CodeGenPass::begin ( ) const
inline

Definition at line 97 of file CodeGenPass.hpp.

BasicBlockMap::const_iterator cacao::jit::compiler2::CodeGenPass::end ( ) const
inline

Definition at line 98 of file CodeGenPass.hpp.

void cacao::jit::compiler2::CodeGenPass::finish ( JITData JD)
private

finish code generation

Finishes the code generation. A new memory, large enough for both data and code, is allocated and data and code are copied together to their final layout, unresolved jumps are resolved, ...

Definition at line 250 of file CodeGenPass.cpp.

std::size_t cacao::jit::compiler2::CodeGenPass::get_block_size ( MachineBasicBlock MBB) const

Definition at line 123 of file CodeGenPass.cpp.

PassUsage & cacao::jit::compiler2::CodeGenPass::get_PassUsage ( PassUsage PU) const
virtual

Set the requirements for the pass.

Reimplemented from cacao::jit::compiler2::Pass.

Definition at line 456 of file CodeGenPass.cpp.

template<class ForwardIt >
void cacao::jit::compiler2::CodeGenPass::resolve_replacement_points ( ForwardIt  first,
ForwardIt  last,
JITData JD 
)
private

Create the final rplpoint structures for the current method.

Create a rplpoint structure for each MachineReplacementPointInst in the range first to last and store them in the codeinfo of JD.

Parameters
firstForward iterator that points to the first MachineReplacementPointInst* in the range.
lastForward iterator that marks the end of the range.
JDThe JITData of the currently compiled method.

Definition at line 166 of file CodeGenPass.cpp.

bool cacao::jit::compiler2::CodeGenPass::run ( JITData JD)
virtual

Run the Pass.

This method implements the compiler pass.

Returns
false if a problem occurred, true otherwise

Implements cacao::jit::compiler2::Pass.

Definition at line 64 of file CodeGenPass.cpp.

Field Documentation

BasicBlockMap cacao::jit::compiler2::CodeGenPass::bbmap
private

Definition at line 91 of file CodeGenPass.hpp.

InstructionPositionMap cacao::jit::compiler2::CodeGenPass::instruction_positions
private

Map a MachineInstruction to a offset in the current CodeMemory.

This map stores for each MachineInstruction the offset of the native code that was written to the CodeSegment by MachineInstruction::emit().

Definition at line 66 of file CodeGenPass.hpp.

InstructionSizeMap cacao::jit::compiler2::CodeGenPass::instruction_sizes
private

Map a MachineInstruction to its size in the code memory (number of emitted bytes)

Definition at line 69 of file CodeGenPass.hpp.


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