bitMap.inline.hpp revision 3110
3110N/A * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 809N/A // Note that [0,0) and [size,size) are both valid ranges. 0N/A return false;
// Someone else beat us to it. 0N/A return true;
// Success. 0N/A return false;
// Someone else beat us to it. 0N/A return true;
// Success. 0N/A // check bits including and to the _left_ of offset's position 0N/A // find the position of the 1-bit 3110N/A // In the following assert, if r_offset is not bitamp word aligned, 3110N/A // checking that res_offset is strictly less than r_offset is too 3110N/A // strong and will trip the assert. 3110N/A // Consider the case where l_offset is bit 15 and r_offset is bit 17 3110N/A // of the same map word, and where bits [15:16:17:18] == [00:00:00:01]. 3110N/A // All the bits in the range [l_offset:r_offset) are 0. 3110N/A // The loop that calculates res_offset, above, would yield the offset 3110N/A // of bit 18 because it's in the same map word as l_offset and there 3110N/A // is a set bit in that map word above l_offset (i.e. res != NoBits). 3110N/A // In this case, however, we can assert is that res_offset is strictly 3110N/A // less than size() since we know that there is at least one set bit 3110N/A // at an offset above, but in the same map word as, r_offset. 3110N/A // Otherwise, if r_offset is word aligned then it will not be in the 3110N/A // same map word as l_offset (unless it equals l_offset). So either 3110N/A // there won't be a set bit between l_offset and the end of it's map 3110N/A // word (i.e. res == NoBits), or res_offset will be less than r_offset. 0N/A // skip over all word length 0-bit runs 0N/A // found a 1, return the offset 342N/A // check bits including and to the _left_ of offset's position 342N/A // find the position of the 0-bit 342N/A // skip over all word length 1-bit runs 342N/A // found a 0, return the offset 342N/A // check bits including and to the _left_ of offset's position 342N/A // find the position of the 1-bit 342N/A // skip over all word length 0-bit runs 342N/A // found a 1, return the offset 342N/A// Returns a bit mask for a range of bits [beg, end) within a single word. Each 342N/A// bit in the mask is 0 if the bit is in the range, 1 if not in the range. The 342N/A// returned mask can be used directly to clear the range, or inverted to set the 342N/A// range. Note: end must not be 0. 342N/A "must be a single-word range");
342N/A // Check for integer arithmetic overflow. 1879N/A#
endif // SHARE_VM_UTILITIES_BITMAP_INLINE_HPP