Module openj9.dtfj

Class VMConstantPool


  • public final class VMConstantPool
    extends Object
    VMConstant pool value retrieval. The constant pool is referenced by constants from com.ibm.j9ddr.vm29.structure.J9ConstantPool. To find out what type the value is, refer to oti/vmconstantpool.xml, or look into the generated header ./oti/j9vmconstantpool.h.
    • Constructor Detail

      • VMConstantPool

        public VMConstantPool()
    • Method Detail

      • getClass

        public static com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer getClass​(long index)
                                                                            throws CorruptDataException
        Get a class from the constant pool.
        Parameters:
        index - A J9VmconstantpoolConstants index into the constant pool. Must be for a class reference.
        Returns:
        Either the loaded class, or if its not in the constant pool, J9ClassPointer.NULL.
        Throws:
        CorruptDataException - If the CPShape of the index is not a class.
      • getFieldOffset

        public static J9ObjectFieldOffset getFieldOffset​(long index)
                                                  throws CorruptDataException
        Get a field offset from the constant pool.
        Parameters:
        index - A J9VmconstantpoolConstants index into the constant pool. Must be for a static or instance field reference.
        Returns:
        Either the offset to the object, or null if the field's class is not resolved in the constant pool.
        Throws:
        CorruptDataException - If the field cannot be found in the related class or the CP index is not a field reference.