31 #ifndef _JIT_COMPILER2_INSTRUCTIONS
32 #define _JIT_COMPILER2_INSTRUCTIONS
123 for (PredecessorListTy::const_iterator
i =
pred_list.begin(),
134 if (index < 0 || (
unsigned)index >
pred_size()) {
137 PredecessorListTy::const_iterator
i =
pred_list.begin();
191 return OS << BIR.
get();
241 for (SuccessorListTy::const_iterator
i =
succ_list.begin(),
243 if (BI ==
i->get()) {
456 default: assert(0);
return 0;
760 fmiref(fmiref), resolved(resolved) {
761 assert(state_change && state_change->
get_name());
851 <<
") is greater then tablelow ("<<
tablelow <<
")");
898 ERROR_MSG(
"LOOKUPSWITCH verification error",
"Lookup count is negative ("
904 <<
") not equal to targets (" <<
lookupcount + 1 <<
")");
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
NEWInst(Type::TypeID type)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
PHIInst(Type::TypeID type, BeginInst *begin)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual AREFInst * to_AREFInst()
CONSTInst(double d, Type::DoubleType)
BeginInstRef & get_else_target()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool has_side_effects() const
True the instruction has side effects.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual CASTInst * to_CASTInst()
virtual OStream & print(OStream &OS) const
print
virtual JSRInst * to_JSRInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual INVOKEINTERFACEInst * to_INVOKEINTERFACEInst()
virtual INVOKESPECIALInst * to_INVOKESPECIALInst()
virtual IF_CMPInst * to_IF_CMPInst()
virtual INVOKESTATICInst * to_INVOKESTATICInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BeginInst * get_predecessor(int index) const
XORInst(Type::TypeID type, Value *S1, Value *S2)
CondInst(Conditional::CondID cond)
INSTANCEOFInst(Type::TypeID type)
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual IFInst * to_IFInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BUILTINInst * to_BUILTINInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
CMPInst(Value *S1, Value *S2, FloatHandling f)
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual INSTANCEOFInst * to_INSTANCEOFInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual GETEXCEPTIONInst * to_GETEXCEPTIONInst()
Type::TypeID get_type() const
get the value type of the instruction
BeginInstRef & succ_back()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
MatchTy::iterator match_iterator
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
NEGInst(Type::TypeID type, Value *S1)
virtual MULInst * to_MULInst()
PredecessorListTy::const_iterator const_pred_iterator
virtual SHLInst * to_SHLInst()
virtual BinaryInst * to_BinaryInst()
INVOKESPECIALInst(Type::TypeID type)
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
const char * get_name() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BeginInstRef(const BeginInstRef &other)
copy constructor
int get_successor_index(const BeginInst *BI) const
This Instruction mark the start of a basic block.
virtual GETFIELDInst * to_GETFIELDInst()
This Instruction mark the end of a basic block.
const_dep_iterator dep_begin() const
TABLESWITCHInst(BeginInst *begin, Value *S1, LOW low, HIGH high)
constructor
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
BeginInstRef & operator=(BeginInst *BI)
virtual CMPInst * to_CMPInst()
UnaryInst(InstID id, Type::TypeID type, Value *S1)
alloc::vector< s4 >::type MatchTy
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
PUTSTATICInst(Value *value, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual XORInst * to_XORInst()
void set_successor(int index, BeginInst *BI)
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
ADDInst(Type::TypeID type, Value *S1, Value *S2)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
IFInst(BeginInst *begin, Value *S1, Value *S2, Conditional::CondID cond, BeginInst *trueBlock, BeginInst *falseBlock)
MethodDescriptor & get_MethodDescriptor()
BeginInstRef & operator=(const BeginInstRef &other)
copy assignment operator
virtual ALOADInst * to_ALOADInst()
LoadInst(InstID id, Type::TypeID type, BeginInst *begin)
virtual UnaryInst * to_UnaryInst()
virtual bool verify() const
check if the instruction is in a correct state
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
ARRAYLENGTHInst(Value *S1)
alloc::vector< BeginInstRef >::type SuccessorListTy
virtual CHECKNULLInst * to_CHECKNULLInst()
CONSTInst(int64_t l, Type::LongType)
#define ERROR_MSG(EXPR_SHORT, EXPR_LONG)
void append_dep(Instruction *I)
int get_successor_index(const BeginInst *BI) const
virtual ARRAYLENGTHInst * to_ARRAYLENGTHInst()
GOTOInst(BeginInst *begin, BeginInst *targetBlock)
NEWARRAYInst(Type::TypeID type)
CHECKCASTInst(Type::TypeID type)
virtual MOVEInst * to_MOVEInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
const_pred_iterator pred_begin() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
EndInst(BeginInst *begin)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
THROWInst(Type::TypeID type)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual CONSTInst * to_CONSTInst()
virtual PHIInst * to_PHIInst()
virtual INVOKEVIRTUALInst * to_INVOKEVIRTUALInst()
void set_EndInst(EndInst *e)
constant_FMIref * get_fmiref() const
ALOADInst(Type::TypeID type, Value *ref, BeginInst *begin, Instruction *state_change)
JSRInst(Type::TypeID type)
JNIEnv jthread jobject jclass jlong size
INVOKEVIRTUALInst(Type::TypeID type)
virtual INCInst * to_INCInst()
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
EndInst(InstID id, BeginInst *begin)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
INCInst(Type::TypeID type)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
SuccessorListTy::const_reverse_iterator succ_rbegin() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
this stores a reference to a begin instruction
virtual ORInst * to_ORInst()
REMInst(Type::TypeID type, Value *S1, Value *S2)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
STOREInst(Type::TypeID type)
MOVEInst(Type::TypeID type)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
SuccessorListTy::const_reverse_iterator succ_rend() const
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
SuccessorListTy::const_iterator succ_end() const
GOTOInst(BeginInst *begin)
CONSTInst(float f, Type::FloatType)
virtual THROWInst * to_THROWInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool verify() const
check if the instruction is in a correct state
int get_predecessor_index(const BeginInst *BI) const
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual GETSTATICInst * to_GETSTATICInst()
virtual PUTFIELDInst * to_PUTFIELDInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
MULTIANEWARRAYInst(Type::TypeID type)
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual NEGInst * to_NEGInst()
virtual STOREInst * to_STOREInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual OStream & print(OStream &OS) const
print
Conditional::CondID get_condition() const
IF_CMPInst(Type::TypeID type)
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
std::vector< T, Allocator< T > > type
virtual COPYInst * to_COPYInst()
TODO not a real Instruction...
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual RETInst * to_RETInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
EndInst * get_EndInst() const
virtual void visit(LoadInst *I, bool copyOperands)
virtual LOADInst * to_LOADInst()
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
Simple stream class for formatted output.
Instruction * dep_front() const
virtual REMInst * to_REMInst()
DIVInst(Type::TypeID type, Value *S1, Value *S2)
virtual ANDInst * to_ANDInst()
OStream & operator<<(OStream &OS, const Conditional::CondID &cond)
void replace_op(Value *v_old, Value *v_new)
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
Fieldref, Methodref and InterfaceMethodref.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual ASTOREInst * to_ASTOREInst()
virtual RETURNInst * to_RETURNInst()
SuccessorListTy::const_iterator succ_begin() const
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
BeginInstRef & get_successor(size_t i)
SuccessorListTy::const_reverse_iterator succ_const_reverse_iterator
virtual BeginInst * to_BeginInst()
PUTFIELDInst(Type::TypeID type)
ANDInst(Type::TypeID type, Value *S1, Value *S2)
RETURNInst(BeginInst *begin)
void return
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
BeginInstRef & get_target()
RETInst(Type::TypeID type)
constant_FMIref * get_fmiref() const
USHRInst(Type::TypeID type)
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
ARRAYBOUNDSCHECKInst(Type::TypeID type, Value *ref, Value *index)
SuccessorListTy::const_iterator succ_const_iterator
virtual CHECKCASTInst * to_CHECKCASTInst()
ASTOREInst(Type::TypeID type, Value *ref, Value *value, BeginInst *begin, Instruction *state_change)
INVOKEINTERFACEInst(Type::TypeID type)
match_iterator match_end()
CASTInst(Type::TypeID type, Value *s1)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual SUBInst * to_SUBInst()
virtual GOTOInst * to_GOTOInst()
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
INVOKESTATICInst(Type::TypeID type, unsigned size, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual ARRAYBOUNDSCHECKInst * to_ARRAYBOUNDSCHECKInst()
void set_predecessor(int index, BeginInst *BI)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
void append_succ(BeginInst *bi)
GETSTATICInst(Type::TypeID type, constant_FMIref *fmiref, bool resolved, BeginInst *begin, Instruction *state_change)
virtual bool has_side_effects() const
True the instruction has side effects.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual ANEWARRAYInst * to_ANEWARRAYInst()
alloc::vector< BeginInst * >::type PredecessorListTy
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual NOPInst * to_NOPInst()
virtual NEWARRAYInst * to_NEWARRAYInst()
SuccessorListTy succ_list
constant_FMIref * get_fmiref() const
COPYInst(Type::TypeID type)
virtual MULTIANEWARRAYInst * to_MULTIANEWARRAYInst()
SUBInst(Type::TypeID type, Value *S1, Value *S2)
virtual bool is_arithmetic() const
True if the instruction is an arithmetic instruction.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
const_pred_iterator pred_end() const
virtual LOOKUPSWITCHInst * to_LOOKUPSWITCHInst()
virtual PUTSTATICInst * to_PUTSTATICInst()
BeginInstRef(BeginInst *BI)
virtual bool has_side_effects() const
True the instruction has side effects.
AREFInst(Type::TypeID type, Value *ref, Value *index)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual TABLESWITCHInst * to_TABLESWITCHInst()
unsigned get_index() const
virtual POPInst * to_POPInst()
RETURNInst(BeginInst *begin, Value *S1)
value return
PredecessorListTy pred_list
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
virtual EndInst * to_EndInst()
virtual bool is_commutable() const
True if the operands of the instruction are commutable.
CHECKNULLInst(Type::TypeID type)
GETFIELDInst(Type::TypeID type)
LOADInst(Type::TypeID type, unsigned index, BeginInst *begin)
virtual BeginInst * to_BeginInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_homogeneous() const
True if the instruction has a homogeneous signature.
virtual bool verify() const
check if the instruction is in a correct state
virtual DIVInst * to_DIVInst()
ContainerInst(BeginInst *begin)
java_handle_t * stringconst
POPInst(Type::TypeID type)
virtual bool has_side_effects() const
True the instruction has side effects.
void set_successor(int index, BeginInst *BI)
GETEXCEPTIONInst(Type::TypeID type)
void set_match(s4 index, MATCH match)
Type::TypeID get_array_type() const
BeginInstRef & get_then_target()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual bool is_floating() const
True if the instruction has no fixed control dependencies.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BinaryInst(InstID id, Type::TypeID type, Value *S1, Value *S2)
SHLInst(Type::TypeID type)
CONSTInst(int32_t i, Type::IntType)
void set_type(Type::TypeID t)
virtual USHRInst * to_USHRInst()
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
BeginInstRef & succ_front()
BUILTINInst(Type::TypeID type)
virtual NEWInst * to_NEWInst()
double get_Double() const
void append_parameter(Value *V)
virtual ContainerInst * to_ContainerInst()
match_iterator match_begin()
ORInst(Type::TypeID type, Value *S1, Value *S2)
std::size_t pred_size() const
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
MultiOpInst(InstID id, Type::TypeID type)
MULInst(Type::TypeID type, Value *S1, Value *S2)
FloatHandling get_FloatHandling() const
ANEWARRAYInst(Type::TypeID type)
LOOKUPSWITCHInst(BeginInst *begin, Value *S1, s4 lookupcount)
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual void accept(InstructionVisitor &v, bool copyOperands)
Visitor.
virtual BeginInst * get_BeginInst() const
Get the corresponding BeginInst.
virtual ADDInst * to_ADDInst()
MethodDescriptor TODO: more info.