8156207: Resource allocated BitMaps are often cleared unnecessarily

Removed unnecessary clearing of BitMap.

Reviewed-by: kbarrett, kvn, thartmann
This commit is contained in:
Christian Hagedorn 2019-07-29 09:40:02 +02:00 committed by Tobias Hartmann
parent b2a9f90a94
commit 3135a96dc0
3 changed files with 6 additions and 6 deletions

View File

@ -830,8 +830,8 @@ MethodLivenessResult MethodLiveness::BasicBlock::get_liveness_at(ciMethod* metho
#ifdef ASSERT
ResourceMark rm;
ResourceBitMap g(_gen.size()); g.set_from(_gen);
ResourceBitMap k(_kill.size()); k.set_from(_kill);
ResourceBitMap g(_gen.size(), false); g.set_from(_gen);
ResourceBitMap k(_kill.size(), false); k.set_from(_kill);
#endif
if (_last_bci != bci || trueInDebug) {
ciBytecodeStream bytes(method);

View File

@ -133,8 +133,8 @@ void BitMap::reinitialize(const Allocator& allocator, idx_t new_size_in_bits, bo
initialize(allocator, new_size_in_bits, clear);
}
ResourceBitMap::ResourceBitMap(idx_t size_in_bits)
: BitMap(allocate(ResourceBitMapAllocator(), size_in_bits), size_in_bits) {
ResourceBitMap::ResourceBitMap(idx_t size_in_bits, bool clear)
: BitMap(allocate(ResourceBitMapAllocator(), size_in_bits, clear), size_in_bits) {
}
void ResourceBitMap::resize(idx_t new_size_in_bits) {

View File

@ -329,8 +329,8 @@ class ResourceBitMap : public BitMap {
public:
ResourceBitMap() : BitMap(NULL, 0) {}
// Clears the bitmap memory.
ResourceBitMap(idx_t size_in_bits);
// Conditionally clears the bitmap memory.
ResourceBitMap(idx_t size_in_bits, bool clear = true);
// Resize the backing bitmap memory.
//