RFR: 8329431: Improve speed of writing CDS heap objects [v2]

Ioi Lam iklam at openjdk.org
Mon Apr 8 03:02:05 UTC 2024


On Tue, 2 Apr 2024 21:58:07 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   @matias9927 and @calvinccheung comments
>
> src/hotspot/share/cds/archiveHeapWriter.cpp line 233:
> 
>> 231: static int oop_sorting_rank(oop o) {
>> 232:   bool has_oop_ptr, has_native_ptr;
>> 233:     HeapShared::get_pointer_info(o, has_oop_ptr, has_native_ptr);
> 
> Please align line 233 with line 232.

Fixed.

> src/hotspot/share/cds/heapShared.cpp line 289:
> 
>> 287:     CachedOopInfo info = make_cached_oop_info(obj);
>> 288:     archived_object_cache()->put(obj, info);
>> 289:     archived_object_cache()->maybe_grow();
> 
> Is it possible to use `put_if_absent()` and only calls `maybe_grow()` if an entry has been created? Similar to what is being done in `HeapShared::add_to_dumped_interned_strings()`.

The entry is guaranteed to not exist. I changed the call to `put_when_absent()`, which asserts that no current entry exists. (Yes, the naming of `put_when_absent()` is confusing w.r.t. `put_if_absent()`).

> src/hotspot/share/cds/heapShared.cpp line 1413:
> 
>> 1411:   assert(!has_been_seen_during_subgraph_recording(obj), "sanity");
>> 1412:   _seen_objects_table->put(obj, true);
>> 1413:   _seen_objects_table->maybe_grow();
> 
> Same comment as above.

Fixed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18572#discussion_r1555172935
PR Review Comment: https://git.openjdk.org/jdk/pull/18572#discussion_r1555173023
PR Review Comment: https://git.openjdk.org/jdk/pull/18572#discussion_r1555172947


More information about the hotspot-runtime-dev mailing list