604 CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level, |
604 CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level, |
605 GenRemSet* remset); |
605 GenRemSet* remset); |
606 |
606 |
607 public: |
607 public: |
608 |
608 |
|
609 // Attempt to expand the generation by "bytes". Expand by at a |
|
610 // minimum "expand_bytes". Return true if some amount (not |
|
611 // necessarily the full "bytes") was done. |
|
612 virtual bool expand(size_t bytes, size_t expand_bytes); |
|
613 |
609 virtual void clear_remembered_set(); |
614 virtual void clear_remembered_set(); |
610 |
615 |
611 virtual void invalidate_remembered_set(); |
616 virtual void invalidate_remembered_set(); |
612 |
617 |
613 virtual void prepare_for_verify(); |
618 virtual void prepare_for_verify(); |
|
619 |
|
620 // Grow generation with specified size (returns false if unable to grow) |
|
621 virtual bool grow_by(size_t bytes) = 0; |
|
622 // Grow generation to reserved size. |
|
623 virtual bool grow_to_reserved() = 0; |
614 }; |
624 }; |
615 |
625 |
616 // OneContigSpaceCardGeneration models a heap of old objects contained in a single |
626 // OneContigSpaceCardGeneration models a heap of old objects contained in a single |
617 // contiguous space. |
627 // contiguous space. |
618 // |
628 // |
629 ContiguousSpace* _the_space; // actual space holding objects |
639 ContiguousSpace* _the_space; // actual space holding objects |
630 WaterMark _last_gc; // watermark between objects allocated before |
640 WaterMark _last_gc; // watermark between objects allocated before |
631 // and after last GC. |
641 // and after last GC. |
632 |
642 |
633 // Grow generation with specified size (returns false if unable to grow) |
643 // Grow generation with specified size (returns false if unable to grow) |
634 bool grow_by(size_t bytes); |
644 virtual bool grow_by(size_t bytes); |
635 // Grow generation to reserved size. |
645 // Grow generation to reserved size. |
636 bool grow_to_reserved(); |
646 virtual bool grow_to_reserved(); |
637 // Shrink generation with specified size (returns false if unable to shrink) |
647 // Shrink generation with specified size (returns false if unable to shrink) |
638 void shrink_by(size_t bytes); |
648 void shrink_by(size_t bytes); |
639 |
649 |
640 // Allocation failure |
650 // Allocation failure |
641 void expand(size_t bytes, size_t expand_bytes); |
651 virtual bool expand(size_t bytes, size_t expand_bytes); |
642 void shrink(size_t bytes); |
652 void shrink(size_t bytes); |
643 |
653 |
644 // Accessing spaces |
654 // Accessing spaces |
645 ContiguousSpace* the_space() const { return _the_space; } |
655 ContiguousSpace* the_space() const { return _the_space; } |
646 |
656 |