RFR: 8308088: Improve class check in CollectedHeap::is_oop [v3]
Thomas Stuefe
stuefe at openjdk.org
Tue May 16 12:29:47 UTC 2023
On Tue, 16 May 2023 10:23:09 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> See the bug for more details.
>>
>> Additional testing:
>> - [x] Linux x86_64 fastdebug, `tier1`
>> - [x] Linux x86_64 fastdebug, `tier2`
>> - [x] Linux x86_64 fastdebug, `tier3`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Touchup
This can be improved:
- klass_raw() will, eventually, end up doing some asserts. We don't want that. So narrow Klass extraction needs to be done separately.
- then, we could weed out obvious bogus Klass values (not aligned or null)
- then, Metaspace::contains checks class space and non-class metaspace. The latter would be a false positive, and its also more expensive, since it walks the (usually short) list of metaspace regions. class space otoh is just one region. A correct check for Klass would be to check if its in CDS or in class space.
Proposal sketch:
https://github.com/openjdk/jdk/commit/b8868dac39e43c8bea6ccd34d8e5b186506415fe
-------------
Changes requested by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13982#pullrequestreview-1428461065
More information about the hotspot-gc-dev
mailing list