37 #include "runtime/prefetch.inline.hpp" |
37 #include "runtime/prefetch.inline.hpp" |
38 #include "utilities/align.hpp" |
38 #include "utilities/align.hpp" |
39 |
39 |
40 // Checks an individual oop for missing precise marks. Mark |
40 // Checks an individual oop for missing precise marks. Mark |
41 // may be either dirty or newgen. |
41 // may be either dirty or newgen. |
42 class CheckForUnmarkedOops : public OopClosure { |
42 class CheckForUnmarkedOops : public BasicOopIterateClosure { |
43 private: |
43 private: |
44 PSYoungGen* _young_gen; |
44 PSYoungGen* _young_gen; |
45 PSCardTable* _card_table; |
45 PSCardTable* _card_table; |
46 HeapWord* _unmarked_addr; |
46 HeapWord* _unmarked_addr; |
47 |
47 |
87 // a mismatch of precise marks and beginning of object marks. This means |
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 |
88 // we test for missing precise marks first. If any are found, we don't |
89 // fail unless the object head is also unmarked. |
89 // fail unless the object head is also unmarked. |
90 virtual void do_object(oop obj) { |
90 virtual void do_object(oop obj) { |
91 CheckForUnmarkedOops object_check(_young_gen, _card_table); |
91 CheckForUnmarkedOops object_check(_young_gen, _card_table); |
92 obj->oop_iterate_no_header(&object_check); |
92 obj->oop_iterate(&object_check); |
93 if (object_check.has_unmarked_oop()) { |
93 if (object_check.has_unmarked_oop()) { |
94 guarantee(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object"); |
94 guarantee(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object"); |
95 } |
95 } |
96 } |
96 } |
97 }; |
97 }; |
98 |
98 |
99 // Checks for precise marking of oops as newgen. |
99 // Checks for precise marking of oops as newgen. |
100 class CheckForPreciseMarks : public OopClosure { |
100 class CheckForPreciseMarks : public BasicOopIterateClosure { |
101 private: |
101 private: |
102 PSYoungGen* _young_gen; |
102 PSYoungGen* _young_gen; |
103 PSCardTable* _card_table; |
103 PSCardTable* _card_table; |
104 |
104 |
105 protected: |
105 protected: |
334 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
334 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
335 PSOldGen* old_gen = heap->old_gen(); |
335 PSOldGen* old_gen = heap->old_gen(); |
336 |
336 |
337 CheckForPreciseMarks check(heap->young_gen(), this); |
337 CheckForPreciseMarks check(heap->young_gen(), this); |
338 |
338 |
339 old_gen->oop_iterate_no_header(&check); |
339 old_gen->oop_iterate(&check); |
340 |
340 |
341 verify_all_young_refs_precise_helper(old_gen->object_space()->used_region()); |
341 verify_all_young_refs_precise_helper(old_gen->object_space()->used_region()); |
342 } |
342 } |
343 |
343 |
344 void PSCardTable::verify_all_young_refs_precise_helper(MemRegion mr) { |
344 void PSCardTable::verify_all_young_refs_precise_helper(MemRegion mr) { |