Currently, both InstanceKlass and ArrayKlass have separate methods for storing the length of the vtable as an integer field. The vtable length is then accessed by a pure virtual accessor method on Klass.
Suggested fix is to move the _vtable_len field to Klass, taking into account the effect this might have on the size of InstanceKlass.
The related accessors for the vtable length and vtable start offsets should also be moved to Klass in order to maintain consistency.
The vtable start offset calculation is dependent on the size of InstanceKlass (or rather the maximum size of any subclass of Klass) since the vtable must start at the same offset for all Klass subclasses. The dependency on the InstanceKlass size forces the implementation of vtable_start_offset into klass.cpp, which already has a dependency on instanceKlass.hpp
Suggested fix is to move the _vtable_len field to Klass, taking into account the effect this might have on the size of InstanceKlass.
The related accessors for the vtable length and vtable start offsets should also be moved to Klass in order to maintain consistency.
The vtable start offset calculation is dependent on the size of InstanceKlass (or rather the maximum size of any subclass of Klass) since the vtable must start at the same offset for all Klass subclasses. The dependency on the InstanceKlass size forces the implementation of vtable_start_offset into klass.cpp, which already has a dependency on instanceKlass.hpp
- relates to
-
JDK-8147461 Use byte offsets for vtable start and vtable length offsets
-
- Resolved
-