8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
26 #define SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
27
28 #include "runtime/atomic.hpp"
29 #include "utilities/bitMap.hpp"
30
31 #ifdef ASSERT
32 inline void BitMap::verify_index(idx_t index) const {
33 assert(index < _size, "BitMap index out of bounds");
34 }
35
36 inline void BitMap::verify_range(idx_t beg_index, idx_t end_index) const {
37 assert(beg_index <= end_index, "BitMap range error");
38 // Note that [0,0) and [size,size) are both valid ranges.
39 if (end_index != _size) verify_index(end_index);
40 }
41 #endif // #ifdef ASSERT
42
43 inline void BitMap::set_bit(idx_t bit) {
44 verify_index(bit);
45 *word_addr(bit) |= bit_mask(bit);
46 }
47
48 inline void BitMap::clear_bit(idx_t bit) {
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
26 #define SHARE_VM_UTILITIES_BITMAP_INLINE_HPP
27
28 #include "runtime/atomic.inline.hpp"
29 #include "utilities/bitMap.hpp"
30
31 #ifdef ASSERT
32 inline void BitMap::verify_index(idx_t index) const {
33 assert(index < _size, "BitMap index out of bounds");
34 }
35
36 inline void BitMap::verify_range(idx_t beg_index, idx_t end_index) const {
37 assert(beg_index <= end_index, "BitMap range error");
38 // Note that [0,0) and [size,size) are both valid ranges.
39 if (end_index != _size) verify_index(end_index);
40 }
41 #endif // #ifdef ASSERT
42
43 inline void BitMap::set_bit(idx_t bit) {
44 verify_index(bit);
45 *word_addr(bit) |= bit_mask(bit);
46 }
47
48 inline void BitMap::clear_bit(idx_t bit) {
|