Class DismantleBytecode

    • Field Detail

      • opcode

        private int opcode
      • opcodeIsWide

        private boolean opcodeIsWide
      • PC

        private int PC
      • nextPC

        private int nextPC
      • branchOffset

        private int branchOffset
      • branchTarget

        private int branchTarget
      • branchFallThrough

        private int branchFallThrough
      • switchOffsets

        private int[] switchOffsets
      • switchLabels

        private int[] switchLabels
      • prevOpcode

        private final int[] prevOpcode
      • currentPosInPrevOpcodeBuffer

        private int currentPosInPrevOpcodeBuffer
      • sizePrevOpcodeBuffer

        private int sizePrevOpcodeBuffer
      • defaultSwitchOffset

        private int defaultSwitchOffset
      • classConstantOperand

        @SlashedClassName
        private java.lang.String classConstantOperand
      • referencedXClass

        private XClass referencedXClass
      • referencedXMethod

        private XMethod referencedXMethod
      • referencedXField

        private XField referencedXField
      • dottedClassConstantOperand

        private java.lang.String dottedClassConstantOperand
      • nameConstantOperand

        private java.lang.String nameConstantOperand
      • sigConstantOperand

        private java.lang.String sigConstantOperand
      • stringConstantOperand

        private java.lang.String stringConstantOperand
      • refConstantOperand

        private java.lang.String refConstantOperand
      • refFieldIsStatic

        private boolean refFieldIsStatic
      • constantRefOperand

        private org.apache.bcel.classfile.Constant constantRefOperand
      • intConstant

        private int intConstant
      • longConstant

        private long longConstant
      • floatConstant

        private float floatConstant
      • doubleConstant

        private double doubleConstant
      • registerOperand

        private int registerOperand
      • isRegisterLoad

        private boolean isRegisterLoad
      • isRegisterStore

        private boolean isRegisterStore
      • MEANING_OF_OPERANDS

        static final byte[][] MEANING_OF_OPERANDS
        Meaning of bytecode operands
      • codeBytes

        protected byte[] codeBytes
      • lineNumberTable

        protected org.apache.bcel.classfile.LineNumberTable lineNumberTable
      • formatter

        private static java.text.NumberFormat formatter
    • Constructor Detail

      • DismantleBytecode

        public DismantleBytecode()
    • Method Detail

      • replaceSlashesWithDots

        static java.lang.String replaceSlashesWithDots​(java.lang.String c)
      • getClassDescriptorOperand

        public ClassDescriptor getClassDescriptorOperand()
      • getXClassOperand

        @CheckForNull
        public XClass getXClassOperand()
      • isMethodCall

        public boolean isMethodCall()
      • getMethodDescriptorOperand

        public MethodDescriptor getMethodDescriptorOperand()
      • getXMethodOperand

        @CheckForNull
        public XMethod getXMethodOperand()
      • getFieldDescriptorOperand

        public FieldDescriptor getFieldDescriptorOperand()
      • getXFieldOperand

        @CheckForNull
        public XField getXFieldOperand()
      • getDottedClassConstantOperand

        public java.lang.String getDottedClassConstantOperand()
        If the current opcode has a class operand, get the associated class constant, dot-formatted
      • getRefConstantOperand

        @Deprecated
        public java.lang.String getRefConstantOperand()
        Deprecated.
        If the current opcode has a reference constant operand, get its string representation
      • getNameConstantOperand

        public java.lang.String getNameConstantOperand()
        If the current opcode has a reference constant operand, get its name
      • getSigConstantOperand

        public java.lang.String getSigConstantOperand()
        If the current opcode has a reference constant operand, get its signature, slash-formatted
      • getClassConstantOperand

        @SlashedClassName
        public java.lang.String getClassConstantOperand()
        If the current opcode has a class constant operand, get the classname, slash-formatted.
      • getStringConstantOperand

        public java.lang.String getStringConstantOperand()
        If the current opcode has a string constant operand, get its name
      • getConstantRefOperand

        public org.apache.bcel.classfile.Constant getConstantRefOperand()
      • isRegisterLoad

        public boolean isRegisterLoad()
      • isRegisterStore

        public boolean isRegisterStore()
      • getRegisterOperand

        public int getRegisterOperand()
      • getIntConstant

        public int getIntConstant()
      • getLongConstant

        public long getLongConstant()
      • getBranchOffset

        public int getBranchOffset()
      • getBranchTarget

        public int getBranchTarget()
      • getBranchFallThrough

        public int getBranchFallThrough()
      • getDefaultSwitchOffset

        public int getDefaultSwitchOffset()
      • getRefFieldIsStatic

        public boolean getRefFieldIsStatic()
      • getPC

        public int getPC()
      • getPrevOpcode

        public int getPrevOpcode​(int offset)
        return previous opcode;
        Parameters:
        offset - 0 for current opcode, 1 for one before that, etc.
      • isWideOpcode

        public boolean isWideOpcode()
      • isBranch

        public static boolean isBranch​(int opcode)
        Return whether or not given opcode is a branch instruction.
        Parameters:
        opcode - the opcode
        Returns:
        true if instruction is a branch, false if not
      • isSwitch

        public static boolean isSwitch​(int opcode)
        Return whether or not given opcode is a switch instruction.
        Parameters:
        opcode - the opcode
        Returns:
        true if instruction is a switch, false if not
      • getSwitchOffsets

        public int[] getSwitchOffsets()
      • getSwitchLabels

        public int[] getSwitchLabels()
      • resetState

        private void resetState()
      • sortByOffset

        private static void sortByOffset​(int[] switchOffsets,
                                         int[] switchLabels)
      • getMaxPC

        public int getMaxPC()
      • getCodeByte

        public int getCodeByte​(int offset)
      • getOpcode

        public int getOpcode()
      • atCatchBlock

        public boolean atCatchBlock()
      • visit

        public void visit​(org.apache.bcel.classfile.Code obj)
        Overrides:
        visit in class BetterVisitor
      • sawDouble

        public void sawDouble​(double seen)
      • sawFloat

        public void sawFloat​(float seen)
      • sawRegister

        public void sawRegister​(int r)
      • sawInt

        public void sawInt​(int seen)
      • sawLong

        public void sawLong​(long seen)
      • sawBranchTo

        public void sawBranchTo​(int targetPC)
      • beforeOpcode

        public boolean beforeOpcode​(int seen)
        return false if we should skip calling sawOpcode
      • afterOpcode

        public void afterOpcode​(int seen)
      • sawOpcode

        public void sawOpcode​(int seen)
      • sawString

        public void sawString​(java.lang.String seen)
      • sawField

        public void sawField()
      • sawMethod

        public void sawMethod()
      • sawIMethod

        public void sawIMethod()
      • sawClass

        public void sawClass()
      • printOpCode

        public void printOpCode​(int seen)
      • getNextPC

        public int getNextPC()
        Returns:
        Returns the nextPC.
      • getNextOpcode

        public int getNextOpcode()
      • getNextCodeByte

        public int getNextCodeByte​(int offset)
      • isReturn

        public boolean isReturn​(int opcode)
      • isShift

        public boolean isShift​(int opcode)
      • areOppositeBranches

        public static boolean areOppositeBranches​(int opcode1,
                                                  int opcode2)
      • isRegisterStore

        public boolean isRegisterStore​(int opcode)
      • setReferencedXClass

        private void setReferencedXClass​(XClass referencedXClass)
        Parameters:
        referencedXClass - The referencedXClass to set.
      • getReferencedXClass

        private XClass getReferencedXClass()
        Returns:
        Returns the referencedXClass.