48 // Don't overwrite the first missing card mark
49 if (_unmarked_addr == NULL) {
50 _unmarked_addr = (HeapWord*)p;
51 _unmarked_card = _card_table->byte_for(p);
52 }
53 }
54 }
55
56 public:
57 CheckForUnmarkedOops(PSYoungGen* young_gen, CardTableExtension* card_table) :
58 _young_gen(young_gen), _card_table(card_table), _unmarked_addr(NULL) { }
59
60 virtual void do_oop(oop* p) { CheckForUnmarkedOops::do_oop_work(p); }
61 virtual void do_oop(narrowOop* p) { CheckForUnmarkedOops::do_oop_work(p); }
62
63 bool has_unmarked_oop() {
64 return _unmarked_addr != NULL;
65 }
66 };
67
68 // Checks all objects for the existance of some type of mark,
69 // precise or imprecise, dirty or newgen.
70 class CheckForUnmarkedObjects : public ObjectClosure {
71 private:
72 PSYoungGen* _young_gen;
73 CardTableExtension* _card_table;
74
75 public:
76 CheckForUnmarkedObjects() {
77 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
78 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
79
80 _young_gen = heap->young_gen();
81 _card_table = (CardTableExtension*)heap->barrier_set();
82 // No point in asserting barrier set type here. Need to make CardTableExtension
83 // a unique barrier set type.
84 }
85
86 // Card marks are not precise. The current system can leave us with
87 // a mismash of precise marks and beginning of object marks. This means
88 // we test for missing precise marks first. If any are found, we don't
89 // fail unless the object head is also unmarked.
90 virtual void do_object(oop obj) {
91 CheckForUnmarkedOops object_check(_young_gen, _card_table);
92 obj->oop_iterate_no_header(&object_check);
93 if (object_check.has_unmarked_oop()) {
94 assert(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object");
95 }
96 }
97 };
98
99 // Checks for precise marking of oops as newgen.
100 class CheckForPreciseMarks : public OopClosure {
101 private:
102 PSYoungGen* _young_gen;
103 CardTableExtension* _card_table;
104
105 protected:
106 template <class T> void do_oop_work(T* p) {
107 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
|
48 // Don't overwrite the first missing card mark
49 if (_unmarked_addr == NULL) {
50 _unmarked_addr = (HeapWord*)p;
51 _unmarked_card = _card_table->byte_for(p);
52 }
53 }
54 }
55
56 public:
57 CheckForUnmarkedOops(PSYoungGen* young_gen, CardTableExtension* card_table) :
58 _young_gen(young_gen), _card_table(card_table), _unmarked_addr(NULL) { }
59
60 virtual void do_oop(oop* p) { CheckForUnmarkedOops::do_oop_work(p); }
61 virtual void do_oop(narrowOop* p) { CheckForUnmarkedOops::do_oop_work(p); }
62
63 bool has_unmarked_oop() {
64 return _unmarked_addr != NULL;
65 }
66 };
67
68 // Checks all objects for the existence of some type of mark,
69 // precise or imprecise, dirty or newgen.
70 class CheckForUnmarkedObjects : public ObjectClosure {
71 private:
72 PSYoungGen* _young_gen;
73 CardTableExtension* _card_table;
74
75 public:
76 CheckForUnmarkedObjects() {
77 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
78 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
79
80 _young_gen = heap->young_gen();
81 _card_table = (CardTableExtension*)heap->barrier_set();
82 // No point in asserting barrier set type here. Need to make CardTableExtension
83 // a unique barrier set type.
84 }
85
86 // Card marks are not precise. The current system can leave us with
87 // a mismatch of precise marks and beginning of object marks. This means
88 // we test for missing precise marks first. If any are found, we don't
89 // fail unless the object head is also unmarked.
90 virtual void do_object(oop obj) {
91 CheckForUnmarkedOops object_check(_young_gen, _card_table);
92 obj->oop_iterate_no_header(&object_check);
93 if (object_check.has_unmarked_oop()) {
94 assert(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object");
95 }
96 }
97 };
98
99 // Checks for precise marking of oops as newgen.
100 class CheckForPreciseMarks : public OopClosure {
101 private:
102 PSYoungGen* _young_gen;
103 CardTableExtension* _card_table;
104
105 protected:
106 template <class T> void do_oop_work(T* p) {
107 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
|