632 // This is shared with other generations. |
632 // This is shared with other generations. |
633 GenRemSet* _rs; |
633 GenRemSet* _rs; |
634 // This is local to this generation. |
634 // This is local to this generation. |
635 BlockOffsetSharedArray* _bts; |
635 BlockOffsetSharedArray* _bts; |
636 |
636 |
|
637 // current shrinking effect: this damps shrinking when the heap gets empty. |
|
638 size_t _shrink_factor; |
|
639 |
|
640 size_t _min_heap_delta_bytes; // Minimum amount to expand. |
|
641 |
|
642 // Some statistics from before gc started. |
|
643 // These are gathered in the gc_prologue (and should_collect) |
|
644 // to control growing/shrinking policy in spite of promotions. |
|
645 size_t _capacity_at_prologue; |
|
646 size_t _used_at_prologue; |
|
647 |
637 CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level, |
648 CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level, |
638 GenRemSet* remset); |
649 GenRemSet* remset); |
639 |
650 |
640 public: |
651 public: |
641 |
652 |
642 // Attempt to expand the generation by "bytes". Expand by at a |
653 // Attempt to expand the generation by "bytes". Expand by at a |
643 // minimum "expand_bytes". Return true if some amount (not |
654 // minimum "expand_bytes". Return true if some amount (not |
644 // necessarily the full "bytes") was done. |
655 // necessarily the full "bytes") was done. |
645 virtual bool expand(size_t bytes, size_t expand_bytes); |
656 virtual bool expand(size_t bytes, size_t expand_bytes); |
|
657 |
|
658 // Shrink generation with specified size (returns false if unable to shrink) |
|
659 virtual void shrink(size_t bytes) = 0; |
|
660 |
|
661 virtual void compute_new_size(); |
646 |
662 |
647 virtual void clear_remembered_set(); |
663 virtual void clear_remembered_set(); |
648 |
664 |
649 virtual void invalidate_remembered_set(); |
665 virtual void invalidate_remembered_set(); |
650 |
666 |
665 friend class VMStructs; |
681 friend class VMStructs; |
666 // Abstractly, this is a subtype that gets access to protected fields. |
682 // Abstractly, this is a subtype that gets access to protected fields. |
667 friend class VM_PopulateDumpSharedSpace; |
683 friend class VM_PopulateDumpSharedSpace; |
668 |
684 |
669 protected: |
685 protected: |
670 size_t _min_heap_delta_bytes; // Minimum amount to expand. |
|
671 ContiguousSpace* _the_space; // actual space holding objects |
686 ContiguousSpace* _the_space; // actual space holding objects |
672 WaterMark _last_gc; // watermark between objects allocated before |
687 WaterMark _last_gc; // watermark between objects allocated before |
673 // and after last GC. |
688 // and after last GC. |
674 |
689 |
675 // Grow generation with specified size (returns false if unable to grow) |
690 // Grow generation with specified size (returns false if unable to grow) |
686 // Accessing spaces |
701 // Accessing spaces |
687 ContiguousSpace* the_space() const { return _the_space; } |
702 ContiguousSpace* the_space() const { return _the_space; } |
688 |
703 |
689 public: |
704 public: |
690 OneContigSpaceCardGeneration(ReservedSpace rs, size_t initial_byte_size, |
705 OneContigSpaceCardGeneration(ReservedSpace rs, size_t initial_byte_size, |
691 size_t min_heap_delta_bytes, |
|
692 int level, GenRemSet* remset, |
706 int level, GenRemSet* remset, |
693 ContiguousSpace* space) : |
707 ContiguousSpace* space) : |
694 CardGeneration(rs, initial_byte_size, level, remset), |
708 CardGeneration(rs, initial_byte_size, level, remset), |
695 _the_space(space), _min_heap_delta_bytes(min_heap_delta_bytes) |
709 _the_space(space) |
696 {} |
710 {} |
697 |
711 |
698 inline bool is_in(const void* p) const; |
712 inline bool is_in(const void* p) const; |
699 |
713 |
700 // Space enquiries |
714 // Space enquiries |