RFR: 8344445: MethodCounters don't need a vptr [v2]
Coleen Phillimore
coleenp at openjdk.org
Tue Nov 19 12:23:08 UTC 2024
On Tue, 19 Nov 2024 08:07:39 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/share/oops/methodCounters.hpp line 61:
>>
>>> 59: void deallocate_contents(ClassLoaderData* loader_data) {}
>>> 60:
>>> 61: void metaspace_pointers_do(MetaspaceClosure* it) { return; }
>>
>> Does it change the behavior if we remove this along with
>> ` it->push(&_method_counters);`
>> in Method::metaspace_pointers_do?
>
> That would violate the contract for MetaspaceObj.
> https://github.com/openjdk/jdk/blob/499186be0fa70dba4b008cdafb72aba6addb2965/src/hotspot/share/memory/allocation.hpp#L247-L261
Yes it's a metaspace pointer. It's zeroed and not saved in the archive but it still needs to call this function in case it's not zeroed and someday called.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22220#discussion_r1848250136
More information about the hotspot-dev
mailing list