8014277: Remove ObjectClosure as base class for BoolObjectClosure
Reviewed-by: brutisso, tschatzl
This commit is contained in:
parent
b8276670c2
commit
0f9e2457c5
@ -485,10 +485,6 @@ class CMSIsAliveClosure: public BoolObjectClosure {
|
||||
assert(!span.is_empty(), "Empty span could spell trouble");
|
||||
}
|
||||
|
||||
void do_object(oop obj) {
|
||||
assert(false, "not to be invoked");
|
||||
}
|
||||
|
||||
bool do_object_b(oop obj);
|
||||
};
|
||||
|
||||
@ -1536,9 +1532,6 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure {
|
||||
_bit_map(bit_map),
|
||||
_par_scan_closure(cl) { }
|
||||
|
||||
void do_object(oop obj) {
|
||||
guarantee(false, "Call do_object_b(oop, MemRegion) instead");
|
||||
}
|
||||
bool do_object_b(oop obj) {
|
||||
guarantee(false, "Call do_object_b(oop, MemRegion) form instead");
|
||||
return false;
|
||||
|
@ -44,9 +44,6 @@ class G1CMIsAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
G1CMIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) { }
|
||||
|
||||
void do_object(oop obj) {
|
||||
ShouldNotCallThis();
|
||||
}
|
||||
bool do_object_b(oop obj);
|
||||
};
|
||||
|
||||
|
@ -5090,7 +5090,6 @@ class G1AlwaysAliveClosure: public BoolObjectClosure {
|
||||
G1CollectedHeap* _g1;
|
||||
public:
|
||||
G1AlwaysAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
|
||||
void do_object(oop p) { assert(false, "Do not call."); }
|
||||
bool do_object_b(oop p) {
|
||||
if (p != NULL) {
|
||||
return true;
|
||||
|
@ -165,7 +165,6 @@ class G1STWIsAliveClosure: public BoolObjectClosure {
|
||||
G1CollectedHeap* _g1;
|
||||
public:
|
||||
G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
|
||||
void do_object(oop p) { assert(false, "Do not call."); }
|
||||
bool do_object_b(oop p);
|
||||
};
|
||||
|
||||
|
@ -580,7 +580,6 @@ void PSMarkSweep::mark_sweep_phase2() {
|
||||
// This should be moved to the shared markSweep code!
|
||||
class PSAlwaysTrueClosure: public BoolObjectClosure {
|
||||
public:
|
||||
void do_object(oop p) { ShouldNotReachHere(); }
|
||||
bool do_object_b(oop p) { return true; }
|
||||
};
|
||||
static PSAlwaysTrueClosure always_true;
|
||||
|
@ -781,7 +781,6 @@ ParallelCompactData PSParallelCompact::_summary_data;
|
||||
|
||||
PSParallelCompact::IsAliveClosure PSParallelCompact::_is_alive_closure;
|
||||
|
||||
void PSParallelCompact::IsAliveClosure::do_object(oop p) { ShouldNotReachHere(); }
|
||||
bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap()->is_marked(p); }
|
||||
|
||||
void PSParallelCompact::KeepAliveClosure::do_oop(oop* p) { PSParallelCompact::KeepAliveClosure::do_oop_work(p); }
|
||||
@ -2413,7 +2412,6 @@ void PSParallelCompact::adjust_class_loader(ParCompactionManager* cm,
|
||||
// This should be moved to the shared markSweep code!
|
||||
class PSAlwaysTrueClosure: public BoolObjectClosure {
|
||||
public:
|
||||
void do_object(oop p) { ShouldNotReachHere(); }
|
||||
bool do_object_b(oop p) { return true; }
|
||||
};
|
||||
static PSAlwaysTrueClosure always_true;
|
||||
|
@ -784,7 +784,6 @@ class PSParallelCompact : AllStatic {
|
||||
//
|
||||
class IsAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
virtual void do_object(oop p);
|
||||
virtual bool do_object_b(oop p);
|
||||
};
|
||||
|
||||
|
@ -70,9 +70,6 @@ bool PSScavenge::_promotion_failed = false;
|
||||
// Define before use
|
||||
class PSIsAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
void do_object(oop p) {
|
||||
assert(false, "Do not call.");
|
||||
}
|
||||
bool do_object_b(oop p) {
|
||||
return (!PSScavenge::is_obj_in_young((HeapWord*) p)) || p->is_forwarded();
|
||||
}
|
||||
|
@ -166,7 +166,6 @@ void MarkSweep::restore_marks() {
|
||||
|
||||
MarkSweep::IsAliveClosure MarkSweep::is_alive;
|
||||
|
||||
void MarkSweep::IsAliveClosure::do_object(oop p) { ShouldNotReachHere(); }
|
||||
bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked(); }
|
||||
|
||||
MarkSweep::KeepAliveClosure MarkSweep::keep_alive;
|
||||
|
@ -88,7 +88,6 @@ class MarkSweep : AllStatic {
|
||||
// Used for java/lang/ref handling
|
||||
class IsAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
virtual void do_object(oop p);
|
||||
virtual bool do_object_b(oop p);
|
||||
};
|
||||
|
||||
|
@ -50,9 +50,6 @@
|
||||
DefNewGeneration::IsAliveClosure::IsAliveClosure(Generation* g) : _g(g) {
|
||||
assert(g->level() == 0, "Optimized for youngest gen.");
|
||||
}
|
||||
void DefNewGeneration::IsAliveClosure::do_object(oop p) {
|
||||
assert(false, "Do not call.");
|
||||
}
|
||||
bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) {
|
||||
return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded();
|
||||
}
|
||||
|
@ -150,7 +150,6 @@ protected:
|
||||
Generation* _g;
|
||||
public:
|
||||
IsAliveClosure(Generation* g);
|
||||
void do_object(oop p);
|
||||
bool do_object_b(oop p);
|
||||
};
|
||||
|
||||
|
@ -158,7 +158,7 @@ class ObjectClosure : public Closure {
|
||||
};
|
||||
|
||||
|
||||
class BoolObjectClosure : public ObjectClosure {
|
||||
class BoolObjectClosure : public Closure {
|
||||
public:
|
||||
virtual bool do_object_b(oop obj) = 0;
|
||||
};
|
||||
|
@ -252,7 +252,6 @@ uint ReferenceProcessor::count_jni_refs() {
|
||||
class AlwaysAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
virtual bool do_object_b(oop obj) { return true; }
|
||||
virtual void do_object(oop obj) { assert(false, "Don't call"); }
|
||||
};
|
||||
|
||||
class CountHandleClosure: public OopClosure {
|
||||
|
@ -212,7 +212,6 @@ void SharedHeap::process_strong_roots(bool activate_scope,
|
||||
|
||||
class AlwaysTrueClosure: public BoolObjectClosure {
|
||||
public:
|
||||
void do_object(oop p) { ShouldNotReachHere(); }
|
||||
bool do_object_b(oop p) { return true; }
|
||||
};
|
||||
static AlwaysTrueClosure always_true;
|
||||
|
@ -188,7 +188,6 @@ long JNIHandles::weak_global_handle_memory_usage() {
|
||||
class AlwaysAliveClosure: public BoolObjectClosure {
|
||||
public:
|
||||
bool do_object_b(oop obj) { return true; }
|
||||
void do_object(oop obj) { assert(false, "Don't call"); }
|
||||
};
|
||||
|
||||
class CountHandleClosure: public OopClosure {
|
||||
|
Loading…
Reference in New Issue
Block a user