Skip to content

Commit

Permalink
8325416: Parallel: Refactor CheckForUnmarkedOops
Browse files Browse the repository at this point in the history
Reviewed-by: stefank
  • Loading branch information
albertnetymk committed Feb 7, 2024
1 parent 1ecf74c commit a9c6e87
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hotspot/share/gc/parallel/psCardTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@
// Checks an individual oop for missing precise marks. Mark
// may be either dirty or newgen.
class CheckForUnmarkedOops : public BasicOopIterateClosure {
private:
PSYoungGen* _young_gen;
PSCardTable* _card_table;
HeapWord* _unmarked_addr;

protected:
template <class T> void do_oop_work(T* p) {
oop obj = RawAccess<>::oop_load(p);
if (_young_gen->is_in_reserved(obj) &&
Expand All @@ -60,8 +58,8 @@ class CheckForUnmarkedOops : public BasicOopIterateClosure {
CheckForUnmarkedOops(PSYoungGen* young_gen, PSCardTable* card_table) :
_young_gen(young_gen), _card_table(card_table), _unmarked_addr(nullptr) { }

virtual void do_oop(oop* p) { CheckForUnmarkedOops::do_oop_work(p); }
virtual void do_oop(narrowOop* p) { CheckForUnmarkedOops::do_oop_work(p); }
void do_oop(oop* p) override { do_oop_work(p); }
void do_oop(narrowOop* p) override { do_oop_work(p); }

bool has_unmarked_oop() {
return _unmarked_addr != nullptr;
Expand Down

1 comment on commit a9c6e87

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.