RFR: 8213415: BitMap::word_index_round_up overflow problems
Kim Barrett
kim.barrett at oracle.com
Tue May 28 18:10:22 UTC 2019
Please review this change to BitMap index alignment to check for
overflows (in debug builds). Also made a few related API cleanups.
Constructing a BitMap now ensures the size is such that rounding it up
to a word boundary won't overflow. This is the new max_size_in_bits()
value. This lets us add some asserts and otherwise tidy things up in
some places by making use of that information.
This engendered some changes to ParallelGC's ParMarkBitMap. It no
longer uses the obsolete BitMap::word_align_up, instead having its own
internal helper for aligning range ends that knows about invariants in
ParMarkBitMap.
Removed the following static functions from BitMap: word_align_up,
word_align_down, and is_word_aligned. word_align_up is no longer
used, after the ParMarkBitMap changes. The others were only used in a
small number of places in tests and asserts, and didn't seem worth
keeping instead of just using align.hpp stuff with BitsPerWord
alignment value.
CR:
https://bugs.openjdk.java.net/browse/JDK-8213415
Webrev:
http://cr.openjdk.java.net/~kbarrett/8213415/open.00/
Testing:
mach5 tier1-3
More information about the hotspot-dev
mailing list