[lworld] RFR: 8373494: [lworld] markWord preservation for ParallelGC [v2]
Joel Sikström
jsikstro at openjdk.org
Fri Dec 12 08:44:05 UTC 2025
On Thu, 11 Dec 2025 12:55:41 GMT, Paul Hübner <phubner at openjdk.org> wrote:
>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 1481:
>>
>>> 1479: const bool full_header_in_current_region = cur_addr + oopDesc::header_size() <= end;
>>> 1480:
>>> 1481: if (EnableValhalla && !full_header_in_current_region) {
>>
>> We could make this criteria even more specific by checking something like the following, but I'm not sure it's worth it since not copying the full header in the same region is pretty rare.
>>
>>
>> static bool requires_valhalla_preservation(markWord mark) {
>> return EnableValhalla && (mark.is_larval_state() || mark.is_null_free_array() || mark.is_flat_array() || mark.is_inline_type());
>> }
>
> If I understand it correctly, the version you have right now is less conservative than `requires_valhalla_preservation` which may include false positives. I think I'm inclined to checking region containment, it also makes maintainability easier down the line (if we end up changing the markWord bits).
Yes, the version I have is less conservative than it could be, and I agree that this makes the code easier to maintain.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1785#discussion_r2613389856
More information about the valhalla-dev
mailing list