|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ow2.asmdex.MethodVisitor
org.ow2.asmdex.util.RegisterShiftMethodAdapter
public class RegisterShiftMethodAdapter
Method Adapter used to shift all the registers found in the bytecode.
| Field Summary |
|---|
| Fields inherited from class org.ow2.asmdex.MethodVisitor |
|---|
api, mv |
| Constructor Summary | |
|---|---|
RegisterShiftMethodAdapter(int api,
MethodVisitor mv,
int nbRegistersToShift)
Constructor |
|
| Method Summary | |
|---|---|
void |
visitArrayLengthInsn(int destinationRegister,
int arrayReferenceBearing)
Visits an ARRAY-LENGTH instruction. |
void |
visitArrayOperationInsn(int opcode,
int valueRegister,
int arrayRegister,
int indexRegister)
Visits an instruction that performs an operation on an array. |
void |
visitFieldInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String desc,
int valueRegister,
int objectRegister)
Visits a field instruction. |
void |
visitFillArrayDataInsn(int arrayReference,
java.lang.Object[] arrayData)
Visits a Fill Array Data instruction. |
void |
visitIntInsn(int opcode,
int register)
Visits an instruction with a single register. |
void |
visitJumpInsn(int opcode,
Label label,
int registerA,
int registerB)
Visits a jump operation, conditional or not. |
void |
visitLocalVariable(java.lang.String name,
java.lang.String desc,
java.lang.String signature,
Label start,
Label end,
int index)
Visits a local variable declaration. |
void |
visitLocalVariable(java.lang.String name,
java.lang.String desc,
java.lang.String signature,
Label start,
java.util.List<Label> ends,
java.util.List<Label> restarts,
int index)
Visits a local variable declaration. |
void |
visitLookupSwitchInsn(int register,
Label dflt,
int[] keys,
Label[] labels)
Visits a LOOKUPSWITCH instruction. |
void |
visitMaxs(int maxStack,
int maxLocals)
Visits the maximum stack size and the maximum number of local variables of the method. |
void |
visitMethodInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String desc,
int[] arguments)
Visits a method instruction. |
void |
visitMultiANewArrayInsn(java.lang.String desc,
int[] registers)
Visits a MULTIANEWARRAY instruction. |
void |
visitOperationInsn(int opcode,
int destinationRegister,
int firstSourceRegister,
int secondSourceRegister,
int value)
Visits an instruction that performs an unary or binary operation on one or two sources or one array, possibly a literal value, to a destination register. |
AnnotationVisitor |
visitParameterAnnotation(int parameter,
java.lang.String desc,
boolean visible)
Visits an annotation of a parameter this method. |
void |
visitStringInsn(int opcode,
int destinationRegister,
java.lang.String string)
Visits a string instruction. |
void |
visitTableSwitchInsn(int register,
int min,
int max,
Label dflt,
Label[] labels)
Visits a TABLESWITCH instruction. |
void |
visitTypeInsn(int opcode,
int destinationRegister,
int referenceBearingRegister,
int sizeRegister,
java.lang.String type)
Visits a type instruction. |
void |
visitVarInsn(int opcode,
int destinationRegister,
int var)
Visits a local variable instruction. |
void |
visitVarInsn(int opcode,
int destinationRegister,
long var)
Visits a local variable instruction, using a Long. |
| Methods inherited from class org.ow2.asmdex.MethodVisitor |
|---|
visitAnnotation, visitAnnotationDefault, visitAttribute, visitCode, visitEnd, visitFrame, visitInsn, visitLabel, visitLineNumber, visitParameters, visitTryCatchBlock |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RegisterShiftMethodAdapter(int api,
MethodVisitor mv,
int nbRegistersToShift)
api - api levelmv - method adapternbRegistersToShift - offset of the shift.| Method Detail |
|---|
public void visitMaxs(int maxStack,
int maxLocals)
MethodVisitor
visitMaxs in class MethodVisitormaxStack - maximum stack size of the method.maxLocals - ignored in AsmDex. Maximum number of local variables
for the method.
public void visitArrayLengthInsn(int destinationRegister,
int arrayReferenceBearing)
MethodVisitor
visitArrayLengthInsn in class MethodVisitordestinationRegister - the destination register.arrayReferenceBearing - register referencing the array.
public void visitFieldInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String desc,
int valueRegister,
int objectRegister)
MethodVisitor
visitFieldInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either IinstanceOP (IGETxx/IPUTxx) and SstaticOP (SGETXX/IPUTxx).owner - the internal name of the field's owner class.name - the field's name.desc - the field's descriptor.valueRegister - the value register.objectRegister - the objectRegister. Ignored for static operations.
public void visitIntInsn(int opcode,
int register)
MethodVisitor
visitIntInsn in class MethodVisitoropcode - the opcode of the instruction to be visited.
This opcode is either RETURN, RETURN-WIDE, RETURN-OBJECT,
MOVE-RESULT, MOVE-RESULT-WIDE, MOVE-RESULT-OBJECT, MOVE-EXCEPTION,
THROW vAA.register - the operand of the instruction to be visited.
public void visitJumpInsn(int opcode,
Label label,
int registerA,
int registerB)
MethodVisitor
visitJumpInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either GOTO, IF-EQ, IF-NE, IF-LT, IF-GE, IF-GT, IF-LE,
or IF-EQZ, IF-NEZ, IF-LTZ, IF-GEZ, IF-GTZ, IF-LEZ.label - the operand of the instruction to be visited. This operand
is a label that designates the instruction to which the jump
instruction may jump.registerA - (4 bits). Ignored for unconditional jump.registerB - (4 bits). Ignored for unconditional jump or zero tests (IF-EQZ,
IF-NEZ...)
public void visitLocalVariable(java.lang.String name,
java.lang.String desc,
java.lang.String signature,
Label start,
Label end,
int index)
MethodVisitor
visitLocalVariable in class MethodVisitorname - the name of a local variable.desc - the type descriptor of this local variable.signature - the type signature of this local variable. May be
null if the local variable type does not use generic
types.start - the first instruction corresponding to the scope of this
local variable (inclusive).end - the last instruction corresponding to the scope of this local
variable (exclusive). May be null if we don't know it.index - the local variable's index.
public void visitLocalVariable(java.lang.String name,
java.lang.String desc,
java.lang.String signature,
Label start,
java.util.List<Label> ends,
java.util.List<Label> restarts,
int index)
MethodVisitor
visitLocalVariable in class MethodVisitorname - the name of a local variable.desc - the type descriptor of this local variable.signature - the type signature of this local variable. May be
null if the local variable type does not use generic
types.start - the first instruction corresponding to the scope of this
local variable (inclusive).ends - the last instruction corresponding to the scope of this local
variable (exclusive). May be null if we don't know it. As Variables can be
restarted, we may have several ends.restarts - the instruction where the local variable is restarted. May be
null if it never happens. Variables can be restarted as many times as
needed, hence the array.index - the local variable's index.
public void visitFillArrayDataInsn(int arrayReference,
java.lang.Object[] arrayData)
MethodVisitor
visitFillArrayDataInsn in class MethodVisitorarrayReference - array reference.arrayData - array of the primitives to encode.
public void visitArrayOperationInsn(int opcode,
int valueRegister,
int arrayRegister,
int indexRegister)
MethodVisitor
visitArrayOperationInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either AGET(-xxx) or APUT(-xxx).valueRegister - the value register. May be source or destination register/pair.arrayRegister - the array register.indexRegister - the index register.
public void visitLookupSwitchInsn(int register,
Label dflt,
int[] keys,
Label[] labels)
MethodVisitor
visitLookupSwitchInsn in class MethodVisitorregister - the register to test.dflt - beginning of the default handler block (ignored by the Writer).keys - the values of the keys.labels - beginnings of the handler blocks. labels[i] is
the beginning of the handler block for the keys[i] key.
public void visitTableSwitchInsn(int register,
int min,
int max,
Label dflt,
Label[] labels)
MethodVisitor
visitTableSwitchInsn in class MethodVisitorregister - the register to test.min - the minimum key value.max - the maximum key value (ignored by the Writer).dflt - beginning of the default handler block (ignored by the Writer).labels - beginnings of the handler blocks. labels[i] is
the beginning of the handler block for the min + i key.
public void visitMultiANewArrayInsn(java.lang.String desc,
int[] registers)
MethodVisitor
visitMultiANewArrayInsn in class MethodVisitordesc - an array type descriptor.registers - array of registers containing the values of the array.
public void visitMethodInsn(int opcode,
java.lang.String owner,
java.lang.String name,
java.lang.String desc,
int[] arguments)
MethodVisitor
visitMethodInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either INVOKE-VIRTUAL, INVOKE-SUPER, INVOKE-DIRECT,
INVOKE-STATIC or INVOKE-INTERFACE.owner - the internal name of the method's owner class.name - the method's name.desc - the method's descriptor.arguments - the arguments to give to the method.
public void visitOperationInsn(int opcode,
int destinationRegister,
int firstSourceRegister,
int secondSourceRegister,
int value)
MethodVisitor
visitOperationInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is in either of these categories : UNOP, BINOP, BINOP/2ADDR,
BINOP/LIT16, BINOP/LIT8.destinationRegister - the destination register or pair. For BINOP/2ADDR,
it should be the same as firstSourceRegister.firstSourceRegister - the first source register or pair. For BINOP/2ADDR,
it should be the same as destinationRegister.secondSourceRegister - the second source register or pair. Ignored for
UNOP, BINOP/LIT16, BINOP/LIT8.value - literal value. Only useful for BINOP/LIT16, BINOP/LIT8.
public AnnotationVisitor visitParameterAnnotation(int parameter,
java.lang.String desc,
boolean visible)
MethodVisitor
visitParameterAnnotation in class MethodVisitorparameter - the parameter index.desc - the class descriptor of the annotation class.visible - true if the annotation is visible at runtime.
public void visitStringInsn(int opcode,
int destinationRegister,
java.lang.String string)
MethodVisitor
visitStringInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either CONST-STRING or CONST-STRING/JUMBO.destinationRegister - the destination register.string - the string of the instruction to be visited.
public void visitTypeInsn(int opcode,
int destinationRegister,
int referenceBearingRegister,
int sizeRegister,
java.lang.String type)
MethodVisitor
visitTypeInsn in class MethodVisitoropcode - the opcode of the type instruction to be visited. This
opcode is either CONST-CLASS, NEW-ARRAY, NEW-INSTANCE, CHECK-CAST
or INSTANCE-OF.destinationRegister - the destination register. Used only by CONST-CLASS,
INSTANCE-OF, NEW-INSTANCE, NEW-ARRAY.referenceBearingRegister - reference bearing register. Only used for
CHECK-CAST, INSTANCE-OF instructions.sizeRegister - size register. Used only for NEW-ARRAY.type - the operand of the instruction to be visited. This operand
must be the internal name of an object or array class.
public void visitVarInsn(int opcode,
int destinationRegister,
int var)
MethodVisitor
visitVarInsn in class MethodVisitoropcode - the opcode of the local variable instruction to be visited.
This opcode is either MOVE, MOVE/FROM16, MOVE/16, MOVE-WIDE,
MOVE-WIDE/FROM16, MOVE-WIDE/16, MOVE-OBJECT, MOVE-OBJECT/FROM16,
MOVE-OBJECT/16,
CONST/4, CONST/16, CONST, CONST/HIGH16, CONST-WIDE/16, CONST-WIDE/32.destinationRegister - the destination register.var - the operand of the instruction to be visited. This operand is
either a value or a source Register.
public void visitVarInsn(int opcode,
int destinationRegister,
long var)
MethodVisitor
visitVarInsn in class MethodVisitoropcode - the opcode of the local variable instruction to be visited.
This opcode is either CONST-WIDE, CONST-WIDE/HIGH16.destinationRegister - the destination register.var - the operand of the instruction to be visited. This operand is
either a value or a source Register.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||