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

Ivan Walulya iwalulya at openjdk.org
Fri May 17 07:26:10 UTC 2024


On Fri, 17 May 2024 07:17:13 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> 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`.

Then better to keep the verb in the comment ` // Does nothing`

>> 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`?

I prefer that to the "no_gc_locker" emphasizing names

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19056#discussion_r1604466593
PR Review Comment: https://git.openjdk.org/jdk/pull/19056#discussion_r1604465894


More information about the serviceability-dev mailing list