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.
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.
- relates to
-
JDK-8148047 Move the vtable length field to Klass
-
- Resolved
-