8189734: Cleanup MarkSweep when G1 dependency is gone
authorsjohanss
Wed, 15 Nov 2017 17:05:28 +0100
changeset 47897 eb3696e0c6d8
parent 47896 7092940fbaff
child 47898 acaf894a5b5d
8189734: Cleanup MarkSweep when G1 dependency is gone Reviewed-by: sangheki, tschatzl
src/hotspot/share/gc/serial/genMarkSweep.cpp
src/hotspot/share/gc/serial/genMarkSweep.hpp
src/hotspot/share/gc/serial/markSweep.cpp
src/hotspot/share/gc/serial/markSweep.hpp
src/hotspot/share/gc/serial/markSweep.inline.hpp
--- a/src/hotspot/share/gc/serial/genMarkSweep.cpp	Wed Nov 15 08:25:28 2017 -0500
+++ b/src/hotspot/share/gc/serial/genMarkSweep.cpp	Wed Nov 15 17:05:28 2017 +0100
@@ -167,10 +167,8 @@
 
 
 void GenMarkSweep::deallocate_stacks() {
-  if (!UseG1GC) {
-    GenCollectedHeap* gch = GenCollectedHeap::heap();
-    gch->release_scratch();
-  }
+  GenCollectedHeap* gch = GenCollectedHeap::heap();
+  gch->release_scratch();
 
   _preserved_mark_stack.clear(true);
   _preserved_oop_stack.clear(true);
--- a/src/hotspot/share/gc/serial/genMarkSweep.hpp	Wed Nov 15 08:25:28 2017 -0500
+++ b/src/hotspot/share/gc/serial/genMarkSweep.hpp	Wed Nov 15 17:05:28 2017 +0100
@@ -29,7 +29,6 @@
 
 class GenMarkSweep : public MarkSweep {
   friend class VM_MarkSweep;
-  friend class G1MarkSweep;
  public:
   static void invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_softrefs);
 
--- a/src/hotspot/share/gc/serial/markSweep.cpp	Wed Nov 15 08:25:28 2017 -0500
+++ b/src/hotspot/share/gc/serial/markSweep.cpp	Wed Nov 15 17:05:28 2017 +0100
@@ -40,9 +40,6 @@
 #include "oops/typeArrayOop.inline.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/stack.inline.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc/g1/g1StringDedup.hpp"
-#endif // INCLUDE_ALL_GCS
 
 uint                    MarkSweep::_total_invocations = 0;
 
@@ -79,8 +76,7 @@
   T heap_oop = oopDesc::load_heap_oop(p);
   if (!oopDesc::is_null(heap_oop)) {
     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
-    if (!obj->mark()->is_marked() &&
-        !is_closed_archive_object(obj)) {
+    if (!obj->mark()->is_marked()) {
       mark_object(obj);
       _marking_stack.push(obj);
     }
@@ -176,8 +172,7 @@
   T heap_oop = oopDesc::load_heap_oop(p);
   if (!oopDesc::is_null(heap_oop)) {
     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
-    if (!obj->mark()->is_marked() &&
-        !is_closed_archive_object(obj)) {
+    if (!obj->mark()->is_marked()) {
       mark_object(obj);
       follow_object(obj);
     }
@@ -261,7 +256,7 @@
 
 MarkSweep::IsAliveClosure   MarkSweep::is_alive;
 
-bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked() || is_closed_archive_object(p); }
+bool MarkSweep::IsAliveClosure::do_object_b(oop p) { return p->is_gc_marked(); }
 
 MarkSweep::KeepAliveClosure MarkSweep::keep_alive;
 
--- a/src/hotspot/share/gc/serial/markSweep.hpp	Wed Nov 15 08:25:28 2017 -0500
+++ b/src/hotspot/share/gc/serial/markSweep.hpp	Wed Nov 15 17:05:28 2017 +0100
@@ -133,11 +133,6 @@
   static ReferenceProcessor* const ref_processor() { return _ref_processor; }
   static void set_ref_processor(ReferenceProcessor* rp);
 
-  // Archive Object handling
-  static inline bool is_closed_archive_object(oop object);
-  static inline bool is_open_archive_object(oop object);
-  static inline bool is_archive_object(oop object);
-
   static STWGCTimer* gc_timer() { return _gc_timer; }
   static SerialOldTracer* gc_tracer() { return _gc_tracer; }
 
--- a/src/hotspot/share/gc/serial/markSweep.inline.hpp	Wed Nov 15 08:25:28 2017 -0500
+++ b/src/hotspot/share/gc/serial/markSweep.inline.hpp	Wed Nov 15 17:05:28 2017 +0100
@@ -30,33 +30,6 @@
 #include "memory/universe.hpp"
 #include "oops/markOop.inline.hpp"
 #include "oops/oop.inline.hpp"
-#if INCLUDE_ALL_GCS
-#include "gc/g1/g1Allocator.inline.hpp"
-#endif // INCLUDE_ALL_GCS
-
-inline bool MarkSweep::is_closed_archive_object(oop object) {
-#if INCLUDE_ALL_GCS
-  return G1ArchiveAllocator::is_closed_archive_object(object);
-#else
-  return false;
-#endif
-}
-
-inline bool MarkSweep::is_open_archive_object(oop object) {
-#if INCLUDE_ALL_GCS
-  return G1ArchiveAllocator::is_open_archive_object(object);
-#else
-  return false;
-#endif
-}
-
-inline bool MarkSweep::is_archive_object(oop object) {
-#if INCLUDE_ALL_GCS
-  return G1ArchiveAllocator::is_archive_object(object);
-#else
-  return false;
-#endif
-}
 
 inline int MarkSweep::adjust_pointers(oop obj) {
   return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
@@ -70,27 +43,16 @@
 
     oop new_obj = oop(obj->mark()->decode_pointer());
 
-    assert(is_archive_object(obj) ||             // no forwarding of archive objects
-           new_obj != NULL ||                         // is forwarding ptr?
+    assert(new_obj != NULL ||                         // is forwarding ptr?
            obj->mark() == markOopDesc::prototype() || // not gc marked?
            (UseBiasedLocking && obj->mark()->has_bias_pattern()),
            // not gc marked?
            "should be forwarded");
 
-#ifndef PRODUCT
-    // open_archive objects are marked by GC. Their mark should
-    // not have forwarding ptr.
-    if (is_open_archive_object(obj)) {
-      assert(new_obj == NULL, "archive heap object has forwarding ptr");
-    }
-#endif
-
     if (new_obj != NULL) {
-      if (!is_closed_archive_object(obj)) {
-        assert(Universe::heap()->is_in_reserved(new_obj),
-              "should be in object space");
-        oopDesc::encode_store_heap_oop_not_null(p, new_obj);
-      }
+      assert(Universe::heap()->is_in_reserved(new_obj),
+             "should be in object space");
+      oopDesc::encode_store_heap_oop_not_null(p, new_obj);
     }
   }
 }