comparison src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @ 12:6432c3bb6240

6668743: CMS: Consolidate block statistics reporting code Summary: Reduce the amount of related code replication and improve pretty printing. Reviewed-by: jmasa
author ysr
date Fri, 29 Feb 2008 14:42:56 -0800
parents a61af66fc99e
children ba764ed4b6f2
comparison
equal deleted inserted replaced
11:3c1dbcaaab1d 12:6432c3bb6240
416 416
417 // Return the free chunk at the end of the space. If no such 417 // Return the free chunk at the end of the space. If no such
418 // chunk exists, return NULL. 418 // chunk exists, return NULL.
419 FreeChunk* find_chunk_at_end(); 419 FreeChunk* find_chunk_at_end();
420 420
421 bool adaptive_freelists() { return _adaptive_freelists; } 421 bool adaptive_freelists() const { return _adaptive_freelists; }
422 422
423 void set_collector(CMSCollector* collector) { _collector = collector; } 423 void set_collector(CMSCollector* collector) { _collector = collector; }
424 424
425 // Support for parallelization of rescan and marking 425 // Support for parallelization of rescan and marking
426 const size_t rescan_task_size() const { return _rescan_task_size; } 426 const size_t rescan_task_size() const { return _rescan_task_size; }
564 size_t expansionSpaceRequired(size_t obj_size) const; 564 size_t expansionSpaceRequired(size_t obj_size) const;
565 565
566 FreeChunk* allocateScratch(size_t size); 566 FreeChunk* allocateScratch(size_t size);
567 567
568 // returns true if either the small or large linear allocation buffer is empty. 568 // returns true if either the small or large linear allocation buffer is empty.
569 bool linearAllocationWouldFail(); 569 bool linearAllocationWouldFail() const;
570 570
571 // Adjust the chunk for the minimum size. This version is called in 571 // Adjust the chunk for the minimum size. This version is called in
572 // most cases in CompactibleFreeListSpace methods. 572 // most cases in CompactibleFreeListSpace methods.
573 inline static size_t adjustObjectSize(size_t size) { 573 inline static size_t adjustObjectSize(size_t size) {
574 return (size_t) align_object_size(MAX2(size, (size_t)MinChunkSize)); 574 return (size_t) align_object_size(MAX2(size, (size_t)MinChunkSize));
582 // Minimum size of a free block. 582 // Minimum size of a free block.
583 virtual size_t minimum_free_block_size() const { return MinChunkSize; } 583 virtual size_t minimum_free_block_size() const { return MinChunkSize; }
584 void removeFreeChunkFromFreeLists(FreeChunk* chunk); 584 void removeFreeChunkFromFreeLists(FreeChunk* chunk);
585 void addChunkAndRepairOffsetTable(HeapWord* chunk, size_t size, 585 void addChunkAndRepairOffsetTable(HeapWord* chunk, size_t size,
586 bool coalesced); 586 bool coalesced);
587
588 // Support for decisions regarding concurrent collection policy
589 bool should_concurrent_collect() const;
587 590
588 // Support for compaction 591 // Support for compaction
589 void prepare_for_compaction(CompactPoint* cp); 592 void prepare_for_compaction(CompactPoint* cp);
590 void adjust_pointers(); 593 void adjust_pointers();
591 void compact(); 594 void compact();
620 // coalescing of smaller chucks, etc. The counts in the 623 // coalescing of smaller chucks, etc. The counts in the
621 // census is used to make decisions on splitting and 624 // census is used to make decisions on splitting and
622 // coalescing of chunks during the sweep of garbage. 625 // coalescing of chunks during the sweep of garbage.
623 626
624 // Print the statistics for the free lists. 627 // Print the statistics for the free lists.
625 void printFLCensus(int sweepCt) const; 628 void printFLCensus(size_t sweep_count) const;
626 629
627 // Statistics functions 630 // Statistics functions
628 // Initialize census for lists before the sweep. 631 // Initialize census for lists before the sweep.
629 void beginSweepFLCensus(float sweep_current, 632 void beginSweepFLCensus(float sweep_current,
630 float sweep_estimate); 633 float sweep_estimate);
633 // Set the hint for each of the free lists. 636 // Set the hint for each of the free lists.
634 void setFLHints(); 637 void setFLHints();
635 // Clear the census for each of the free lists. 638 // Clear the census for each of the free lists.
636 void clearFLCensus(); 639 void clearFLCensus();
637 // Perform functions for the census after the end of the sweep. 640 // Perform functions for the census after the end of the sweep.
638 void endSweepFLCensus(int sweepCt); 641 void endSweepFLCensus(size_t sweep_count);
639 // Return true if the count of free chunks is greater 642 // Return true if the count of free chunks is greater
640 // than the desired number of free chunks. 643 // than the desired number of free chunks.
641 bool coalOverPopulated(size_t size); 644 bool coalOverPopulated(size_t size);
642
643 645
644 // Record (for each size): 646 // Record (for each size):
645 // 647 //
646 // split-births = #chunks added due to splits in (prev-sweep-end, 648 // split-births = #chunks added due to splits in (prev-sweep-end,
647 // this-sweep-start) 649 // this-sweep-start)