RFR: 8331557: Serial: Refactor SerialHeap::do_collection [v6]

Albert Mingkun Yang ayang at openjdk.org
Fri May 17 07:26:09 UTC 2024


On Fri, 17 May 2024 06:02:31 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> Albert Mingkun Yang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
>> 
>>  - Merge branch 'master' into s1-do-collect
>>  - review
>>  - Merge branch 'master' into s1-do-collect
>>  - merge
>>  - review
>>  - Merge branch 'master' into s1-do-collect
>>  - s1-do-collect
>
> src/hotspot/share/gc/serial/serialHeap.cpp line 907:
> 
>> 905: 
>> 906: void SerialHeap::print_tracing_info() const {
>> 907:  // Nothing
> 
> What is the `Nothing` supposed to convey here?

To emphasize that this empty method is intentional, inspired by `ZCollectedHeap::print_tracing_info`.

> src/hotspot/share/gc/serial/serialHeap.hpp line 117:
> 
>> 115:   void do_full_collection_no_gc_locker(bool clear_all_soft_refs);
>> 116: 
>> 117:   void collect_at_safepoint_no_gc_locker(bool full);
> 
> I am not very convinced by the naming of the methods with the "no_gc_locker" constraint.  But I guess it is following same convention as "*at_safepoint" method naming.

How about calling them `try_x` and `x` for the public and private API, respectively, e.g. `try_do_full_collection` and `do_full_collection`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19056#discussion_r1604459781
PR Review Comment: https://git.openjdk.org/jdk/pull/19056#discussion_r1604462152


More information about the serviceability-dev mailing list