RFR: 8282729: Serial: Move BOT implementation to collector specific directory
Axel Boldt-Christmas
duke at openjdk.org
Wed Jul 27 18:11:33 UTC 2022
Moves serial code from `share/gc/shared/blockOffsetTable.*` to `share/gc/serial/serialBlockOffsetTable.*`
Move required fixing up some missing header files.
Refactoring tries to respect `INCLUDE_SERIALGC` without changing any behaviour.
Given that `--disable-jvm-feature-serialgc` will not build before this change, it will not build afterwards either. However it does now compile, but will fail to link.
The diff below is enough to for `make hotspot` to run (on `macosx-aarch64`), but it will not build the complete JDK as the build system will use the compiled binaries with `-XX:+UseSerialGC` which obviously won't work as that GC is missing.
diff --git a/src/hotspot/share/gc/shared/genCollectedHeap.cpp b/src/hotspot/share/gc/shared/genCollectedHeap.cpp
index 5558f1a4a32..79b465b3e0a 100644
--- a/src/hotspot/share/gc/shared/genCollectedHeap.cpp
+++ b/src/hotspot/share/gc/shared/genCollectedHeap.cpp
@@ -31,7 +31,6 @@
#include "code/icBuffer.hpp"
#include "compiler/oopMap.hpp"
#include "gc/serial/defNewGeneration.hpp"
-#include "gc/serial/markSweep.hpp"
#include "gc/shared/adaptiveSizePolicy.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/cardTableRS.hpp"
@@ -80,6 +79,9 @@
#if INCLUDE_JVMCI
#include "jvmci/jvmci.hpp"
#endif
+#if INCLUDE_SERIALGC
+#include "gc/serial/markSweep.hpp"
+#endif
GenCollectedHeap::GenCollectedHeap(Generation::Name young,
Generation::Name old,
@@ -204,9 +206,9 @@ void GenCollectedHeap::post_initialize() {
initialize_size_policy(def_new_gen->eden()->capacity(),
_old_gen->capacity(),
def_new_gen->from()->capacity());
-
+#if INCLUDE_SERIALGC
MarkSweep::initialize();
-
+#endif
ScavengableNMethods::initialize(&_is_scavengable);
}
diff --git a/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp b/test/hotspot/gtest/gc/shared/test_collect
orPolicy.cpp
index dfe096248c7..30a24fd9232 100644
--- a/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp
+++ b/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp
@@ -31,6 +31,7 @@
#include "utilities/macros.hpp"
#include "unittest.hpp"
+#if INCLUDE_SERIALGC
class TestGenCollectorPolicy {
public:
@@ -279,3 +280,4 @@ TEST_OTHER_VM(CollectorPolicy, old_cmd) {
TestGenCollectorPolicy::TestWrapper::test(&setter_old_size, &setter_max_new_size, &checker_large);
}
+#endif
There is still a lot of Serial only code in the shared code base. The `share/gc/shared/space.*` is a clear next candidate for refactoring as this change required a bunch of code in there to depend on `INCLUDE_SERIALGC` to build.
Testing: Tier 1
-------------
Commit messages:
- 8282729: Serial: Move BOT implementation to collector specific directory
Changes: https://git.openjdk.org/jdk/pull/9662/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9662&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8282729
Stats: 1018 lines in 23 files changed: 73 ins; 909 del; 36 mod
Patch: https://git.openjdk.org/jdk/pull/9662.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9662/head:pull/9662
PR: https://git.openjdk.org/jdk/pull/9662
More information about the hotspot-gc-dev
mailing list