Class InstructionUtil

java.lang.Object
proguard.classfile.instruction.InstructionUtil

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

    • InstructionUtil

      public InstructionUtil()
  • Method Details

    • 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:
    • 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.