3030#include " runtime/atomic.hpp"
3131
3232G1HotCardCache::G1HotCardCache (G1CollectedHeap *g1h):
33- _g1h(g1h), _use_cache( false ), _card_counts(g1h),
33+ _g1h(g1h), _card_counts(g1h),
3434 _hot_cache(NULL ), _hot_cache_size(0 ), _hot_cache_par_chunk_size(0 ),
3535 _hot_cache_idx(0 ), _hot_cache_par_claimed_idx(0 ), _cache_wrapped_around(false )
3636{}
3737
3838void G1HotCardCache::initialize (G1RegionToSpaceMapper* card_counts_storage) {
39- if (default_use_cache ()) {
40- _use_cache = true ;
41-
39+ if (use_cache ()) {
4240 _hot_cache_size = (size_t )1 << G1ConcRSLogCacheSize;
4341 _hot_cache = ArrayAllocator<CardValue*>::allocate (_hot_cache_size, mtGC);
4442
@@ -55,7 +53,7 @@ void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
5553}
5654
5755G1HotCardCache::~G1HotCardCache () {
58- if (default_use_cache ()) {
56+ if (use_cache ()) {
5957 assert (_hot_cache != NULL , " Logic" );
6058 ArrayAllocator<CardValue*>::free (_hot_cache, _hot_cache_size);
6159 _hot_cache = NULL ;
@@ -92,10 +90,9 @@ CardTable::CardValue* G1HotCardCache::insert(CardValue* card_ptr) {
9290}
9391
9492void G1HotCardCache::drain (G1CardTableEntryClosure* cl, uint worker_id) {
95- assert (default_use_cache (), " Drain only necessary if we use the hot card cache." );
93+ assert (use_cache (), " Drain only necessary if we use the hot card cache." );
9694
9795 assert (_hot_cache != NULL , " Logic" );
98- assert (!use_cache (), " cache should be disabled" );
9996
10097 while (_hot_cache_par_claimed_idx < _hot_cache_size) {
10198 size_t end_idx = Atomic::add (&_hot_cache_par_claimed_idx,
0 commit comments