53 class HeapRegionSetBase; |
53 class HeapRegionSetBase; |
54 |
54 |
55 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]" |
55 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]" |
56 #define HR_FORMAT_PARAMS(_hr_) \ |
56 #define HR_FORMAT_PARAMS(_hr_) \ |
57 (_hr_)->hrs_index(), \ |
57 (_hr_)->hrs_index(), \ |
58 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : "-", \ |
58 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : \ |
|
59 (_hr_)->startsHumongous() ? "HS" : \ |
|
60 (_hr_)->continuesHumongous() ? "HC" : \ |
|
61 !(_hr_)->is_empty() ? "O" : "F", \ |
59 (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end() |
62 (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end() |
60 |
63 |
61 // sentinel value for hrs_index |
64 // sentinel value for hrs_index |
62 #define G1_NULL_HRS_INDEX ((uint) -1) |
65 #define G1_NULL_HRS_INDEX ((uint) -1) |
63 |
66 |
171 void set_end(HeapWord* value); |
174 void set_end(HeapWord* value); |
172 |
175 |
173 virtual HeapWord* saved_mark_word() const; |
176 virtual HeapWord* saved_mark_word() const; |
174 virtual void set_saved_mark(); |
177 virtual void set_saved_mark(); |
175 void reset_gc_time_stamp() { _gc_time_stamp = 0; } |
178 void reset_gc_time_stamp() { _gc_time_stamp = 0; } |
|
179 unsigned get_gc_time_stamp() { return _gc_time_stamp; } |
176 |
180 |
177 // See the comment above in the declaration of _pre_dummy_top for an |
181 // See the comment above in the declaration of _pre_dummy_top for an |
178 // explanation of what it is. |
182 // explanation of what it is. |
179 void set_pre_dummy_top(HeapWord* pre_dummy_top) { |
183 void set_pre_dummy_top(HeapWord* pre_dummy_top) { |
180 assert(is_in(pre_dummy_top) && pre_dummy_top <= top(), "pre-condition"); |
184 assert(is_in(pre_dummy_top) && pre_dummy_top <= top(), "pre-condition"); |
435 bool startsHumongous() const { return _humongous_type == StartsHumongous; } |
439 bool startsHumongous() const { return _humongous_type == StartsHumongous; } |
436 bool continuesHumongous() const { return _humongous_type == ContinuesHumongous; } |
440 bool continuesHumongous() const { return _humongous_type == ContinuesHumongous; } |
437 // For a humongous region, region in which it starts. |
441 // For a humongous region, region in which it starts. |
438 HeapRegion* humongous_start_region() const { |
442 HeapRegion* humongous_start_region() const { |
439 return _humongous_start_region; |
443 return _humongous_start_region; |
|
444 } |
|
445 |
|
446 // Return the number of distinct regions that are covered by this region: |
|
447 // 1 if the region is not humongous, >= 1 if the region is humongous. |
|
448 uint region_num() const { |
|
449 if (!isHumongous()) { |
|
450 return 1U; |
|
451 } else { |
|
452 assert(startsHumongous(), "doesn't make sense on HC regions"); |
|
453 assert(capacity() % HeapRegion::GrainBytes == 0, "sanity"); |
|
454 return (uint) (capacity() >> HeapRegion::LogOfHRGrainBytes); |
|
455 } |
|
456 } |
|
457 |
|
458 // Return the index + 1 of the last HC regions that's associated |
|
459 // with this HS region. |
|
460 uint last_hc_index() const { |
|
461 assert(startsHumongous(), "don't call this otherwise"); |
|
462 return hrs_index() + region_num(); |
440 } |
463 } |
441 |
464 |
442 // Same as Space::is_in_reserved, but will use the original size of the region. |
465 // Same as Space::is_in_reserved, but will use the original size of the region. |
443 // The original size is different only for start humongous regions. They get |
466 // The original size is different only for start humongous regions. They get |
444 // their _end set up to be the end of the last continues region of the |
467 // their _end set up to be the end of the last continues region of the |
620 // Returns "false" iff no object in the region was allocated when the |
643 // Returns "false" iff no object in the region was allocated when the |
621 // last mark phase ended. |
644 // last mark phase ended. |
622 bool is_marked() { return _prev_top_at_mark_start != bottom(); } |
645 bool is_marked() { return _prev_top_at_mark_start != bottom(); } |
623 |
646 |
624 void reset_during_compaction() { |
647 void reset_during_compaction() { |
625 guarantee( isHumongous() && startsHumongous(), |
648 assert(isHumongous() && startsHumongous(), |
626 "should only be called for humongous regions"); |
649 "should only be called for starts humongous regions"); |
627 |
650 |
628 zero_marked_bytes(); |
651 zero_marked_bytes(); |
629 init_top_at_mark_start(); |
652 init_top_at_mark_start(); |
630 } |
653 } |
631 |
654 |
772 |
795 |
773 #define HeapRegion_OOP_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix) \ |
796 #define HeapRegion_OOP_SINCE_SAVE_MARKS_DECL(OopClosureType, nv_suffix) \ |
774 virtual void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl); |
797 virtual void oop_since_save_marks_iterate##nv_suffix(OopClosureType* cl); |
775 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DECL) |
798 SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(HeapRegion_OOP_SINCE_SAVE_MARKS_DECL) |
776 |
799 |
777 CompactibleSpace* next_compaction_space() const; |
800 virtual CompactibleSpace* next_compaction_space() const; |
778 |
801 |
779 virtual void reset_after_compaction(); |
802 virtual void reset_after_compaction(); |
780 |
803 |
781 void print() const; |
804 void print() const; |
782 void print_on(outputStream* st) const; |
805 void print_on(outputStream* st) const; |