Package com.tonic.analysis.visitor
Class AbstractBytecodeVisitor
- java.lang.Object
-
- com.tonic.analysis.visitor.AbstractBytecodeVisitor
-
- All Implemented Interfaces:
Visitor<MethodEntry>
public abstract class AbstractBytecodeVisitor extends Object implements Visitor<MethodEntry>
Base visitor over a method's decoded instructions whose per-instruction visit hooks are all no-ops.
-
-
Constructor Summary
Constructors Constructor Description AbstractBytecodeVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprocess(MethodEntry method)Processes the given method by visiting its bytecode instructions.voidvisit(AALoadInstruction instr)Visits an aaload instruction.voidvisit(AAStoreInstruction instr)Visits an aastore instruction.voidvisit(AConstNullInstruction instr)Visits an aconst_null instruction.voidvisit(ALoadInstruction instr)Visits an aload instruction.voidvisit(ANewArrayInstruction instr)Visits an anewarray instruction.voidvisit(ArithmeticInstruction instr)Visits an arithmetic instruction (add/sub/mul/div/rem).voidvisit(ArithmeticShiftInstruction instr)Visits a shift instruction (ishl/ishr/iushr and long forms).voidvisit(ArrayLengthInstruction instr)Visits an arraylength instruction.voidvisit(AStoreInstruction instr)Visits an astore instruction.voidvisit(ATHROWInstruction instr)Visits an athrow instruction.voidvisit(BALOADInstruction instr)Visits a baload instruction.voidvisit(BAStoreInstruction instr)Visits a bastore instruction.voidvisit(BipushInstruction instr)Visits a bipush instruction.voidvisit(CALoadInstruction instr)Visits a caload instruction.voidvisit(CAStoreInstruction instr)Visits a castore instruction.voidvisit(CheckCastInstruction instr)Visits a checkcast instruction.voidvisit(CompareInstruction instr)Visits a compare instruction (lcmp/fcmpl/fcmpg/dcmpl/dcmpg).voidvisit(ConditionalBranchInstruction instr)Visits a conditional branch instruction (if_*).voidvisit(ConversionInstruction instr)Visits a primitive conversion instruction (i2f, l2d, ...).voidvisit(DALoadInstruction instr)Visits a daload instruction.voidvisit(DAStoreInstruction instr)Visits a dastore instruction.voidvisit(DConstInstruction instr)Visits a dconst instruction.voidvisit(DLoadInstruction instr)Visits a dload instruction.voidvisit(DNegInstruction instr)Visits a dneg instruction.voidvisit(DStoreInstruction instr)Visits a dstore instruction.voidvisit(DupInstruction instr)Visits a dup-family stack duplication instruction.voidvisit(FALoadInstruction instr)Visits an faload instruction.voidvisit(FAStoreInstruction instr)Visits an fastore instruction.voidvisit(FConstInstruction instr)Visits an fconst instruction.voidvisit(FLoadInstruction instr)Visits an fload instruction.voidvisit(FNegInstruction instr)Visits an fneg instruction.voidvisit(FStoreInstruction instr)Visits an fstore instruction.voidvisit(GetFieldInstruction instr)Visits a getfield or getstatic instruction.voidvisit(GotoInstruction instr)Visits a goto or goto_w instruction.voidvisit(I2LInstruction instr)Visits an i2l instruction.voidvisit(IALoadInstruction instr)Visits an iaload instruction.voidvisit(IAndInstruction instr)Visits an iand instruction.voidvisit(IAStoreInstruction instr)Visits an iastore instruction.voidvisit(IConstInstruction instr)Visits an iconst instruction.voidvisit(IIncInstruction instr)Visits an iinc instruction.voidvisit(ILoadInstruction instr)Visits an iload instruction.voidvisit(INegInstruction instr)Visits an ineg instruction.voidvisit(InstanceOfInstruction instr)Visits an instanceof instruction.voidvisit(InvokeDynamicInstruction instr)Visits an invokedynamic instruction.voidvisit(InvokeInterfaceInstruction instr)Visits an invokeinterface instruction.voidvisit(InvokeSpecialInstruction instr)Visits an invokespecial instruction.voidvisit(InvokeStaticInstruction instr)Visits an invokestatic instruction.voidvisit(InvokeVirtualInstruction instr)Visits an invokevirtual instruction.voidvisit(IOrInstruction instr)Visits an ior instruction.voidvisit(IStoreInstruction instr)Visits an istore instruction.voidvisit(IXorInstruction instr)Visits an ixor instruction.voidvisit(JsrInstruction instr)Visits a jsr instruction.voidvisit(LALoadInstruction instr)Visits an laload instruction.voidvisit(LAStoreInstruction instr)Visits an lastore instruction.voidvisit(LConstInstruction instr)Visits an lconst instruction.voidvisit(Ldc2WInstruction instr)Visits an ldc2_w instruction.voidvisit(LdcInstruction instr)Visits an ldc instruction.voidvisit(LdcWInstruction instr)Visits an ldc_w instruction.voidvisit(LLoadInstruction instr)Visits an lload instruction.voidvisit(LNegInstruction instr)Visits an lneg instruction.voidvisit(LookupSwitchInstruction instr)Visits a lookupswitch instruction.voidvisit(LorInstruction instr)Visits an lor instruction.voidvisit(LStoreInstruction instr)Visits an lstore instruction.voidvisit(LXorInstruction instr)Visits an lxor instruction.voidvisit(MethodReturnInstruction instr)Visits a return instruction (ireturn/lreturn/freturn/dreturn/areturn/return).voidvisit(MonitorEnterInstruction instr)Visits a monitorenter instruction.voidvisit(MonitorExitInstruction instr)Visits a monitorexit instruction.voidvisit(MultiANewArrayInstruction instr)Visits a multianewarray instruction.voidvisit(NarrowingConversionInstruction instr)Visits a narrowing conversion instruction (i2b/i2c/i2s).voidvisit(NewObjectInstruction instr)Visits a new instruction.voidvisit(NewPrimitiveArrayInstruction instr)Visits a newarray instruction.voidvisit(NopInstruction instr)Visits a nop instruction.voidvisit(Pop2Instruction instr)Visits a pop2 instruction.voidvisit(PopInstruction instr)Visits a pop instruction.voidvisit(PutFieldInstruction instr)Visits a putfield or putstatic instruction.voidvisit(RetInstruction instr)Visits a ret instruction.voidvisit(SALoadInstruction instr)Visits a saload instruction.voidvisit(SAStoreInstruction instr)Visits a sastore instruction.voidvisit(SipushInstruction instr)Visits a sipush instruction.voidvisit(SwapInstruction instr)Visits a swap instruction.voidvisit(TableSwitchInstruction instr)Visits a tableswitch instruction.voidvisit(UnknownInstruction instr)Visits an unrecognized or truncated instruction.voidvisit(WideIIncInstruction instr)Visits a wide iinc instruction.voidvisit(WideInstruction instr)Visits a wide-prefixed instruction.
-
-
-
Method Detail
-
process
public void process(MethodEntry method) throws IOException
Processes the given method by visiting its bytecode instructions.- Specified by:
processin interfaceVisitor<MethodEntry>- Parameters:
method- the method entry to process- Throws:
IOException- if an I/O error occurs during processing
-
visit
public void visit(NopInstruction instr)
Visits a nop instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(AConstNullInstruction instr)
Visits an aconst_null instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IConstInstruction instr)
Visits an iconst instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LConstInstruction instr)
Visits an lconst instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FConstInstruction instr)
Visits an fconst instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DConstInstruction instr)
Visits a dconst instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(BipushInstruction instr)
Visits a bipush instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(SipushInstruction instr)
Visits a sipush instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LdcInstruction instr)
Visits an ldc instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LdcWInstruction instr)
Visits an ldc_w instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(Ldc2WInstruction instr)
Visits an ldc2_w instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ILoadInstruction instr)
Visits an iload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LLoadInstruction instr)
Visits an lload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FLoadInstruction instr)
Visits an fload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DLoadInstruction instr)
Visits a dload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ALoadInstruction instr)
Visits an aload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IStoreInstruction instr)
Visits an istore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LStoreInstruction instr)
Visits an lstore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FStoreInstruction instr)
Visits an fstore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DStoreInstruction instr)
Visits a dstore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(AStoreInstruction instr)
Visits an astore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(PopInstruction instr)
Visits a pop instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(Pop2Instruction instr)
Visits a pop2 instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DupInstruction instr)
Visits a dup-family stack duplication instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(SwapInstruction instr)
Visits a swap instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ArithmeticInstruction instr)
Visits an arithmetic instruction (add/sub/mul/div/rem).- Parameters:
instr- the visited instruction
-
visit
public void visit(INegInstruction instr)
Visits an ineg instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LNegInstruction instr)
Visits an lneg instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FNegInstruction instr)
Visits an fneg instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DNegInstruction instr)
Visits a dneg instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ArithmeticShiftInstruction instr)
Visits a shift instruction (ishl/ishr/iushr and long forms).- Parameters:
instr- the visited instruction
-
visit
public void visit(IAndInstruction instr)
Visits an iand instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IOrInstruction instr)
Visits an ior instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IXorInstruction instr)
Visits an ixor instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IIncInstruction instr)
Visits an iinc instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ConversionInstruction instr)
Visits a primitive conversion instruction (i2f, l2d, ...).- Parameters:
instr- the visited instruction
-
visit
public void visit(NarrowingConversionInstruction instr)
Visits a narrowing conversion instruction (i2b/i2c/i2s).- Parameters:
instr- the visited instruction
-
visit
public void visit(CompareInstruction instr)
Visits a compare instruction (lcmp/fcmpl/fcmpg/dcmpl/dcmpg).- Parameters:
instr- the visited instruction
-
visit
public void visit(ConditionalBranchInstruction instr)
Visits a conditional branch instruction (if_*).- Parameters:
instr- the visited instruction
-
visit
public void visit(GotoInstruction instr)
Visits a goto or goto_w instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(JsrInstruction instr)
Visits a jsr instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(RetInstruction instr)
Visits a ret instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InvokeVirtualInstruction instr)
Visits an invokevirtual instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InvokeSpecialInstruction instr)
Visits an invokespecial instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InvokeStaticInstruction instr)
Visits an invokestatic instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InvokeInterfaceInstruction instr)
Visits an invokeinterface instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InvokeDynamicInstruction instr)
Visits an invokedynamic instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(GetFieldInstruction instr)
Visits a getfield or getstatic instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(PutFieldInstruction instr)
Visits a putfield or putstatic instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(NewObjectInstruction instr)
Visits a new instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(NewPrimitiveArrayInstruction instr)
Visits a newarray instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ANewArrayInstruction instr)
Visits an anewarray instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ArrayLengthInstruction instr)
Visits an arraylength instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(ATHROWInstruction instr)
Visits an athrow instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(CheckCastInstruction instr)
Visits a checkcast instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(MultiANewArrayInstruction instr)
Visits a multianewarray instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LookupSwitchInstruction instr)
Visits a lookupswitch instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(TableSwitchInstruction instr)
Visits a tableswitch instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(WideInstruction instr)
Visits a wide-prefixed instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(MethodReturnInstruction instr)
Visits a return instruction (ireturn/lreturn/freturn/dreturn/areturn/return).- Parameters:
instr- the visited instruction
-
visit
public void visit(UnknownInstruction instr)
Visits an unrecognized or truncated instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(AALoadInstruction instr)
Visits an aaload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(AAStoreInstruction instr)
Visits an aastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(BALOADInstruction instr)
Visits a baload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(BAStoreInstruction instr)
Visits a bastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(CALoadInstruction instr)
Visits a caload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(CAStoreInstruction instr)
Visits a castore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(SALoadInstruction instr)
Visits a saload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DALoadInstruction instr)
Visits a daload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(DAStoreInstruction instr)
Visits a dastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FALoadInstruction instr)
Visits an faload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(FAStoreInstruction instr)
Visits an fastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IALoadInstruction instr)
Visits an iaload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(I2LInstruction instr)
Visits an i2l instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(IAStoreInstruction instr)
Visits an iastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(InstanceOfInstruction instr)
Visits an instanceof instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LALoadInstruction instr)
Visits an laload instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LAStoreInstruction instr)
Visits an lastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LorInstruction instr)
Visits an lor instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(LXorInstruction instr)
Visits an lxor instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(MonitorEnterInstruction instr)
Visits a monitorenter instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(MonitorExitInstruction instr)
Visits a monitorexit instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(SAStoreInstruction instr)
Visits a sastore instruction.- Parameters:
instr- the visited instruction
-
visit
public void visit(WideIIncInstruction instr)
Visits a wide iinc instruction.- Parameters:
instr- the visited instruction
-
-