8076231: Remove unused is_in_partial_collection()
authorpliden
Tue, 31 Mar 2015 08:27:30 +0200
changeset 29803 6e259ffa8b72
parent 29802 d485440c958a
child 29804 dcb9861190d2
8076231: Remove unused is_in_partial_collection() Reviewed-by: brutisso, drwhite
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/parallelScavengeHeap.cpp
hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp
hotspot/src/share/vm/gc_interface/collectedHeap.hpp
hotspot/src/share/vm/memory/genCollectedHeap.cpp
hotspot/src/share/vm/memory/genCollectedHeap.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Mar 31 08:27:30 2015 +0200
@@ -402,25 +402,6 @@
   return hr;
 }
 
-#ifdef ASSERT
-// A region is added to the collection set as it is retired
-// so an address p can point to a region which will be in the
-// collection set but has not yet been retired.  This method
-// therefore is only accurate during a GC pause after all
-// regions have been retired.  It is used for debugging
-// to check if an nmethod has references to objects that can
-// be move during a partial collection.  Though it can be
-// inaccurate, it is sufficient for G1 because the conservative
-// implementation of is_scavengable() for G1 will indicate that
-// all nmethods must be scanned during a partial collection.
-bool G1CollectedHeap::is_in_partial_collection(const void* p) {
-  if (p == NULL) {
-    return false;
-  }
-  return heap_region_containing(p)->in_collection_set();
-}
-#endif
-
 // Returns true if the reference points to an object that
 // can move in an incremental collection.
 bool G1CollectedHeap::is_scavengable(const void* p) {
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp	Tue Mar 31 08:27:30 2015 +0200
@@ -1379,10 +1379,6 @@
 
   inline bool is_in_young(const oop obj);
 
-#ifdef ASSERT
-  virtual bool is_in_partial_collection(const void* p);
-#endif
-
   virtual bool is_scavengable(const void* addr);
 
   // We don't need barriers for initializing stores to objects
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp	Tue Mar 31 08:27:30 2015 +0200
@@ -203,17 +203,6 @@
   return is_in_young((oop)addr);
 }
 
-#ifdef ASSERT
-// Don't implement this by using is_in_young().  This method is used
-// in some cases to check that is_in_young() is correct.
-bool ParallelScavengeHeap::is_in_partial_collection(const void *p) {
-  assert(is_in_reserved(p) || p == NULL,
-    "Does not work if address is non-null and outside of the heap");
-  // The order of the generations is old (low addr), young (high addr)
-  return p >= old_gen()->reserved().end();
-}
-#endif
-
 // There are two levels of allocation policy here.
 //
 // When an allocation request fails, the requesting thread must invoke a VM
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp	Tue Mar 31 08:27:30 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -141,10 +141,6 @@
 
   bool is_in_reserved(const void* p) const;
 
-#ifdef ASSERT
-  virtual bool is_in_partial_collection(const void *p);
-#endif
-
   bool is_in_young(oop p);  // reserved part
   bool is_in_old(oop p);    // reserved part
 
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp	Tue Mar 31 08:27:30 2015 +0200
@@ -291,12 +291,6 @@
     return p == NULL || is_in_closed_subset(p);
   }
 
-#ifdef ASSERT
-  // Returns true if "p" is in the part of the
-  // heap being collected.
-  virtual bool is_in_partial_collection(const void *p) = 0;
-#endif
-
   // An object is scavengable if its location may move during a scavenge.
   // (A scavenge is a GC which is not a full GC.)
   virtual bool is_scavengable(const void *p) = 0;
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Tue Mar 31 08:27:30 2015 +0200
@@ -572,7 +572,7 @@
 class AssertNonScavengableClosure: public OopClosure {
 public:
   virtual void do_oop(oop* p) {
-    assert(!Universe::heap()->is_in_partial_collection(*p),
+    assert(!GenCollectedHeap::heap()->is_in_partial_collection(*p),
       "Referent should not be scavengable.");  }
   virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
 };
--- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Tue Mar 31 07:54:56 2015 +0200
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp	Tue Mar 31 08:27:30 2015 +0200
@@ -215,7 +215,7 @@
   bool is_in_young(oop p);
 
 #ifdef ASSERT
-  virtual bool is_in_partial_collection(const void* p);
+  bool is_in_partial_collection(const void* p);
 #endif
 
   virtual bool is_scavengable(const void* addr) {