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

Represents a speculative assumption that has to be checked at run-time. More...

Inheritance diagram for cacao::jit::compiler2::AssumptionInst:
cacao::jit::compiler2::Instruction cacao::jit::compiler2::SourceStateAwareInst cacao::jit::compiler2::Value cacao::jit::compiler2::memory::ManagerMixin< Value >

Public Member Functions

 AssumptionInst (Value *condition, BeginInst *guarded_block)
 Construct an AssumptionInst. More...
 
virtual BeginInstget_guarded_block () const
 Get the entry to the region of code that relies on this assumption. More...
 
virtual bool is_homogeneous () const
 
virtual Instructionto_Instruction ()
 Conversion method. More...
 
virtual SourceStateAwareInstto_SourceStateAwareInst ()
 Conversion method. More...
 
virtual AssumptionInstto_AssumptionInst ()
 Conversion method. More...
 
virtual void accept (InstructionVisitor &v, bool copyOperands)
 Visitor pattern. More...
 
- Public Member Functions inherited from cacao::jit::compiler2::Instruction
 Instruction (InstID opcode, Type::TypeID type, BeginInst *begin=NULL)
 
virtual ~Instruction ()
 
int get_id () const
 return a unique identifier for this instruction More...
 
InstID get_opcode () const
 return the opcode of the instruction More...
 
void set_Method (Method *M)
 
Methodget_Method () const
 
const_op_iterator op_begin () const
 
const_op_iterator op_end () const
 
Valueop_front () const
 
Valueop_back () const
 
size_t op_size () const
 
Valueget_operand (size_t i)
 
int get_operand_index (Value *op) const
 
void append_dep (Instruction *I)
 
void remove_dep (Instruction *I)
 
virtual bool verify () const
 Check if the instruction is in a correct state. More...
 
const_dep_iterator dep_begin () const
 
const_dep_iterator dep_end () const
 
Instructiondep_front () const
 
Instructiondep_back () const
 
size_t dep_size () const
 
const_dep_iterator rdep_begin () const
 
const_dep_iterator rdep_end () const
 
size_t rdep_size () const
 
virtual BeginInstget_BeginInst () const
 Get the corresponding BeginInst. More...
 
virtual bool set_BeginInst (BeginInst *b)
 
virtual bool is_floating () const
 True if the instruction has no fixed control dependencies. More...
 
virtual bool has_side_effects () const
 True the instruction has side effects. More...
 
virtual bool is_arithmetic () const
 True if the instruction is an arithmetic instruction. More...
 
virtual bool is_commutable () const
 True if the operands of the instruction are commutable. More...
 
virtual DereferenceInstto_DereferenceInst ()
 
virtual UnaryInstto_UnaryInst ()
 
virtual BinaryInstto_BinaryInst ()
 
virtual FieldAccessInstto_FieldAccessInst ()
 
virtual CHECKNULLInstto_CHECKNULLInst ()
 
virtual ARRAYLENGTHInstto_ARRAYLENGTHInst ()
 
virtual ARRAYBOUNDSCHECKInstto_ARRAYBOUNDSCHECKInst ()
 
virtual NEGInstto_NEGInst ()
 
virtual CASTInstto_CASTInst ()
 
virtual ADDInstto_ADDInst ()
 
virtual SUBInstto_SUBInst ()
 
virtual MULInstto_MULInst ()
 
virtual DIVInstto_DIVInst ()
 
virtual REMInstto_REMInst ()
 
virtual SHLInstto_SHLInst ()
 
virtual USHRInstto_USHRInst ()
 
virtual ANDInstto_ANDInst ()
 
virtual ORInstto_ORInst ()
 
virtual XORInstto_XORInst ()
 
virtual CMPInstto_CMPInst ()
 
virtual CONSTInstto_CONSTInst ()
 
virtual GETFIELDInstto_GETFIELDInst ()
 
virtual PUTFIELDInstto_PUTFIELDInst ()
 
virtual PUTSTATICInstto_PUTSTATICInst ()
 
virtual GETSTATICInstto_GETSTATICInst ()
 
virtual INCInstto_INCInst ()
 
virtual AREFInstto_AREFInst ()
 
virtual ASTOREInstto_ASTOREInst ()
 
virtual ALOADInstto_ALOADInst ()
 
virtual LOADInstto_LOADInst ()
 
virtual NEWInstto_NEWInst ()
 
virtual NEWARRAYInstto_NEWARRAYInst ()
 
virtual ANEWARRAYInstto_ANEWARRAYInst ()
 
virtual MULTIANEWARRAYInstto_MULTIANEWARRAYInst ()
 
virtual CHECKCASTInstto_CHECKCASTInst ()
 
virtual INSTANCEOFInstto_INSTANCEOFInst ()
 
virtual GOTOInstto_GOTOInst ()
 
virtual BUILTINInstto_BUILTINInst ()
 
virtual INVOKEInstto_INVOKEInst ()
 
virtual INVOKEVIRTUALInstto_INVOKEVIRTUALInst ()
 
virtual INVOKESPECIALInstto_INVOKESPECIALInst ()
 
virtual INVOKESTATICInstto_INVOKESTATICInst ()
 
virtual INVOKEINTERFACEInstto_INVOKEINTERFACEInst ()
 
virtual IFInstto_IFInst ()
 
virtual IF_CMPInstto_IF_CMPInst ()
 
virtual TABLESWITCHInstto_TABLESWITCHInst ()
 
virtual LOOKUPSWITCHInstto_LOOKUPSWITCHInst ()
 
virtual RETURNInstto_RETURNInst ()
 
virtual THROWInstto_THROWInst ()
 
virtual PHIInstto_PHIInst ()
 
virtual BeginInstto_BeginInst ()
 
virtual EndInstto_EndInst ()
 
virtual SourceStateInstto_SourceStateInst ()
 
virtual ReplacementEntryInstto_ReplacementEntryInst ()
 
virtual DeoptimizeInstto_DeoptimizeInst ()
 
const char * get_name () const
 
virtual OStreamprint (OStream &OS) const
 print More...
 
- Public Member Functions inherited from cacao::jit::compiler2::Value
 Value (Type::TypeID type)
 
Type::TypeID get_type () const
 get the value type of the instruction More...
 
virtual ~Value ()
 
UserListTy::const_iterator user_begin () const
 
UserListTy::const_iterator user_end () const
 
size_t user_size () const
 Get the number of (unique) users. More...
 
void replace_value (Value *v)
 Replace this Value this the new one in all users. More...
 
- Public Member Functions inherited from cacao::jit::compiler2::SourceStateAwareInst
 SourceStateAwareInst ()
 Construct a SourceStateAwareInst. More...
 
SourceStateInstget_source_state () const
 Get the SourceStateInst that corresponds to this Instruction. More...
 
void set_source_state (SourceStateInst *source_state)
 Set the SourceStateInst that corresponds to this Instruction. More...
 
virtual bool needs_source_state ()
 
virtual ~SourceStateAwareInst ()
 

Private Attributes

BeginInstguarded_block
 The entry to the region of code that relies on this assumption. More...
 

Additional Inherited Members

- Public Types inherited from cacao::jit::compiler2::Instruction
enum  InstID {
  UnaryInstID, BinaryInstID, FieldAccessInstID, CHECKNULLInstID,
  ARRAYLENGTHInstID, ARRAYBOUNDSCHECKInstID, NEGInstID, CASTInstID,
  ADDInstID, SUBInstID, MULInstID, DIVInstID,
  REMInstID, SHLInstID, USHRInstID, ANDInstID,
  ORInstID, XORInstID, CMPInstID, CONSTInstID,
  GETFIELDInstID, PUTFIELDInstID, PUTSTATICInstID, GETSTATICInstID,
  INCInstID, AREFInstID, ASTOREInstID, ALOADInstID,
  LOADInstID, NEWInstID, NEWARRAYInstID, ANEWARRAYInstID,
  MULTIANEWARRAYInstID, CHECKCASTInstID, INSTANCEOFInstID, GOTOInstID,
  BUILTINInstID, INVOKEInstID, INVOKEVIRTUALInstID, INVOKESPECIALInstID,
  INVOKESTATICInstID, INVOKEINTERFACEInstID, IFInstID, IF_CMPInstID,
  TABLESWITCHInstID, LOOKUPSWITCHInstID, RETURNInstID, THROWInstID,
  PHIInstID, BeginInstID, EndInstID, SourceStateInstID,
  ReplacementEntryInstID, AssumptionInstID, DeoptimizeInstID, NoInstID
}
 
typedef alloc::vector< Value * >
::type 
OperandListTy
 
typedef alloc::list
< Instruction * >::type 
DepListTy
 
typedef OperandListTy::iterator op_iterator
 
typedef DepListTy::iterator dep_iterator
 
typedef
OperandListTy::const_iterator 
const_op_iterator
 
typedef DepListTy::const_iterator const_dep_iterator
 
- Public Types inherited from cacao::jit::compiler2::Value
typedef alloc::unordered_set
< Instruction * >::type 
UserListTy
 
- Static Public Member Functions inherited from cacao::jit::compiler2::memory::ManagerMixin< Value >
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::Instruction
 Instruction ()
 
void append_op (Value *v)
 
virtual void replace_op (Value *v_old, Value *v_new)
 
OStreamprint_operands (OStream &OS)
 
- Protected Member Functions inherited from cacao::jit::compiler2::Value
void append_user (Instruction *I)
 
OStreamprint_users (OStream &OS) const
 
void user_remove (Instruction *I)
 
void set_type (Type::TypeID t)
 
- Protected Attributes inherited from cacao::jit::compiler2::Instruction
const InstID opcode
 
Methodmethod
 
const int id
 
BeginInstbegin
 

Detailed Description

Represents a speculative assumption that has to be checked at run-time.

Optimizations that rely on speculative assumptions may generate AssumptionInst in order to avoid the illegal execution of speculatively transformed program regions. In case a speculation fails at run-time, deoptimization will be triggered to transfer execution back to an unoptimized version of this method.

Definition at line 2097 of file Instructions.hpp.

Constructor & Destructor Documentation

cacao::jit::compiler2::AssumptionInst::AssumptionInst ( Value condition,
BeginInst guarded_block 
)
inlineexplicit

Construct an AssumptionInst.

Parameters
conditionA boolean HIR expression that encodes the speculative assumption to check.
guarded_blockThe entry to the region of the code that relies on this assumption and thus needs to be guarded against illegal execution.

Definition at line 2116 of file Instructions.hpp.

Member Function Documentation

virtual void cacao::jit::compiler2::AssumptionInst::accept ( InstructionVisitor v,
bool  copyOperands 
)
inlinevirtual

Visitor pattern.

Implements cacao::jit::compiler2::Instruction.

Definition at line 2155 of file Instructions.hpp.

virtual BeginInst* cacao::jit::compiler2::AssumptionInst::get_guarded_block ( ) const
inlinevirtual

Get the entry to the region of code that relies on this assumption.

Definition at line 2128 of file Instructions.hpp.

virtual bool cacao::jit::compiler2::AssumptionInst::is_homogeneous ( ) const
inlinevirtual
See Also
Instruction::is_homogeneous()

Reimplemented from cacao::jit::compiler2::Instruction.

Definition at line 2135 of file Instructions.hpp.

virtual AssumptionInst* cacao::jit::compiler2::AssumptionInst::to_AssumptionInst ( )
inlinevirtual

Conversion method.

Reimplemented from cacao::jit::compiler2::Instruction.

Definition at line 2150 of file Instructions.hpp.

virtual Instruction* cacao::jit::compiler2::AssumptionInst::to_Instruction ( )
inlinevirtual

Conversion method.

Reimplemented from cacao::jit::compiler2::Instruction.

Definition at line 2140 of file Instructions.hpp.

virtual SourceStateAwareInst* cacao::jit::compiler2::AssumptionInst::to_SourceStateAwareInst ( )
inlinevirtual

Conversion method.

Reimplemented from cacao::jit::compiler2::Instruction.

Definition at line 2145 of file Instructions.hpp.

Field Documentation

BeginInst* cacao::jit::compiler2::AssumptionInst::guarded_block
private

The entry to the region of code that relies on this assumption.

Definition at line 2103 of file Instructions.hpp.


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