Class Tracer

java.lang.Object
javassist.bytecode.stackmap.Tracer
All Implemented Interfaces:
TypeTag
Direct Known Subclasses:
MapMaker

public abstract class Tracer extends Object implements TypeTag
  • Field Details

    • classPool

      protected ClassPool classPool
    • cpool

      protected ConstPool cpool
    • returnType

      protected String returnType
    • stackTop

      protected int stackTop
    • stackTypes

      protected TypeData[] stackTypes
    • localsTypes

      protected TypeData[] localsTypes
  • Constructor Details

  • Method Details

    • doOpcode

      protected int doOpcode(int pos, byte[] code) throws BadBytecode
      Does abstract interpretation on the given bytecode instruction. It records whether or not a local variable (i.e. register) is accessed. If the instruction requires that a local variable or a stack element has a more specific type, this method updates the type of it.
      Parameters:
      pos - the position of the instruction.
      Returns:
      the size of the instruction at POS.
      Throws:
      BadBytecode
    • visitBranch

      protected void visitBranch(int pos, byte[] code, int offset) throws BadBytecode
      Throws:
      BadBytecode
    • visitGoto

      protected void visitGoto(int pos, byte[] code, int offset) throws BadBytecode
      Throws:
      BadBytecode
    • visitReturn

      protected void visitReturn(int pos, byte[] code) throws BadBytecode
      Throws:
      BadBytecode
    • visitThrow

      protected void visitThrow(int pos, byte[] code) throws BadBytecode
      Throws:
      BadBytecode
    • visitTableSwitch

      protected void visitTableSwitch(int pos, byte[] code, int n, int offsetPos, int defaultOffset) throws BadBytecode
      Parameters:
      pos - the position of TABLESWITCH
      code - bytecode
      n - the number of case labels
      offsetPos - the position of the branch-target table.
      defaultOffset - the offset to the default branch target.
      Throws:
      BadBytecode
    • visitLookupSwitch

      protected void visitLookupSwitch(int pos, byte[] code, int n, int pairsPos, int defaultOffset) throws BadBytecode
      Parameters:
      pos - the position of LOOKUPSWITCH
      code - bytecode
      n - the number of case labels
      pairsPos - the position of the table of pairs of a value and a branch target.
      defaultOffset - the offset to the default branch target.
      Throws:
      BadBytecode
    • visitJSR

      protected void visitJSR(int pos, byte[] code) throws BadBytecode
      Invoked when the visited instruction is jsr. Java6 or later does not allow using RET.
      Throws:
      BadBytecode
    • visitRET

      protected void visitRET(int pos, byte[] code) throws BadBytecode
      Invoked when the visited instruction is ret or wide ret. Java6 or later does not allow using RET.
      Throws:
      BadBytecode
    • doOpcode0_53

      private int doOpcode0_53(int pos, byte[] code, int op) throws BadBytecode
      Throws:
      BadBytecode
    • doLDC

      private void doLDC(int index)
    • doXLOAD

      private int doXLOAD(TypeData type, byte[] code, int pos)
    • doXLOAD

      private int doXLOAD(int localVar, TypeData type)
    • doALOAD

      private int doALOAD(int localVar)
    • doOpcode54_95

      private int doOpcode54_95(int pos, byte[] code, int op) throws BadBytecode
      Throws:
      BadBytecode
    • doXSTORE

      private int doXSTORE(int pos, byte[] code, TypeData type)
    • doXSTORE

      private int doXSTORE(int index, TypeData type)
    • doASTORE

      private int doASTORE(int index)
    • doDUP_XX

      private void doDUP_XX(int delta, int len)
    • doOpcode96_147

      private int doOpcode96_147(int pos, byte[] code, int op)
    • doOpcode148_201

      private int doOpcode148_201(int pos, byte[] code, int op) throws BadBytecode
      Throws:
      BadBytecode
    • doWIDE

      private int doWIDE(int pos, byte[] code) throws BadBytecode
      Throws:
      BadBytecode
    • doWIDE_XLOAD

      private void doWIDE_XLOAD(int pos, byte[] code, TypeData type)
    • doWIDE_STORE

      private void doWIDE_STORE(int pos, byte[] code, TypeData type)
    • doPutField

      private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode
      Throws:
      BadBytecode
    • doGetField

      private int doGetField(int pos, byte[] code, boolean notStatic) throws BadBytecode
      Throws:
      BadBytecode
    • setFieldTarget

      private void setFieldTarget(boolean notStatic, int index) throws BadBytecode
      Throws:
      BadBytecode
    • doNEWARRAY

      private int doNEWARRAY(int pos, byte[] code)
    • doMultiANewArray

      private int doMultiANewArray(int pos, byte[] code)
    • doInvokeMethod

      private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode
      Throws:
      BadBytecode
    • constructorCalled

      private void constructorCalled(TypeData target, int offset)
    • doInvokeIntfMethod

      private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode
      Throws:
      BadBytecode
    • doInvokeDynamic

      private int doInvokeDynamic(int pos, byte[] code) throws BadBytecode
      Throws:
      BadBytecode
    • pushMemberType

      private void pushMemberType(String descriptor)
    • getFieldClassName

      private static String getFieldClassName(String desc, int index)
    • checkParamTypes

      private void checkParamTypes(String desc, int i) throws BadBytecode
      Throws:
      BadBytecode