RFR: 8344445: MethodCounters don't need a vptr

Kim Barrett kbarrett at openjdk.org
Tue Nov 19 08:16:45 UTC 2024


On Mon, 18 Nov 2024 20:37:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This is a somewhat trivial change to make MethodCounters inherit from MetaspaceObj so that they don't have any virtual functions (and vptrs).  They're just a bunch of ints.
> 
> Tested with tier1-4.

Changes requested by kbarrett (Reviewer).

src/hotspot/share/oops/methodCounters.hpp line 66:

> 64:     return align_up((int)sizeof(MethodCounters), wordSize) / wordSize;
> 65:   }
> 66:   int size() const {

size() could be static (MetaspaceObj description allows this), with method_counters_size impl moved
here.  Then remove method_counters_size and update the two calls to MethodCounters::size().

-------------

PR Review: https://git.openjdk.org/jdk/pull/22220#pullrequestreview-2444650825
PR Review Comment: https://git.openjdk.org/jdk/pull/22220#discussion_r1847864553


More information about the hotspot-dev mailing list