提交 0e82c29a 编写于 作者: E ehelin

8014277: Remove ObjectClosure as base class for BoolObjectClosure

Reviewed-by: brutisso, tschatzl
上级 65c687b0
...@@ -485,10 +485,6 @@ class CMSIsAliveClosure: public BoolObjectClosure { ...@@ -485,10 +485,6 @@ class CMSIsAliveClosure: public BoolObjectClosure {
assert(!span.is_empty(), "Empty span could spell trouble"); 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); bool do_object_b(oop obj);
}; };
...@@ -1536,9 +1532,6 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure { ...@@ -1536,9 +1532,6 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure {
_bit_map(bit_map), _bit_map(bit_map),
_par_scan_closure(cl) { } _par_scan_closure(cl) { }
void do_object(oop obj) {
guarantee(false, "Call do_object_b(oop, MemRegion) instead");
}
bool do_object_b(oop obj) { bool do_object_b(oop obj) {
guarantee(false, "Call do_object_b(oop, MemRegion) form instead"); guarantee(false, "Call do_object_b(oop, MemRegion) form instead");
return false; return false;
......
...@@ -44,9 +44,6 @@ class G1CMIsAliveClosure: public BoolObjectClosure { ...@@ -44,9 +44,6 @@ class G1CMIsAliveClosure: public BoolObjectClosure {
public: public:
G1CMIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) { } G1CMIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) { }
void do_object(oop obj) {
ShouldNotCallThis();
}
bool do_object_b(oop obj); bool do_object_b(oop obj);
}; };
......
...@@ -5090,7 +5090,6 @@ class G1AlwaysAliveClosure: public BoolObjectClosure { ...@@ -5090,7 +5090,6 @@ class G1AlwaysAliveClosure: public BoolObjectClosure {
G1CollectedHeap* _g1; G1CollectedHeap* _g1;
public: public:
G1AlwaysAliveClosure(G1CollectedHeap* g1) : _g1(g1) {} G1AlwaysAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
void do_object(oop p) { assert(false, "Do not call."); }
bool do_object_b(oop p) { bool do_object_b(oop p) {
if (p != NULL) { if (p != NULL) {
return true; return true;
......
...@@ -165,7 +165,6 @@ class G1STWIsAliveClosure: public BoolObjectClosure { ...@@ -165,7 +165,6 @@ class G1STWIsAliveClosure: public BoolObjectClosure {
G1CollectedHeap* _g1; G1CollectedHeap* _g1;
public: public:
G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {} G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
void do_object(oop p) { assert(false, "Do not call."); }
bool do_object_b(oop p); bool do_object_b(oop p);
}; };
......
...@@ -580,7 +580,6 @@ void PSMarkSweep::mark_sweep_phase2() { ...@@ -580,7 +580,6 @@ void PSMarkSweep::mark_sweep_phase2() {
// This should be moved to the shared markSweep code! // This should be moved to the shared markSweep code!
class PSAlwaysTrueClosure: public BoolObjectClosure { class PSAlwaysTrueClosure: public BoolObjectClosure {
public: public:
void do_object(oop p) { ShouldNotReachHere(); }
bool do_object_b(oop p) { return true; } bool do_object_b(oop p) { return true; }
}; };
static PSAlwaysTrueClosure always_true; static PSAlwaysTrueClosure always_true;
......
...@@ -781,7 +781,6 @@ ParallelCompactData PSParallelCompact::_summary_data; ...@@ -781,7 +781,6 @@ ParallelCompactData PSParallelCompact::_summary_data;
PSParallelCompact::IsAliveClosure PSParallelCompact::_is_alive_closure; 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); } 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); } void PSParallelCompact::KeepAliveClosure::do_oop(oop* p) { PSParallelCompact::KeepAliveClosure::do_oop_work(p); }
...@@ -2413,7 +2412,6 @@ void PSParallelCompact::adjust_class_loader(ParCompactionManager* cm, ...@@ -2413,7 +2412,6 @@ void PSParallelCompact::adjust_class_loader(ParCompactionManager* cm,
// This should be moved to the shared markSweep code! // This should be moved to the shared markSweep code!
class PSAlwaysTrueClosure: public BoolObjectClosure { class PSAlwaysTrueClosure: public BoolObjectClosure {
public: public:
void do_object(oop p) { ShouldNotReachHere(); }
bool do_object_b(oop p) { return true; } bool do_object_b(oop p) { return true; }
}; };
static PSAlwaysTrueClosure always_true; static PSAlwaysTrueClosure always_true;
......
...@@ -784,7 +784,6 @@ class PSParallelCompact : AllStatic { ...@@ -784,7 +784,6 @@ class PSParallelCompact : AllStatic {
// //
class IsAliveClosure: public BoolObjectClosure { class IsAliveClosure: public BoolObjectClosure {
public: public:
virtual void do_object(oop p);
virtual bool do_object_b(oop p); virtual bool do_object_b(oop p);
}; };
......
...@@ -70,9 +70,6 @@ bool PSScavenge::_promotion_failed = false; ...@@ -70,9 +70,6 @@ bool PSScavenge::_promotion_failed = false;
// Define before use // Define before use
class PSIsAliveClosure: public BoolObjectClosure { class PSIsAliveClosure: public BoolObjectClosure {
public: public:
void do_object(oop p) {
assert(false, "Do not call.");
}
bool do_object_b(oop p) { bool do_object_b(oop p) {
return (!PSScavenge::is_obj_in_young((HeapWord*) p)) || p->is_forwarded(); return (!PSScavenge::is_obj_in_young((HeapWord*) p)) || p->is_forwarded();
} }
......
...@@ -166,7 +166,6 @@ void MarkSweep::restore_marks() { ...@@ -166,7 +166,6 @@ void MarkSweep::restore_marks() {
MarkSweep::IsAliveClosure MarkSweep::is_alive; 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(); } bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked(); }
MarkSweep::KeepAliveClosure MarkSweep::keep_alive; MarkSweep::KeepAliveClosure MarkSweep::keep_alive;
......
...@@ -88,7 +88,6 @@ class MarkSweep : AllStatic { ...@@ -88,7 +88,6 @@ class MarkSweep : AllStatic {
// Used for java/lang/ref handling // Used for java/lang/ref handling
class IsAliveClosure: public BoolObjectClosure { class IsAliveClosure: public BoolObjectClosure {
public: public:
virtual void do_object(oop p);
virtual bool do_object_b(oop p); virtual bool do_object_b(oop p);
}; };
......
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
DefNewGeneration::IsAliveClosure::IsAliveClosure(Generation* g) : _g(g) { DefNewGeneration::IsAliveClosure::IsAliveClosure(Generation* g) : _g(g) {
assert(g->level() == 0, "Optimized for youngest gen."); 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) { bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) {
return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded(); return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded();
} }
......
...@@ -150,7 +150,6 @@ protected: ...@@ -150,7 +150,6 @@ protected:
Generation* _g; Generation* _g;
public: public:
IsAliveClosure(Generation* g); IsAliveClosure(Generation* g);
void do_object(oop p);
bool do_object_b(oop p); bool do_object_b(oop p);
}; };
......
...@@ -158,7 +158,7 @@ class ObjectClosure : public Closure { ...@@ -158,7 +158,7 @@ class ObjectClosure : public Closure {
}; };
class BoolObjectClosure : public ObjectClosure { class BoolObjectClosure : public Closure {
public: public:
virtual bool do_object_b(oop obj) = 0; virtual bool do_object_b(oop obj) = 0;
}; };
......
...@@ -252,7 +252,6 @@ uint ReferenceProcessor::count_jni_refs() { ...@@ -252,7 +252,6 @@ uint ReferenceProcessor::count_jni_refs() {
class AlwaysAliveClosure: public BoolObjectClosure { class AlwaysAliveClosure: public BoolObjectClosure {
public: public:
virtual bool do_object_b(oop obj) { return true; } virtual bool do_object_b(oop obj) { return true; }
virtual void do_object(oop obj) { assert(false, "Don't call"); }
}; };
class CountHandleClosure: public OopClosure { class CountHandleClosure: public OopClosure {
......
...@@ -212,7 +212,6 @@ void SharedHeap::process_strong_roots(bool activate_scope, ...@@ -212,7 +212,6 @@ void SharedHeap::process_strong_roots(bool activate_scope,
class AlwaysTrueClosure: public BoolObjectClosure { class AlwaysTrueClosure: public BoolObjectClosure {
public: public:
void do_object(oop p) { ShouldNotReachHere(); }
bool do_object_b(oop p) { return true; } bool do_object_b(oop p) { return true; }
}; };
static AlwaysTrueClosure always_true; static AlwaysTrueClosure always_true;
......
...@@ -188,7 +188,6 @@ long JNIHandles::weak_global_handle_memory_usage() { ...@@ -188,7 +188,6 @@ long JNIHandles::weak_global_handle_memory_usage() {
class AlwaysAliveClosure: public BoolObjectClosure { class AlwaysAliveClosure: public BoolObjectClosure {
public: public:
bool do_object_b(oop obj) { return true; } bool do_object_b(oop obj) { return true; }
void do_object(oop obj) { assert(false, "Don't call"); }
}; };
class CountHandleClosure: public OopClosure { class CountHandleClosure: public OopClosure {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册