RFR: 8308088: Improve class check in CollectedHeap::is_oop [v3]

Thomas Stuefe stuefe at openjdk.org
Tue May 16 13:31:51 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

include memory/metaspace.hpp is missing.

Otherwise LGTM

> 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: [b8868da](https://github.com/openjdk/jdk/commit/b8868dac39e43c8bea6ccd34d8e5b186506415fe)

Update: looks like I was mistaken about the first point. The rest is probably not worth optimizing. Never mind then, this looks good as it is.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13982#pullrequestreview-1428588598
PR Comment: https://git.openjdk.org/jdk/pull/13982#issuecomment-1549677508


More information about the hotspot-gc-dev mailing list