On Thu, 11 Jun 2026 18:26:09 GMT, Aleksey Shipilev <[email protected]> wrote:

>> You can add `assert` here so that future support will notify the lack of 
>> support from C2 here.
>
> Maybe? I do not have time for this this week, but I can try next week. What 
> exactly are you having in mind? Putting down some feature flags when 
> Shenandoah is enabled?

In `fieldLayoutBuilder.cpp`, we have this:

    if (UseNullableNonAtomicValueFlattening) {
      _nullable_non_atomic_layout_size_in_bytes = new_raw_size;
      _null_marker_offset = null_marker_offset;
      _null_free_non_atomic_layout_alignment = _payload_alignment;
    }
    if (UseNullableValueFlattening) {
      // For the nullable atomic layout, the size mut be compatible with the 
platform capabilities
      int nullable_atomic_size = round_up_power_of_2(new_raw_size);
      if (nullable_atomic_size <= (int)MAX_ATOMIC_OP_SIZE) {
        _nullable_atomic_layout_size_in_bytes = nullable_atomic_size;
        _null_marker_offset = null_marker_offset;
      }
    }

I wonder if it is a good idea to insert a little bit of code here to disable 
these when `UseShenandoahGC` is `true` and the layout has oop. What do you 
think @fparain?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1971#discussion_r3405652859

Reply via email to