8296231: Fix MEMFLAGS for CHeapBitMaps
Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
bd729e6906
commit
8ee0f7d598
@ -58,7 +58,7 @@ ArchiveBuilder::OtherROAllocMark::~OtherROAllocMark() {
|
||||
ArchiveBuilder::alloc_stats()->record_other_type(int(newtop - _oldtop), true);
|
||||
}
|
||||
|
||||
ArchiveBuilder::SourceObjList::SourceObjList() : _ptrmap(16 * K) {
|
||||
ArchiveBuilder::SourceObjList::SourceObjList() : _ptrmap(16 * K, mtClassShared) {
|
||||
_total_bytes = 0;
|
||||
_objs = new (ResourceObj::C_HEAP, mtClassShared) GrowableArray<SourceObjInfo*>(128 * K, mtClassShared);
|
||||
}
|
||||
@ -155,6 +155,7 @@ ArchiveBuilder::ArchiveBuilder() :
|
||||
_buffer_to_requested_delta(0),
|
||||
_rw_region("rw", MAX_SHARED_DELTA),
|
||||
_ro_region("ro", MAX_SHARED_DELTA),
|
||||
_ptrmap(mtClassShared),
|
||||
_rw_src_objs(),
|
||||
_ro_src_objs(),
|
||||
_src_obj_table(INITIAL_TABLE_SIZE, MAX_TABLE_SIZE),
|
||||
|
@ -50,6 +50,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
G1YoungGCEvacFailureInjector::G1YoungGCEvacFailureInjector()
|
||||
: _inject_evacuation_failure_for_current_gc(),
|
||||
_last_collection_with_evacuation_failure(),
|
||||
_evac_failure_regions(mtGC) {}
|
||||
|
||||
void G1YoungGCEvacFailureInjector::select_evac_failure_regions() {
|
||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||
_evac_failure_regions.reinitialize(g1h->max_reserved_regions());
|
||||
|
@ -69,6 +69,8 @@ class G1YoungGCEvacFailureInjector {
|
||||
void select_evac_failure_regions() EVAC_FAILURE_INJECTOR_RETURN;
|
||||
public:
|
||||
|
||||
G1YoungGCEvacFailureInjector() EVAC_FAILURE_INJECTOR_RETURN;
|
||||
|
||||
// Arm the evacuation failure injector if needed for the current
|
||||
// GC (based upon the type of GC and which command line flags are set);
|
||||
void arm_if_needed() EVAC_FAILURE_INJECTOR_RETURN;
|
||||
|
@ -34,7 +34,7 @@
|
||||
namespace metaspace {
|
||||
|
||||
CommitMask::CommitMask(const MetaWord* start, size_t word_size) :
|
||||
CHeapBitMap(mask_size(word_size, Settings::commit_granule_words())),
|
||||
CHeapBitMap(mask_size(word_size, Settings::commit_granule_words()), mtMetaspace, true),
|
||||
_base(start),
|
||||
_word_size(word_size),
|
||||
_words_per_bit(Settings::commit_granule_words())
|
||||
|
@ -113,24 +113,29 @@ class BitMapTest {
|
||||
#endif
|
||||
};
|
||||
|
||||
class TestCHeapBitMap : public CHeapBitMap {
|
||||
public:
|
||||
TestCHeapBitMap(size_t size = 0) : CHeapBitMap(size, mtTest) {}
|
||||
};
|
||||
|
||||
TEST_VM(BitMap, resize_grow) {
|
||||
BitMapTest::testResizeGrow<ResourceBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type ResourceBitMap";
|
||||
BitMapTest::testResizeGrow<CHeapBitMap>();
|
||||
BitMapTest::testResizeGrow<TestCHeapBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type CHeapBitMap";
|
||||
}
|
||||
|
||||
TEST_VM(BitMap, resize_shrink) {
|
||||
BitMapTest::testResizeShrink<ResourceBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type ResourceBitMap";
|
||||
BitMapTest::testResizeShrink<CHeapBitMap>();
|
||||
BitMapTest::testResizeShrink<TestCHeapBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type CHeapBitMap";
|
||||
}
|
||||
|
||||
TEST_VM(BitMap, resize_same) {
|
||||
BitMapTest::testResizeSame<ResourceBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type ResourceBitMap";
|
||||
BitMapTest::testResizeSame<CHeapBitMap>();
|
||||
BitMapTest::testResizeSame<TestCHeapBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type CHeapBitMap";
|
||||
}
|
||||
|
||||
@ -155,7 +160,7 @@ TEST_VM(BitMap, resize_grow_clear) {
|
||||
TEST_VM(BitMap, initialize) {
|
||||
BitMapTest::testInitialize<ResourceBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type ResourceBitMap";
|
||||
BitMapTest::testInitialize<CHeapBitMap>();
|
||||
BitMapTest::testInitialize<TestCHeapBitMap>();
|
||||
EXPECT_FALSE(HasFailure()) << "Failed on type CHeapBitMap";
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ static void verify_unset(CHeapBitMap& map, BitMap::idx_t l, BitMap::idx_t r) {
|
||||
}
|
||||
|
||||
TEST(BitMap, clear_large_range) {
|
||||
CHeapBitMap map(BITMAP_SIZE);
|
||||
CHeapBitMap map(BITMAP_SIZE, mtTest);
|
||||
|
||||
map.set_range(0, BITMAP_SIZE);
|
||||
verify_set(map, 0, BITMAP_SIZE);
|
||||
@ -70,7 +70,7 @@ TEST(BitMap, clear_large_range) {
|
||||
}
|
||||
|
||||
TEST(BitMap, set_large_range) {
|
||||
CHeapBitMap map(BITMAP_SIZE);
|
||||
CHeapBitMap map(BITMAP_SIZE, mtTest);
|
||||
|
||||
map.clear();
|
||||
verify_unset(map, 0, BITMAP_SIZE);
|
||||
@ -94,7 +94,7 @@ TEST(BitMap, set_large_range) {
|
||||
}
|
||||
|
||||
TEST(BitMap, par_at_put_large_range) {
|
||||
CHeapBitMap map(BITMAP_SIZE);
|
||||
CHeapBitMap map(BITMAP_SIZE, mtTest);
|
||||
|
||||
map.clear();
|
||||
verify_unset(map, 0, BITMAP_SIZE);
|
||||
|
@ -102,7 +102,7 @@ static void set_or_clear_random_range(BitMap& bm, SimpleFakeBitmap& fbm, int beg
|
||||
}
|
||||
|
||||
static void test_bitmap_popcnt(int bitsize) {
|
||||
CHeapBitMap bm(bitsize);
|
||||
CHeapBitMap bm(bitsize, mtTest);
|
||||
SimpleFakeBitmap fbm(bitsize);
|
||||
|
||||
ASSERT_POPCNT_ALL(bm, 0);
|
||||
@ -148,7 +148,7 @@ TEST_VM(BitMap, popcnt_300) { test_bitmap_popcnt(300); }
|
||||
|
||||
TEST_VM(BitMap, popcnt_large) {
|
||||
|
||||
CHeapBitMap bm(64 * K);
|
||||
CHeapBitMap bm(64 * K, mtTest);
|
||||
|
||||
ASSERT_POPCNT_ALL(bm, 0);
|
||||
ASSERT_POPCNT_RANGE(bm, 0, 64 * K, 0);
|
||||
@ -169,4 +169,3 @@ TEST_VM(BitMap, popcnt_large) {
|
||||
ASSERT_POPCNT_RANGE(bm, 199, 299, 100);
|
||||
|
||||
}
|
||||
|
||||
|
@ -195,8 +195,8 @@ static void test_search_ranges(BitMap& test_ones,
|
||||
}
|
||||
|
||||
TEST(BitMap, search) {
|
||||
CHeapBitMap test_ones(BITMAP_SIZE);
|
||||
CHeapBitMap test_zeros(BITMAP_SIZE);
|
||||
CHeapBitMap test_ones(BITMAP_SIZE, mtTest);
|
||||
CHeapBitMap test_zeros(BITMAP_SIZE, mtTest);
|
||||
|
||||
// test_ones is used to test searching for 1s in a region of 0s.
|
||||
// test_zeros is used to test searching for 0s in a region of 1s.
|
||||
|
Loading…
Reference in New Issue
Block a user