|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectataspectj.AtAspectjComponent
ataspectj.instrumentation.InstructionInstrumentationFactory
public class InstructionInstrumentationFactory
Used to modify the instruction list of the annotated blocks and to create the new istruction list for the new methods extracted.
Field Summary |
---|
Fields inherited from class ataspectj.AtAspectjComponent |
---|
barrier, CODEPRINT, DEBUG, VERBOSE |
Constructor Summary | |
---|---|
InstructionInstrumentationFactory()
|
Method Summary | |
---|---|
static boolean |
checkIfThereIsWrapperExpressionCall(org.apache.bcel.generic.Instruction invk,
org.apache.bcel.generic.ConstantPoolGen cg)
Checks if there is a call to a wrapper expression annotation method. |
static org.apache.bcel.generic.Instruction |
createALoadInstruction(int index,
org.apache.bcel.generic.Type tprim,
org.apache.bcel.generic.InstructionFactory ifact)
It cretes a ALOAD instruction |
static org.apache.bcel.generic.Instruction |
createAStoreInstruction(int index,
org.apache.bcel.generic.Type tprim,
org.apache.bcel.generic.InstructionFactory ifact)
It cretes a ASTORE instruction |
static org.apache.bcel.generic.Instruction |
createGetField(org.apache.bcel.generic.Type primType,
java.lang.String fieldName,
org.apache.bcel.generic.InstructionFactory ifact)
TO DO CHECK Field name It create a get field instruction. |
static org.apache.bcel.generic.Instruction |
createPutField(org.apache.bcel.generic.Type primType,
java.lang.String fieldName,
org.apache.bcel.generic.InstructionFactory ifact)
TO DO CHECK Field name It create a put field instruction. |
static org.apache.bcel.generic.Instruction |
createTypeValue(org.apache.bcel.generic.Type primType,
org.apache.bcel.generic.InstructionFactory ifact)
It creates a typeValue method invocation instruction, where the type used is the appropriate one for the given primitive type |
static org.apache.bcel.generic.Instruction |
createValueOf(org.apache.bcel.generic.Type primType,
org.apache.bcel.generic.InstructionFactory ifact)
It creates a valueOf method invocation instruction, where the type used is the appropriate one for the given primitive type |
static int[] |
getIndexes(java.lang.String s)
|
static org.apache.bcel.generic.Type |
getTypeFromPrimitive(org.apache.bcel.generic.Type t)
It returns the appropriate wrapper type for the given primitive type. |
static boolean |
isIINCInstruction(org.apache.bcel.generic.Instruction i)
It checks if the given instruction is a IINC instruction. |
static boolean |
isLoadInstruction(org.apache.bcel.generic.Instruction i)
It checks if the given instruction is a load instruction. |
static boolean |
isLocalVariableInstruction(org.apache.bcel.generic.Instruction i)
It checks if the given instruction is a local variable instruction. |
static boolean |
isStoreInstruction(org.apache.bcel.generic.Instruction i)
It checks if the given instruction is a store instruction. |
static IndexRepository |
searchIndexRepository(int oldIndex,
IndexRepository[] allRep)
It searchs the IndexRepository that store the information for the given index. |
static java.lang.String |
selectValueMethodName(org.apache.bcel.generic.Type primType)
It selects the appropriate method name for the type value. |
static void |
updateIINCInstruction(org.apache.bcel.generic.InstructionHandle ih,
org.apache.bcel.generic.InstructionList oldIl,
IndexRepository indexRep,
org.apache.bcel.generic.InstructionFactory ifact,
int freeIndex,
int increment)
It updates the IINC insruction, it replaces the IINC with a Load, and IADD |
static org.apache.bcel.generic.InstructionList |
updateInstructionList(InstrumentationRepository irep,
IndexRepository[] allIndexRep,
org.apache.bcel.generic.ConstantPoolGen cg,
boolean isStatic)
It updates the index of local variables instruction of the InstructionList contained into the InstrumentationRepository, to do that use the the indexes stored into the IndexRepositories. |
static void |
updatePrimTypeLoadInstruction(org.apache.bcel.generic.InstructionHandle ih,
org.apache.bcel.generic.InstructionList oldIl,
IndexRepository indexRep,
org.apache.bcel.generic.InstructionFactory ifact)
It updates a primitive types LOAD instrcution, it replaces the LOAD with a Load, and GETFIELD |
static void |
updatePrimTypeStoreInstruction(org.apache.bcel.generic.InstructionHandle ih,
org.apache.bcel.generic.InstructionList oldIl,
IndexRepository indexRep,
org.apache.bcel.generic.InstructionFactory ifact)
It updates a primitive types store instrcution, it replaces the STORE with a Load, and PUTFIELD |
static void |
updatePrimTypeStoreInstructionWrapCall(org.apache.bcel.generic.InstructionHandle ih,
org.apache.bcel.generic.InstructionList oldIl,
IndexRepository indexRep,
org.apache.bcel.generic.InstructionFactory ifact,
org.apache.bcel.generic.ConstantPoolGen cg)
It updates a primitive types store instrcution, it replaces the STORE with a Load, and PUTFIELD, in case there is wrapperExpressionCall |
Methods inherited from class ataspectj.AtAspectjComponent |
---|
done |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstructionInstrumentationFactory()
Method Detail |
---|
public static org.apache.bcel.generic.InstructionList updateInstructionList(InstrumentationRepository irep, IndexRepository[] allIndexRep, org.apache.bcel.generic.ConstantPoolGen cg, boolean isStatic) throws java.lang.Exception
irep
- the InstrumentationRepository containing the InstructionList to update.allIndexRep
- the IndexRepository of the local variables involved.cg
- the ConstantPoolGen.isStatic
- true if the InstructionList belongs to a static method.
java.lang.Exception
- TODO investifare sulla eccezione che puo' essere sollevata.public static boolean checkIfThereIsWrapperExpressionCall(org.apache.bcel.generic.Instruction invk, org.apache.bcel.generic.ConstantPoolGen cg)
invk
- the istruction to check.cg
- the constant pool.public static void updateIINCInstruction(org.apache.bcel.generic.InstructionHandle ih, org.apache.bcel.generic.InstructionList oldIl, IndexRepository indexRep, org.apache.bcel.generic.InstructionFactory ifact, int freeIndex, int increment) throws org.apache.bcel.generic.TargetLostException
ih
- the InstructionHandle of the IINC instruction.oldIl
- the old InstructionList to update.indexRep
- the IndexRep storing the information of the local variable involved.ifact
- the InstructionFactory to create the needed instruction.freeIndex
- the free index to updateincrement
- the increment params of the IINC
org.apache.bcel.generic.TargetLostException
- raised if the IINC instruction is a target of a jump.public static void updatePrimTypeStoreInstruction(org.apache.bcel.generic.InstructionHandle ih, org.apache.bcel.generic.InstructionList oldIl, IndexRepository indexRep, org.apache.bcel.generic.InstructionFactory ifact) throws org.apache.bcel.generic.TargetLostException
ih
- the InstructionHandle of the STORE instruction.oldIl
- the old InstructionList to update.indexRep
- the IndexRep storing the information of the local variable involved.ifact
- the InstructionFactory to create the needed instruction.
org.apache.bcel.generic.TargetLostException
- raised if the STORE instruction is a target of a jump.public static void updatePrimTypeStoreInstructionWrapCall(org.apache.bcel.generic.InstructionHandle ih, org.apache.bcel.generic.InstructionList oldIl, IndexRepository indexRep, org.apache.bcel.generic.InstructionFactory ifact, org.apache.bcel.generic.ConstantPoolGen cg) throws org.apache.bcel.generic.TargetLostException
ih
- the InstructionHandle of the STORE instruction.oldIl
- the old InstructionList to update.indexRep
- the IndexRep storing the information of the local variable involved.ifact
- the InstructionFactory to create the needed instruction.
org.apache.bcel.generic.TargetLostException
- raised if the STORE instruction is a target of a jump.public static int[] getIndexes(java.lang.String s)
public static void updatePrimTypeLoadInstruction(org.apache.bcel.generic.InstructionHandle ih, org.apache.bcel.generic.InstructionList oldIl, IndexRepository indexRep, org.apache.bcel.generic.InstructionFactory ifact) throws org.apache.bcel.generic.TargetLostException
ih
- the InstructionHandle of the LOAD instruction.oldIl
- the old InstructionList to update.indexRep
- the IndexRep storing the information of the local variable involved.ifact
- the InstructionFactory to create the needed instruction.
org.apache.bcel.generic.TargetLostException
- raised if the LOAD instruction is a target of a jump.public static IndexRepository searchIndexRepository(int oldIndex, IndexRepository[] allRep)
oldIndex
- the old index to search.allRep
- the index repositories to search in.
public static org.apache.bcel.generic.Instruction createAStoreInstruction(int index, org.apache.bcel.generic.Type tprim, org.apache.bcel.generic.InstructionFactory ifact)
index
- the index where store the primitive type.tprim
- the primitive type to store.ifact
- the instruction factory to use.
public static org.apache.bcel.generic.Instruction createALoadInstruction(int index, org.apache.bcel.generic.Type tprim, org.apache.bcel.generic.InstructionFactory ifact)
index
- the index where load the primitive type.tprim
- the primitive type to load.ifact
- the instruction factory to use.
public static org.apache.bcel.generic.Type getTypeFromPrimitive(org.apache.bcel.generic.Type t)
t
- The primitive type.
public static boolean isLocalVariableInstruction(org.apache.bcel.generic.Instruction i)
i
- The instruction to check.
public static boolean isStoreInstruction(org.apache.bcel.generic.Instruction i)
i
- The instruction to check.
public static boolean isLoadInstruction(org.apache.bcel.generic.Instruction i)
i
- The instruction to check.
public static boolean isIINCInstruction(org.apache.bcel.generic.Instruction i)
i
- The instruction to check.
public static org.apache.bcel.generic.Instruction createTypeValue(org.apache.bcel.generic.Type primType, org.apache.bcel.generic.InstructionFactory ifact)
primType
- The primitive type to use.ifact
- The instruction factory to use.
public static org.apache.bcel.generic.Instruction createValueOf(org.apache.bcel.generic.Type primType, org.apache.bcel.generic.InstructionFactory ifact)
primType
- The primitive type to use.ifact
- The instruction factory to use.
public static org.apache.bcel.generic.Instruction createGetField(org.apache.bcel.generic.Type primType, java.lang.String fieldName, org.apache.bcel.generic.InstructionFactory ifact)
primType
- The primitive type to get.fieldName
- The name of the field to get.ifact
- The instruction factory to use.
public static org.apache.bcel.generic.Instruction createPutField(org.apache.bcel.generic.Type primType, java.lang.String fieldName, org.apache.bcel.generic.InstructionFactory ifact)
primType
- The primitive type to fill.fieldName
- The name of the field to fill.ifact
- The instruction factory to use.
public static java.lang.String selectValueMethodName(org.apache.bcel.generic.Type primType)
primType
- The primitive type to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |