44 // The problem is that the existence of this method breaks
45 // the independence of barrier sets from remembered sets.
46 // The solution is to remove this method from the definition
47 // of a Space.
48
49 class CompactibleSpace;
50 class ContiguousSpace;
51 class HeapRegionRemSet;
52 class HeapRegionRemSetIterator;
53 class HeapRegion;
54 class HeapRegionSetBase;
55 class nmethod;
56
57 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
58 #define HR_FORMAT_PARAMS(_hr_) \
59 (_hr_)->hrs_index(), \
60 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : \
61 (_hr_)->startsHumongous() ? "HS" : \
62 (_hr_)->continuesHumongous() ? "HC" : \
63 !(_hr_)->is_empty() ? "O" : "F", \
64 (_hr_)->bottom(), (_hr_)->top(), (_hr_)->end()
65
66 // sentinel value for hrs_index
67 #define G1_NULL_HRS_INDEX ((uint) -1)
68
69 // A dirty card to oop closure for heap regions. It
70 // knows how to get the G1 heap and how to use the bitmap
71 // in the concurrent marker used by G1 to filter remembered
72 // sets.
73
74 class HeapRegionDCTOC : public ContiguousSpaceDCTOC {
75 public:
76 // Specification of possible DirtyCardToOopClosure filtering.
77 enum FilterKind {
78 NoFilterKind,
79 IntoCSFilterKind,
80 OutOfRegionFilterKind
81 };
82
83 protected:
84 HeapRegion* _hr;
533 // Methods used by the HeapRegionSetBase class and subclasses.
534
535 // Getter and setter for the next and prev fields used to link regions into
536 // linked lists.
537 HeapRegion* next() { return _next; }
538 HeapRegion* prev() { return _prev; }
539
540 void set_next(HeapRegion* next) { _next = next; }
541 void set_prev(HeapRegion* prev) { _prev = prev; }
542
543 // Every region added to a set is tagged with a reference to that
544 // set. This is used for doing consistency checking to make sure that
545 // the contents of a set are as they should be and it's only
546 // available in non-product builds.
547 #ifdef ASSERT
548 void set_containing_set(HeapRegionSetBase* containing_set) {
549 assert((containing_set == NULL && _containing_set != NULL) ||
550 (containing_set != NULL && _containing_set == NULL),
551 err_msg("containing_set: "PTR_FORMAT" "
552 "_containing_set: "PTR_FORMAT,
553 containing_set, _containing_set));
554
555 _containing_set = containing_set;
556 }
557
558 HeapRegionSetBase* containing_set() { return _containing_set; }
559 #else // ASSERT
560 void set_containing_set(HeapRegionSetBase* containing_set) { }
561
562 // containing_set() is only used in asserts so there's no reason
563 // to provide a dummy version of it.
564 #endif // ASSERT
565
566 // If we want to remove regions from a list in bulk we can simply tag
567 // them with the pending_removal tag and call the
568 // remove_all_pending() method on the list.
569
570 bool pending_removal() { return _pending_removal; }
571
572 void set_pending_removal(bool pending_removal) {
573 if (pending_removal) {
|
44 // The problem is that the existence of this method breaks
45 // the independence of barrier sets from remembered sets.
46 // The solution is to remove this method from the definition
47 // of a Space.
48
49 class CompactibleSpace;
50 class ContiguousSpace;
51 class HeapRegionRemSet;
52 class HeapRegionRemSetIterator;
53 class HeapRegion;
54 class HeapRegionSetBase;
55 class nmethod;
56
57 #define HR_FORMAT "%u:(%s)["PTR_FORMAT","PTR_FORMAT","PTR_FORMAT"]"
58 #define HR_FORMAT_PARAMS(_hr_) \
59 (_hr_)->hrs_index(), \
60 (_hr_)->is_survivor() ? "S" : (_hr_)->is_young() ? "E" : \
61 (_hr_)->startsHumongous() ? "HS" : \
62 (_hr_)->continuesHumongous() ? "HC" : \
63 !(_hr_)->is_empty() ? "O" : "F", \
64 p2i((_hr_)->bottom()), p2i((_hr_)->top()), p2i((_hr_)->end())
65
66 // sentinel value for hrs_index
67 #define G1_NULL_HRS_INDEX ((uint) -1)
68
69 // A dirty card to oop closure for heap regions. It
70 // knows how to get the G1 heap and how to use the bitmap
71 // in the concurrent marker used by G1 to filter remembered
72 // sets.
73
74 class HeapRegionDCTOC : public ContiguousSpaceDCTOC {
75 public:
76 // Specification of possible DirtyCardToOopClosure filtering.
77 enum FilterKind {
78 NoFilterKind,
79 IntoCSFilterKind,
80 OutOfRegionFilterKind
81 };
82
83 protected:
84 HeapRegion* _hr;
533 // Methods used by the HeapRegionSetBase class and subclasses.
534
535 // Getter and setter for the next and prev fields used to link regions into
536 // linked lists.
537 HeapRegion* next() { return _next; }
538 HeapRegion* prev() { return _prev; }
539
540 void set_next(HeapRegion* next) { _next = next; }
541 void set_prev(HeapRegion* prev) { _prev = prev; }
542
543 // Every region added to a set is tagged with a reference to that
544 // set. This is used for doing consistency checking to make sure that
545 // the contents of a set are as they should be and it's only
546 // available in non-product builds.
547 #ifdef ASSERT
548 void set_containing_set(HeapRegionSetBase* containing_set) {
549 assert((containing_set == NULL && _containing_set != NULL) ||
550 (containing_set != NULL && _containing_set == NULL),
551 err_msg("containing_set: "PTR_FORMAT" "
552 "_containing_set: "PTR_FORMAT,
553 p2i(containing_set), p2i(_containing_set)));
554
555 _containing_set = containing_set;
556 }
557
558 HeapRegionSetBase* containing_set() { return _containing_set; }
559 #else // ASSERT
560 void set_containing_set(HeapRegionSetBase* containing_set) { }
561
562 // containing_set() is only used in asserts so there's no reason
563 // to provide a dummy version of it.
564 #endif // ASSERT
565
566 // If we want to remove regions from a list in bulk we can simply tag
567 // them with the pending_removal tag and call the
568 // remove_all_pending() method on the list.
569
570 bool pending_removal() { return _pending_removal; }
571
572 void set_pending_removal(bool pending_removal) {
573 if (pending_removal) {
|