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