8014277: Remove ObjectClosure as base class for BoolObjectClosure
authorehelin
Fri, 17 May 2013 11:57:05 +0200
changeset 17625 3e91c67ddece
parent 17397 609242d28659
child 17626 bc4e072add30
8014277: Remove ObjectClosure as base class for BoolObjectClosure Reviewed-by: brutisso, tschatzl
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp
hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp
hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp
hotspot/src/share/vm/memory/defNewGeneration.cpp
hotspot/src/share/vm/memory/defNewGeneration.hpp
hotspot/src/share/vm/memory/iterator.hpp
hotspot/src/share/vm/memory/referenceProcessor.cpp
hotspot/src/share/vm/memory/sharedHeap.cpp
hotspot/src/share/vm/runtime/jniHandles.cpp
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp	Fri May 17 11:57:05 2013 +0200
@@ -485,10 +485,6 @@
     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 @@
     _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;
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp	Fri May 17 11:57:05 2013 +0200
@@ -44,9 +44,6 @@
  public:
   G1CMIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) { }
 
-  void do_object(oop obj) {
-    ShouldNotCallThis();
-  }
   bool do_object_b(oop obj);
 };
 
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Fri May 17 11:57:05 2013 +0200
@@ -5090,7 +5090,6 @@
   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;
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Fri May 17 11:57:05 2013 +0200
@@ -165,7 +165,6 @@
   G1CollectedHeap* _g1;
 public:
   G1STWIsAliveClosure(G1CollectedHeap* g1) : _g1(g1) {}
-  void do_object(oop p) { assert(false, "Do not call."); }
   bool do_object_b(oop p);
 };
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp	Fri May 17 11:57:05 2013 +0200
@@ -580,7 +580,6 @@
 // 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;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp	Fri May 17 11:57:05 2013 +0200
@@ -781,7 +781,6 @@
 
 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 @@
 // 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;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp	Fri May 17 11:57:05 2013 +0200
@@ -784,7 +784,6 @@
   //
   class IsAliveClosure: public BoolObjectClosure {
    public:
-    virtual void do_object(oop p);
     virtual bool do_object_b(oop p);
   };
 
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Fri May 17 11:57:05 2013 +0200
@@ -70,9 +70,6 @@
 // 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();
   }
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp	Fri May 17 11:57:05 2013 +0200
@@ -166,7 +166,6 @@
 
 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;
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp	Fri May 17 11:57:05 2013 +0200
@@ -88,7 +88,6 @@
   // Used for java/lang/ref handling
   class IsAliveClosure: public BoolObjectClosure {
    public:
-    virtual void do_object(oop p);
     virtual bool do_object_b(oop p);
   };
 
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp	Fri May 17 11:57:05 2013 +0200
@@ -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();
 }
--- a/hotspot/src/share/vm/memory/defNewGeneration.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp	Fri May 17 11:57:05 2013 +0200
@@ -150,7 +150,6 @@
     Generation* _g;
   public:
     IsAliveClosure(Generation* g);
-    void do_object(oop p);
     bool do_object_b(oop p);
   };
 
--- a/hotspot/src/share/vm/memory/iterator.hpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/iterator.hpp	Fri May 17 11:57:05 2013 +0200
@@ -158,7 +158,7 @@
 };
 
 
-class BoolObjectClosure : public ObjectClosure {
+class BoolObjectClosure : public Closure {
  public:
   virtual bool do_object_b(oop obj) = 0;
 };
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp	Fri May 17 11:57:05 2013 +0200
@@ -252,7 +252,6 @@
   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 {
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp	Fri May 17 11:57:05 2013 +0200
@@ -212,7 +212,6 @@
 
 class AlwaysTrueClosure: public BoolObjectClosure {
 public:
-  void do_object(oop p) { ShouldNotReachHere(); }
   bool do_object_b(oop p) { return true; }
 };
 static AlwaysTrueClosure always_true;
--- a/hotspot/src/share/vm/runtime/jniHandles.cpp	Thu May 16 23:51:51 2013 +0200
+++ b/hotspot/src/share/vm/runtime/jniHandles.cpp	Fri May 17 11:57:05 2013 +0200
@@ -188,7 +188,6 @@
 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 {