RFR: 8282729: Serial: Move BOT implementation to collector specific directory [v3]

Thomas Schatzl tschatzl at openjdk.org
Tue Aug 23 08:00:32 UTC 2022


On Fri, 19 Aug 2022 12:04:38 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> 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
>
> Axel Boldt-Christmas has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Remove unused headers
>  - Merge remote-tracking branch 'upstream/master' into JDK-8282729
>  - Revert header include cleanup
>  - 8282729: Serial: Move BOT implementation to collector specific directory

Still good.

-------------

Marked as reviewed by tschatzl (Reviewer).

PR: https://git.openjdk.org/jdk/pull/9662



More information about the hotspot-gc-dev mailing list