RFR: 8279856: Parallel: Use PreservedMarks to record promotion-failed objects [v2]

Stefan Johansson sjohanss at openjdk.java.net
Wed Jan 26 10:17:41 UTC 2022


On Tue, 25 Jan 2022 15:40:50 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/shared/preservedMarks.hpp line 60:
>> 
>>> 58:   size_t size() const { return _stack.size(); }
>>> 59:   inline void push_if_necessary(oop obj, markWord m);
>>> 60:   inline void push_always(oop obj, markWord m);
>> 
>> Any reason not to just call this `push()` like we had in the past and maybe also re-use it in `push_if_necessary()`?
>
> I was thinking `push_always` makes a clearer contrast with its neighbor: the two are parallel and there's no interconnection/dependency btw them.

Sure, but they do push elements the same way so it could be shared to avoid having to change two places if anything needs updating in the future. That said, the code is small and live close together so should be fine if you prefer it this way.

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

PR: https://git.openjdk.java.net/jdk/pull/7028



More information about the hotspot-gc-dev mailing list