RFR: 8329655: Cleanup KlassObj and klassOop names after the PermGen removal [v2]
Stefan Karlsson
stefank at openjdk.org
Thu Apr 4 12:18:24 UTC 2024
> 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.
Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
Review Roman
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18618/files
- new: https://git.openjdk.org/jdk/pull/18618/files/02bcbd89..85f6bbe6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18618&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18618&range=00-01
Stats: 5 lines in 5 files changed: 0 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/18618.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18618/head:pull/18618
PR: https://git.openjdk.org/jdk/pull/18618
More information about the serviceability-dev
mailing list