Interface IRType

    • Method Detail

      • getDescriptor

        String getDescriptor()
        Returns:
        the JVM type descriptor for this type
      • getSize

        int getSize()
        Returns:
        the number of stack or local slots a value of this type occupies
      • isReference

        boolean isReference()
        Returns:
        true for object and array types
      • isPrimitive

        boolean isPrimitive()
        Returns:
        true for the eight primitive types
      • isVoid

        boolean isVoid()
        Returns:
        true for the void type
      • isArray

        boolean isArray()
        Returns:
        true for array types
      • isTwoSlot

        boolean isTwoSlot()
        Returns:
        true for long and double, which occupy two slots
      • fromDescriptor

        static IRType fromDescriptor​(String descriptor)
        Parses a JVM type descriptor.
        Parameters:
        descriptor - the descriptor to parse
        Returns:
        the matching type
        Throws:
        IllegalArgumentException - if the descriptor is empty, names no known type, or is an object descriptor with no terminating semicolon
      • fromInternalName

        static IRType fromInternalName​(String internalName)
        Builds a reference type from an internal class name, accepting an array descriptor as well since that is how array types appear in the constant pool.
        Parameters:
        internalName - a slash-separated class name, or an array descriptor
        Returns:
        the matching type