Module openj9.dtfj

Class ValueTypeHelper


  • public class ValueTypeHelper
    extends Object
    Value type helper class areValueTypesSupported() must return true before using any other methods in this class
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static Logger logger  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean areValueTypesSupported()
      Queries if the JVM that produced the core file supports value types.
      boolean classRequires4BytePrePadding​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if class is has 4byte pre-padding in the stand-alone case
      com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer findJ9ClassInFlattenedClassCacheWithFieldName​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz, String fieldName)
      Searches the flattenedClassCache (FCC) for a J9Class given a field name.
      com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer findJ9ClassInFlattenedClassCacheWithSigName​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz, String fieldSig)
      Searches the flattenedClassCache (FCC) for a J9Class given a field signature.
      com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer[] findNestedClassHierarchy​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer containerClazz, String[] nestingHierarchy)
      Returns an array of J9ClassPointers that contains the containerClazz passed in addition to the J9ClassPointers that correspond to the types of the field names passed in the nestingHierarchy array.
      static ValueTypeHelper getValueTypeHelper()
      Factory method that returns a valueTypeHelper instance.
      boolean isFieldInClassFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz, com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer fieldShape)
      Queries whether field is flattened of not.
      boolean isFlattenableFieldSignature​(String signature)
      Queries if field signature is flattenable
      boolean isJ9ClassAPrimitiveValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if J9Class is a primitive value type
      boolean isJ9ClassAValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if J9Class is a value type
      boolean isJ9ClassIsFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if class is flattened
      boolean isJ9ClassLargestAlignmentConstraintDouble​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if class contains a field with a double (64 bit) alignment constraint
      boolean isJ9ClassLargestAlignmentConstraintReference​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
      Queries if class contains a field with a reference alignment constraint
      boolean isJ9FieldIsFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer fieldClazz, com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer fieldShape)
      Queries if a field in a class is flattened
      boolean isRomClassAValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer romClass)
      Queries if J9ROMClass is a value type
    • Field Detail

      • logger

        protected static final Logger logger
    • Method Detail

      • getValueTypeHelper

        public static ValueTypeHelper getValueTypeHelper()
        Factory method that returns a valueTypeHelper instance.
        Returns:
        valueTypeHelper
      • areValueTypesSupported

        public boolean areValueTypesSupported()
        Queries if the JVM that produced the core file supports value types. This must be called before any other ValueTypeHelper functions are called.
        Returns:
        true if value types are supported, false otherwise
      • findJ9ClassInFlattenedClassCacheWithFieldName

        public com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer findJ9ClassInFlattenedClassCacheWithFieldName​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz,
                                                                                                                 String fieldName)
                                                                                                          throws CorruptDataException
        Searches the flattenedClassCache (FCC) for a J9Class given a field name. areValueTypesSupported() must return true before using this method.
        Parameters:
        clazz - J9Class pointer that owns the FCC to be searched
        fieldName - name of the field to lookup in the FCC
        Returns:
        J9Class of the fieldName if found, J9ClassPointer.NULL otherwise
        Throws:
        CorruptDataException
      • findNestedClassHierarchy

        public com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer[] findNestedClassHierarchy​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer containerClazz,
                                                                                              String[] nestingHierarchy)
                                                                                       throws CorruptDataException
        Returns an array of J9ClassPointers that contains the containerClazz passed in addition to the J9ClassPointers that correspond to the types of the field names passed in the nestingHierarchy array. Each subsequent field name in the nestingHierarchy array is a nested field of the previous element. For example nestingHierarchy[1] is a member of nestingHierarchy[0], and nestingHierarchy[2] is a member of nestingHierarchy[1]. nestingHierarchy[0] is the first nested member in the containerClazz. The resulting array contains at least one element (containerClazz). areValueTypesSupported() must return true before using this method.
        Parameters:
        containerClazz - type that contains all the nested members
        nestingHierarchy - array that contains field names for nested members. Must be non-NULL
        Returns:
        an array containing at least the containerClazz, and J9ClassPointer's corresponding to the names passed in the nestingHierarchy
        Throws:
        CorruptDataException
      • findJ9ClassInFlattenedClassCacheWithSigName

        public com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer findJ9ClassInFlattenedClassCacheWithSigName​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz,
                                                                                                               String fieldSig)
                                                                                                        throws CorruptDataException
        Searches the flattenedClassCache (FCC) for a J9Class given a field signature. areValueTypesSupported() must return true before using this method.
        Parameters:
        clazz - J9Class pointer that owns the FCC to be searched
        fieldSig - signature to lookup in the FCC
        Returns:
        J9ClassPointer corresponding to the signature if found, J9ClassPointer.NULL otherwise
        Throws:
        CorruptDataException
      • isRomClassAValueType

        public boolean isRomClassAValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer romClass)
                                     throws CorruptDataException
        Queries if J9ROMClass is a value type
        Parameters:
        romClass - clazz to query
        Returns:
        true if romClass is a value type, false otherwise
        Throws:
        CorruptDataException
      • isJ9ClassAValueType

        public boolean isJ9ClassAValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                    throws CorruptDataException
        Queries if J9Class is a value type
        Parameters:
        clazz - clazz to query
        Returns:
        true if class is a value type, false otherwise
        Throws:
        CorruptDataException
      • isJ9ClassAPrimitiveValueType

        public boolean isJ9ClassAPrimitiveValueType​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                             throws CorruptDataException
        Queries if J9Class is a primitive value type
        Parameters:
        clazz - clazz to query
        Returns:
        true if class is a primitive value type, false otherwise
        Throws:
        CorruptDataException
      • isFieldInClassFlattened

        public boolean isFieldInClassFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz,
                                               com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer fieldShape)
                                        throws CorruptDataException
        Queries whether field is flattened of not.
        Parameters:
        clazz - clazz containing the field
        fieldShape - J9ROMFieldShapePointer
        Returns:
        true if field is flattened, false otherwise
        Throws:
        CorruptDataException
      • isFlattenableFieldSignature

        public boolean isFlattenableFieldSignature​(String signature)
        Queries if field signature is flattenable
        Parameters:
        signature - field signature
        Returns:
        true if field signature is flattenable, false otherwise
      • isJ9ClassLargestAlignmentConstraintDouble

        public boolean isJ9ClassLargestAlignmentConstraintDouble​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                                          throws CorruptDataException
        Queries if class contains a field with a double (64 bit) alignment constraint
        Parameters:
        clazz - J9Class
        Returns:
        true if clazz has double alignment constraint, false otherwise
        Throws:
        CorruptDataException
      • isJ9ClassLargestAlignmentConstraintReference

        public boolean isJ9ClassLargestAlignmentConstraintReference​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                                             throws CorruptDataException
        Queries if class contains a field with a reference alignment constraint
        Parameters:
        clazz - J9Class
        Returns:
        true if clazz has reference alignment constraint, false otherwise
        Throws:
        CorruptDataException
      • isJ9ClassIsFlattened

        public boolean isJ9ClassIsFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                     throws CorruptDataException
        Queries if class is flattened
        Parameters:
        clazz - J9Class
        Returns:
        true if clazz is flattened, false otherwise
        Throws:
        CorruptDataException
      • isJ9FieldIsFlattened

        public boolean isJ9FieldIsFlattened​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer fieldClazz,
                                            com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer fieldShape)
                                     throws CorruptDataException
        Queries if a field in a class is flattened
        Parameters:
        fieldClazz - J9Class of the field
        fieldShape - J9ROMFieldShapePointer
        Returns:
        true if the field is flattened, false otherwise
        Throws:
        CorruptDataException
      • classRequires4BytePrePadding

        public boolean classRequires4BytePrePadding​(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer clazz)
                                             throws CorruptDataException
        Queries if class is has 4byte pre-padding in the stand-alone case
        Parameters:
        clazz - J9Class
        Returns:
        true if clazz is requires pre-padding, false otherwise
        Throws:
        CorruptDataException