RFR: 8329529: Serial: Move _saved_mark_word out of ContiguousSpace

Albert Mingkun Yang ayang at openjdk.org
Wed Apr 3 12:51:09 UTC 2024


On Wed, 3 Apr 2024 12:18:40 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch removes the field `ContiguousSpace::_saved_mark_word` and its related methods, adds the corresponding fields to `DefNewGeneration` and `TenuredGeneration`, and moves the method `ContiguousSpace::oop_since_save_marks_iterate` to `Generation`. Many usages are adjusted as well.
> 
> An alternative way is add a class which extends the `ContiguousSpace` to place `_saved_mark_word` and its related methods. But this way would increase the class hierarchy. Not really know whether it deserves to do that.
> 
> The tests `make test-tier1_gc` passed locally. Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

src/hotspot/share/gc/serial/defNewGeneration.hpp line 143:

> 141:   // Saved mark word
> 142:   HeapWord* _eden_saved_mark_word;
> 143:   HeapWord* _from_saved_mark_word;

Are they really needed? I'd expect `saved_mark_word` to be useful only for copy-destination, i.e. to-space and old-gen.

src/hotspot/share/gc/serial/generation.hpp line 230:

> 228:   } while (t < space->top());
> 229: 
> 230:   *saved_mark_word = space->top();

Pre-existing: I kind of feel this "write" action doesn't belong to this method; accessing the saved-mark-word makes more sense to be in the caller, IMO.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18603#discussion_r1549655827
PR Review Comment: https://git.openjdk.org/jdk/pull/18603#discussion_r1549672320


More information about the hotspot-gc-dev mailing list