Package com.ibm.wala.shrike.shrikeBT
Interface IInstruction
-
- All Known Subinterfaces:
IArrayLoadInstruction,IArrayStoreInstruction,IBinaryOpInstruction,IComparisonInstruction,IConditionalBranchInstruction,IConversionInstruction,IGetInstruction,IInstanceofInstruction,IInvokeInstruction,ILoadIndirectInstruction,ILoadInstruction,IPutInstruction,IShiftInstruction,IStoreIndirectInstruction,IStoreInstruction,ITypeTestInstruction,IUnaryOpInstruction
- All Known Implementing Classes:
ArrayLengthInstruction,ArrayLoadInstruction,ArrayStoreInstruction,BinaryOpInstruction,CheckCastInstruction,ComparisonInstruction,ConditionalBranchInstruction,ConstantInstruction,ConversionInstruction,DupInstruction,GetInstruction,GotoInstruction,InstanceofInstruction,Instruction,InvokeDynamicInstruction,InvokeInstruction,LoadInstruction,MonitorInstruction,NewInstruction,PopInstruction,PutInstruction,ReturnInstruction,ShiftInstruction,StoreInstruction,SwapInstruction,SwitchInstruction,ThrowInstruction,UnaryOpInstruction
public interface IInstruction
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIInstruction.VisitorThis class is used by IInstruction.visit to dispatch based on the instruction type.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]getBranchTargets()intgetPoppedCount()java.lang.StringgetPushedType(java.lang.String[] poppedTypesToCheck)Computes the type of data pushed onto the stack, or null if none is pushed.bytegetPushedWordSize()booleanisFallThrough()booleanisPEI()PEI == "Potentially excepting instruction"IInstructionredirectTargets(int[] targetMap)java.lang.StringtoString()Subclasses must implement toString.voidvisit(IInstruction.Visitor v)Apply a Visitor to this instruction.
-
-
-
Method Detail
-
isFallThrough
boolean isFallThrough()
- Returns:
- true if the instruction can "fall through" to the following instruction
-
getBranchTargets
int[] getBranchTargets()
- Returns:
- an array containing the labels this instruction can branch to (not including the following instruction if this instruction 'falls through')
-
redirectTargets
IInstruction redirectTargets(int[] targetMap)
- Returns:
- an Instruction equivalent to this one but with any branch labels updated by looking them up in the targetMap array
-
getPoppedCount
int getPoppedCount()
- Returns:
- the number of values this instruction pops off the working stack
-
getPushedType
java.lang.String getPushedType(java.lang.String[] poppedTypesToCheck)
Computes the type of data pushed onto the stack, or null if none is pushed.- Parameters:
poppedTypesToCheck- the types of the data popped off the stack by this instruction; if poppedTypes is null, then we don't know the incoming stack types and the result of this method may be less accurate
-
getPushedWordSize
byte getPushedWordSize()
- Returns:
- the JVM word size of the value this instruction pushes onto the stack, or 0 if this instruction doesn't push anything onto the stack.
-
visit
void visit(IInstruction.Visitor v)
Apply a Visitor to this instruction. We invoke the appropriate Visitor method according to the type of this instruction.
-
toString
java.lang.String toString()
Subclasses must implement toString.- Overrides:
toStringin classjava.lang.Object
-
isPEI
boolean isPEI()
PEI == "Potentially excepting instruction"- Returns:
- true iff this instruction might throw an exception
-
-