Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8147461

Use byte offsets for vtable start and vtable length offsets

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b107

      The field
      int InstanceKlass::_vtable_len
      is accessed through generated code by computing its offset in the InstanceKlass.
      This offset is currently scaled to wordSize, this is however problematic since an int field is not guaranteed to be at a wordSize aligned offset in 64 bit builds.

      All code generation locations which reference the offset of _vtable_len through its accessor InstanceKlass::vtable_length_offset apply scaling to convert it to a byte offset.
      Suggsted fix is therefore to convert the accessor to return a byte offset in the form of ByteSize.

      In addition to fixing the vtable_length_offset it seems like a good idea to fix the accessor for the vtable start offset.
      The vtable start offset is currently constructed to always be at a wordSize aligned location but to keep the accessors similar it should also be converted to return a byte offset in the form of ByteSize.

            mgerdin Mikael Gerdin (Inactive)
            mgerdin Mikael Gerdin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: