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

Use byte offsets for vtable start and vtable length offsets

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b107

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: