RFR: 8272520: Inline GenericTaskQueue::initialize() to the constructor

Kim Barrett kbarrett at openjdk.java.net
Mon Aug 16 14:33:23 UTC 2021


On Mon, 16 Aug 2021 13:09:03 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Simple refactoring of GenericTaskQueue initialization API.
> 
> Test: tier1_gc

Looks good.  Just a couple minor nits.

src/hotspot/share/gc/shared/taskqueue.inline.hpp line 53:

> 51: template<class E, MEMFLAGS F, unsigned int N>
> 52: inline GenericTaskQueue<E, F, N>::GenericTaskQueue() : _last_stolen_queue_id(InvalidQueueId), _seed(17 /* random number */) {
> 53:   assert(sizeof(Age) == sizeof(size_t), "Depends on this.");

[pre-existing] This assert is over-constraining.  The real requirement is static-asserted in the Age class.

src/hotspot/share/gc/shared/taskqueue.inline.hpp line 54:

> 52: inline GenericTaskQueue<E, F, N>::GenericTaskQueue() : _last_stolen_queue_id(InvalidQueueId), _seed(17 /* random number */) {
> 53:   assert(sizeof(Age) == sizeof(size_t), "Depends on this.");
> 54:   _elems = ArrayAllocator<E>::allocate(N, F);

`_elems` could be initialized in the mem-initializer-list.

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

Marked as reviewed by kbarrett (Reviewer).

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



More information about the hotspot-gc-dev mailing list