On Tue, 27 Jan 2026 09:25:22 GMT, Quan Anh Mai <[email protected]> wrote:

>> Hi,
>> 
>> This PR implements the support of `NULLABLE_NON_ATOMIC_FLAT` layout in the 
>> JITs. There is nothing to do in C2. In C1, I need to implement 
>> loading/storing nullable value of a non-atomic field.
>> 
>> The test `TestValueClasses` is failing with `-XX:-TieredCompilation`, which 
>> I suspect is due to the substitutability test handling padding bytes 
>> incorrectly.
>> 
>> Please kindly review what there are for now, thanks a lot.
>
> Quan Anh Mai has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - no_null_marker
>  - rename null_free in InlineTypeNode::initialize_fields to has_null_marker

I have pushed a commit that should have fixed the remaining issues:

- The code to unpack value objects must zero all the field values if the object 
is `null` because the runtime requires a canonical representation of `null`.
- Remove `ciInlineKlass::must_be_atomic` in favor of a more consolidated 
`ciField::is_atomic`.
- The `null_free` value in `InlineTypeNode::initialize_fields` merely means 
that there is no projection for the null marker. This is the reason why we just 
pass `true` to the recursive call for subfields. I have renamed the parameter. 
There is also a variable hiding there. The expectation is that if the field is 
null free, and the holder object is null free, than the field value is not 
null. This is incorrect, given:

    ```
    class A {
        B v;
    }

    value class B {
        null-free C v;
    }
    ```

Then, `A.v.v` is nullable because `A.v` is nullable. To fix this, I remove the 
cast that informs the compiler that the oop is null-free.

- `Unsafe_newSpecialArray` should throw exception for `NULLABLE_NON_ATOMIC`. 
Currently, it sneaks past the check and causes a crash
- Fix some tests that did not expect the existence of `NULLABLE_NON_ATOMIC`.
- Problemlist `serviceability/jvmti/valhalla/HeapDump/HeapDump.java` : 
[JDK-8376461](https://bugs.openjdk.org/browse/JDK-8376461)
- Clean up as suggested by @TobiHartmann

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

PR Comment: https://git.openjdk.org/valhalla/pull/1970#issuecomment-3804108652

Reply via email to