159 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
159 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
160 ) |
160 ) |
161 } |
161 } |
162 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
162 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
163 } |
163 } |
|
164 |
|
165 _used_stable = 0; |
164 } |
166 } |
165 |
167 |
166 // Like CompactibleSpace forward() but always calls cross_threshold() to |
168 // Like CompactibleSpace forward() but always calls cross_threshold() to |
167 // update the block offset table. Removed initialize_threshold call because |
169 // update the block offset table. Removed initialize_threshold call because |
168 // CFLS does not use a block offset array for contiguous spaces. |
170 // CFLS does not use a block offset array for contiguous spaces. |
373 return fc->is_free(); |
375 return fc->is_free(); |
374 } |
376 } |
375 |
377 |
376 size_t CompactibleFreeListSpace::used() const { |
378 size_t CompactibleFreeListSpace::used() const { |
377 return capacity() - free(); |
379 return capacity() - free(); |
|
380 } |
|
381 |
|
382 size_t CompactibleFreeListSpace::used_stable() const { |
|
383 return _used_stable; |
|
384 } |
|
385 |
|
386 void CompactibleFreeListSpace::recalculate_used_stable() { |
|
387 _used_stable = used(); |
378 } |
388 } |
379 |
389 |
380 size_t CompactibleFreeListSpace::free() const { |
390 size_t CompactibleFreeListSpace::free() const { |
381 // "MT-safe, but not MT-precise"(TM), if you will: i.e. |
391 // "MT-safe, but not MT-precise"(TM), if you will: i.e. |
382 // if you do this while the structures are in flux you |
392 // if you do this while the structures are in flux you |
1214 // be a single block, but not one which is unallocated. |
1224 // be a single block, but not one which is unallocated. |
1215 _bt.verify_single_block(res, size); |
1225 _bt.verify_single_block(res, size); |
1216 _bt.verify_not_unallocated(res, size); |
1226 _bt.verify_not_unallocated(res, size); |
1217 // mangle a just allocated object with a distinct pattern. |
1227 // mangle a just allocated object with a distinct pattern. |
1218 debug_only(fc->mangleAllocated(size)); |
1228 debug_only(fc->mangleAllocated(size)); |
|
1229 } |
|
1230 |
|
1231 // During GC we do not need to recalculate the stable used value for |
|
1232 // every allocation in old gen. It is done once at the end of GC instead |
|
1233 // for performance reasons. |
|
1234 if (!Universe::heap()->is_gc_active()) { |
|
1235 recalculate_used_stable(); |
1219 } |
1236 } |
1220 |
1237 |
1221 return res; |
1238 return res; |
1222 } |
1239 } |
1223 |
1240 |