8155943: Move G1Eden/SurvivorRegions into their own source files
authormgerdin
Wed, 04 May 2016 13:12:23 +0200
changeset 38186 ccaa890f8617
parent 38185 c432f8466c73
child 38187 f1879f6d7e63
child 38188 e76af590ea2f
8155943: Move G1Eden/SurvivorRegions into their own source files Reviewed-by: sjohanss, ehelin
hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp
hotspot/src/share/vm/gc/g1/g1DefaultPolicy.cpp
hotspot/src/share/vm/gc/g1/g1EdenRegions.hpp
hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp
hotspot/src/share/vm/gc/g1/g1SurvivorRegions.cpp
hotspot/src/share/vm/gc/g1/g1SurvivorRegions.hpp
hotspot/src/share/vm/gc/g1/youngList.cpp
hotspot/src/share/vm/gc/g1/youngList.hpp
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Wed Apr 27 16:20:05 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp	Wed May 04 13:12:23 2016 +0200
@@ -31,18 +31,19 @@
 #include "gc/g1/g1CollectionSet.hpp"
 #include "gc/g1/g1CollectorState.hpp"
 #include "gc/g1/g1ConcurrentMark.hpp"
+#include "gc/g1/g1EdenRegions.hpp"
+#include "gc/g1/g1EvacFailure.hpp"
+#include "gc/g1/g1EvacStats.hpp"
+#include "gc/g1/g1HeapVerifier.hpp"
 #include "gc/g1/g1HRPrinter.hpp"
 #include "gc/g1/g1InCSetState.hpp"
 #include "gc/g1/g1MonitoringSupport.hpp"
-#include "gc/g1/g1EvacFailure.hpp"
-#include "gc/g1/g1EvacStats.hpp"
-#include "gc/g1/g1HeapVerifier.hpp"
 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
+#include "gc/g1/g1SurvivorRegions.hpp"
 #include "gc/g1/g1YCTypes.hpp"
 #include "gc/g1/hSpaceCounters.hpp"
 #include "gc/g1/heapRegionManager.hpp"
 #include "gc/g1/heapRegionSet.hpp"
-#include "gc/g1/youngList.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/plab.hpp"
--- a/hotspot/src/share/vm/gc/g1/g1DefaultPolicy.cpp	Wed Apr 27 16:20:05 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1DefaultPolicy.cpp	Wed May 04 13:12:23 2016 +0200
@@ -34,10 +34,10 @@
 #include "gc/g1/g1IHOPControl.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1Policy.hpp"
+#include "gc/g1/g1SurvivorRegions.hpp"
 #include "gc/g1/g1YoungGenSizer.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
-#include "gc/g1/youngList.hpp"
 #include "gc/shared/gcPolicyCounters.hpp"
 #include "logging/logStream.hpp"
 #include "runtime/arguments.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1EdenRegions.hpp	Wed May 04 13:12:23 2016 +0200
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1EDENREGIONS_HPP
+#define SHARE_VM_GC_G1_G1EDENREGIONS_HPP
+
+#include "gc/g1/heapRegion.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/globals.hpp"
+#include "utilities/debug.hpp"
+
+class G1EdenRegions VALUE_OBJ_CLASS_SPEC {
+private:
+  int _length;
+
+public:
+  G1EdenRegions() : _length(0) {}
+
+  void add(HeapRegion* hr) {
+    assert(!hr->is_eden(), "should not already be set");
+    _length++;
+  }
+
+  void clear() { _length = 0; }
+
+  uint length() const { return _length; }
+};
+
+#endif // SHARE_VM_GC_G1_G1EDENREGIONS_HPP
--- a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp	Wed Apr 27 16:20:05 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp	Wed May 04 13:12:23 2016 +0200
@@ -36,7 +36,6 @@
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
 #include "gc/g1/g1StringDedup.hpp"
-#include "gc/g1/youngList.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1SurvivorRegions.cpp	Wed May 04 13:12:23 2016 +0200
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2015, 2016, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/g1/g1SurvivorRegions.hpp"
+#include "gc/g1/heapRegion.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/debug.hpp"
+
+G1SurvivorRegions::G1SurvivorRegions() : _regions(new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapRegion*>(8, true, mtGC)) {}
+
+void G1SurvivorRegions::add(HeapRegion* hr) {
+  assert(hr->is_survivor(), "should be flagged as survivor region");
+  _regions->append(hr);
+}
+
+uint G1SurvivorRegions::length() const {
+  return (uint)_regions->length();
+}
+
+void G1SurvivorRegions::convert_to_eden() {
+  for (GrowableArrayIterator<HeapRegion*> it = _regions->begin();
+       it != _regions->end();
+       ++it) {
+    HeapRegion* hr = *it;
+    hr->set_eden_pre_gc();
+  }
+  clear();
+}
+
+void G1SurvivorRegions::clear() {
+  _regions->clear();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1SurvivorRegions.hpp	Wed May 04 13:12:23 2016 +0200
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_G1_G1SURVIVORREGIONS_HPP
+#define SHARE_VM_GC_G1_G1SURVIVORREGIONS_HPP
+
+#include "memory/allocation.hpp"
+#include "runtime/globals.hpp"
+
+template <typename T>
+class GrowableArray;
+class HeapRegion;
+
+class G1SurvivorRegions VALUE_OBJ_CLASS_SPEC {
+private:
+  GrowableArray<HeapRegion*>* _regions;
+
+public:
+  G1SurvivorRegions();
+
+  void add(HeapRegion* hr);
+
+  void convert_to_eden();
+
+  void clear();
+
+  uint length() const;
+
+  const GrowableArray<HeapRegion*>* regions() const {
+    return _regions;
+  }
+};
+
+#endif // SHARE_VM_GC_G1_G1SURVIVORREGIONS_HPP
--- a/hotspot/src/share/vm/gc/g1/youngList.cpp	Wed Apr 27 16:20:05 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015, 2016, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc/g1/heapRegion.hpp"
-#include "gc/g1/youngList.hpp"
-#include "utilities/growableArray.hpp"
-#include "utilities/debug.hpp"
-
-G1SurvivorRegions::G1SurvivorRegions() : _regions(new (ResourceObj::C_HEAP, mtGC) GrowableArray<HeapRegion*>(8, true, mtGC)) {}
-
-void G1SurvivorRegions::add(HeapRegion* hr) {
-  assert(hr->is_survivor(), "should be flagged as survivor region");
-  _regions->append(hr);
-}
-
-uint G1SurvivorRegions::length() const {
-  return (uint)_regions->length();
-}
-
-void G1SurvivorRegions::convert_to_eden() {
-  for (GrowableArrayIterator<HeapRegion*> it = _regions->begin();
-       it != _regions->end();
-       ++it) {
-    HeapRegion* hr = *it;
-    hr->set_eden_pre_gc();
-  }
-  clear();
-}
-
-void G1SurvivorRegions::clear() {
-  _regions->clear();
-}
-
-void G1EdenRegions::add(HeapRegion* hr) {
-  assert(!hr->is_eden(), "should not already be set");
-  _length++;
-}
--- a/hotspot/src/share/vm/gc/g1/youngList.hpp	Wed Apr 27 16:20:05 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_G1_YOUNGLIST_HPP
-#define SHARE_VM_GC_G1_YOUNGLIST_HPP
-
-#include "memory/allocation.hpp"
-#include "runtime/globals.hpp"
-
-template <typename T>
-class GrowableArray;
-
-class G1SurvivorRegions VALUE_OBJ_CLASS_SPEC {
-private:
-  GrowableArray<HeapRegion*>* _regions;
-
-public:
-  G1SurvivorRegions();
-
-  void add(HeapRegion* hr);
-
-  void convert_to_eden();
-
-  void clear();
-
-  uint length() const;
-
-  const GrowableArray<HeapRegion*>* regions() const {
-    return _regions;
-  }
-};
-
-class G1EdenRegions VALUE_OBJ_CLASS_SPEC {
-private:
-  int _length;
-
-public:
-  G1EdenRegions() : _length(0) {}
-
-  void add(HeapRegion* hr);
-
-  void clear() { _length = 0; }
-
-  uint length() const { return _length; }
-};
-
-#endif // SHARE_VM_GC_G1_YOUNGLIST_HPP