equal
deleted
inserted
replaced
370 DEBUG_ONLY( |
370 DEBUG_ONLY( |
371 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
371 _indexedFreeList[i].set_protecting_lock(_indexedFreeListParLocks[i]); |
372 ) |
372 ) |
373 } |
373 } |
374 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
374 _dictionary->set_par_lock(&_parDictionaryAllocLock); |
|
375 |
|
376 _used_stable = 0; |
375 } |
377 } |
376 |
378 |
377 // Like CompactibleSpace forward() but always calls cross_threshold() to |
379 // Like CompactibleSpace forward() but always calls cross_threshold() to |
378 // update the block offset table. Removed initialize_threshold call because |
380 // update the block offset table. Removed initialize_threshold call because |
379 // CFLS does not use a block offset array for contiguous spaces. |
381 // CFLS does not use a block offset array for contiguous spaces. |
573 return fc->is_free(); |
575 return fc->is_free(); |
574 } |
576 } |
575 |
577 |
576 size_t CompactibleFreeListSpace::used() const { |
578 size_t CompactibleFreeListSpace::used() const { |
577 return capacity() - free(); |
579 return capacity() - free(); |
|
580 } |
|
581 |
|
582 size_t CompactibleFreeListSpace::used_stable() const { |
|
583 return _used_stable; |
|
584 } |
|
585 |
|
586 void CompactibleFreeListSpace::recalculate_used_stable() { |
|
587 _used_stable = used(); |
578 } |
588 } |
579 |
589 |
580 size_t CompactibleFreeListSpace::free() const { |
590 size_t CompactibleFreeListSpace::free() const { |
581 // "MT-safe, but not MT-precise"(TM), if you will: i.e. |
591 // "MT-safe, but not MT-precise"(TM), if you will: i.e. |
582 // if you do this while the structures are in flux you |
592 // if you do this while the structures are in flux you |
1370 // be a single block, but not one which is unallocated. |
1380 // be a single block, but not one which is unallocated. |
1371 _bt.verify_single_block(res, size); |
1381 _bt.verify_single_block(res, size); |
1372 _bt.verify_not_unallocated(res, size); |
1382 _bt.verify_not_unallocated(res, size); |
1373 // mangle a just allocated object with a distinct pattern. |
1383 // mangle a just allocated object with a distinct pattern. |
1374 debug_only(fc->mangleAllocated(size)); |
1384 debug_only(fc->mangleAllocated(size)); |
|
1385 } |
|
1386 |
|
1387 // During GC we do not need to recalculate the stable used value for |
|
1388 // every allocation in old gen. It is done once at the end of GC instead |
|
1389 // for performance reasons. |
|
1390 if (!CMSHeap::heap()->is_gc_active()) { |
|
1391 recalculate_used_stable(); |
1375 } |
1392 } |
1376 |
1393 |
1377 return res; |
1394 return res; |
1378 } |
1395 } |
1379 |
1396 |