RFR: 8320275: assert(_chunk->bitmap().at(index)) failed: Bit not set at index
Patricio Chilano Mateo
pchilanomate at openjdk.org
Thu Nov 30 00:53:12 UTC 2023
On Wed, 29 Nov 2023 03:21:07 GMT, Dean Long <dlong at openjdk.org> wrote:
>I don't really like the use of address for the pointer that might be either oop or narrowOop, because the bitmap can't really support an arbitrary char* address. I think it would be better to cleanup methods that take intptr_t* and instead use template <typename OopT> like bit_index_for.
>
The thing is that we would need to check before calling `clear_bitmap_bits()` if `UseCompressedOops` is set to use oop or narrowOop, which makes the code uglier in my opinion. This is a private method anyways and is not meant to be used outside this two callers in thaw code. But I added asserts in `clear_bitmap_bits()` to verify `start` and `end` have the expected alignment. I also added an is_aligned() assert in `stackChunkOopDesc::bit_index_for()` just for extra caution. While adding this last assert I actually realized I had a bug in my original experiment branch because I missed to align_down `end` when `UseCompressedOops` is not set, so thanks for pointing this out.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16837#issuecomment-1832929769
More information about the hotspot-dev
mailing list