RFR: 8321033: Avoid casting Array to GrowableArray [v2]

Ioi Lam iklam at openjdk.org
Thu Jun 13 21:01:16 UTC 2024


On Wed, 5 Jun 2024 04:01:22 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Matias Saavedra Silva has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into reads_8321033
>>  - Changed generic pointer to union
>>  - 8321033: Avoid casting Array to GrowableArray
>
> src/hotspot/share/classfile/moduleEntry.cpp line 473:
> 
>> 471:     if (_reads == nullptr) { _reads_is_growable = true; }
>> 472:   )
>> 473:   set_archived_reads(write_growable_array(reads()));
> 
> I don't really like this forcing of the flag to make the call to reads() happy.  Maybe something like the
> following instead?
> 
> GrowableArray<ModuleEntry*>* entries = nullptr;
> if (_reads != nullptr) { entries = reads(); }
> set_archived_reads(write_growable_array(entries));
> 
> Similarly in load_from_archive with the other flag.

The `DEBUG_ONLY` block can be removed?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19549#discussion_r1638917154


More information about the hotspot-runtime-dev mailing list