RFR: 8358339: Handle MethodCounters::_method backlinks after JDK-8355003

Aleksey Shipilev shade at openjdk.org
Tue Jun 3 12:19:53 UTC 2025


On Tue, 3 Jun 2025 11:58:29 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>  I don't think this is the right thing to do, since the Method* is already handled in finalize_oop_references since it's a backpointer.

Sorry, I don't understand this comment. I think there is a symmetry between `MethodCounters` and `MethodData`. Now that `MethodCounters` have the backpointer to `Method*`, like `MethodData`, it should be handled like `MethodData` everywhere?

> And MethodCounters shouldn't be inhertited from Metadata, they're inherited from MetaspaceObj in mainline. We want to avoid virtual function pointers in this type.

Are you, perhaps, looking at older mainline? Because in current mainline `MethodCounters` is inherited from `Metadata`:
https://github.com/openjdk/jdk/blob/78a392aa3b0cda52cfacfa15250fa61010519424/src/hotspot/share/oops/methodCounters.hpp#L35 -- this was also part of [JDK-8355003](https://bugs.openjdk.org/browse/JDK-8355003).

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

PR Comment: https://git.openjdk.org/jdk/pull/25599#issuecomment-2934965605


More information about the hotspot-dev mailing list