Mercurial > hg > graal-compiler
diff src/share/vm/utilities/bitMap.inline.hpp @ 809:6e2afda171db
6849716: BitMap - performance regression introduced with G1
Summary: make verification code visible only in debug builds
Reviewed-by: iveresov, ysr, johnc, apetrusenko, tonyp
author | jcoomes |
---|---|
date | Thu, 11 Jun 2009 13:31:01 -0700 |
parents | 37f87013dfd8 |
children | bd02caa94611 |
line wrap: on
line diff
--- a/src/share/vm/utilities/bitMap.inline.hpp Sun Jun 07 22:08:24 2009 -0700 +++ b/src/share/vm/utilities/bitMap.inline.hpp Thu Jun 11 13:31:01 2009 -0700 @@ -22,6 +22,17 @@ * */ +#ifdef ASSERT +inline void BitMap::verify_index(idx_t index) const { + assert(index < _size, "BitMap index out of bounds"); +} + +inline void BitMap::verify_range(idx_t beg_index, idx_t end_index) const { + assert(beg_index <= end_index, "BitMap range error"); + // Note that [0,0) and [size,size) are both valid ranges. + if (end_index != _size) verify_index(end_index); +} +#endif // #ifdef ASSERT inline void BitMap::set_bit(idx_t bit) { verify_index(bit);