On Thu, 4 Apr 2024 09:45:58 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

> We have a few places that uses the terms `KlassObj` and `klassOop` when 
> referring to Klasses. This is old code from before the PermGen removal, when 
> Klasses also were Java objects.
> 
> These names tripped me up when I was reading the heap heapInspection.cpp and 
> first though we were mixing the klass *mirror* objects and klass pointers in 
> the hash code calculation:
> 
>    // An aligned reference address (typically the least
>    // address in the perm gen) used for hashing klass
>    // objects.
>    HeapWord* _ref;
> ...
> _ref = (HeapWord*) Universe::boolArrayKlassObj();
> ...
> uint KlassInfoTable::hash(const Klass* p) {
>   return (uint)(((uintptr_t)p - (uintptr_t)_ref) >> 2);
> }
> 
> 
> I propose that we rename these functions (and stop casting the Klass* to a 
> (HeapWord*)).
> 
> Tested with serviceability/dcmd/gc/ClassHistogramTest.java but will run this 
> through our lower tiers.

This pull request has now been integrated.

Changeset: 71d48bcc
Author:    Stefan Karlsson <stef...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/71d48bcc3d6313ab4bd031b5e50ae3a16338abc8
Stats:     126 lines in 29 files changed: 0 ins; 2 del; 124 mod

8329655: Cleanup KlassObj and klassOop names after the PermGen removal

Reviewed-by: rkennke, coleenp

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

PR: https://git.openjdk.org/jdk/pull/18618

Reply via email to