Class InstructionUtil


  • public class InstructionUtil
    extends java.lang.Object
    Utility methods for converting between representations of names and descriptions.
    • Constructor Summary

      Constructors 
      Constructor Description
      InstructionUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte arrayTypeFromInternalType​(char internalType)
      Returns the 'newarray' type constant for the given internal primitive type.
      static char internalTypeFromArrayType​(byte arrayType)
      Returns the internal type corresponding to the given 'newarray' type.
      static boolean isStaticCall​(byte opcode)
      Check if an instruction opcode refers to a static call (i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InstructionUtil

        public InstructionUtil()
    • Method Detail

      • internalTypeFromArrayType

        public static char internalTypeFromArrayType​(byte arrayType)
        Returns the internal type corresponding to the given 'newarray' type.
        Parameters:
        arrayType - Instruction.ARRAY_T_BOOLEAN, Instruction.ARRAY_T_BYTE , Instruction.ARRAY_T_CHAR, Instruction.ARRAY_T_SHORT, Instruction.ARRAY_T_INT, Instruction.ARRAY_T_LONG, Instruction.ARRAY_T_FLOAT, or Instruction.ARRAY_T_DOUBLE.
        Returns:
        TypeConstants.BOOLEAN, TypeConstants.BYTE, TypeConstants.CHAR, TypeConstants.SHORT, TypeConstants.INT , TypeConstants.LONG, TypeConstants.FLOAT, or TypeConstants.DOUBLE.
      • arrayTypeFromInternalType

        public static byte arrayTypeFromInternalType​(char internalType)
        Returns the 'newarray' type constant for the given internal primitive type.
        Parameters:
        internalType - a primitive type TypeConstants.BOOLEAN, TypeConstants.BYTE, TypeConstants.CHAR, TypeConstants.SHORT , TypeConstants.INT, TypeConstants.LONG, TypeConstants.FLOAT, or TypeConstants.DOUBLE.
        Returns:
        the array type constant corresponding to the given primitive type; TypeConstants.BOOLEAN, TypeConstants.BYTE, TypeConstants.CHAR , TypeConstants.SHORT, TypeConstants.INT, TypeConstants.LONG, TypeConstants.FLOAT, or TypeConstants.DOUBLE .
        See Also:
        internalTypeFromArrayType(byte)
      • isStaticCall

        public static boolean isStaticCall​(byte opcode)
        Check if an instruction opcode refers to a static call (i.e. no calling instance needed).
        Parameters:
        opcode - The instruction opcode to check
        Returns:
        False if this call requires a calling instance, true otherwise.