On Fri, 31 Jul 2026 01:46:02 GMT, Chen Liang <[email protected]> wrote:

> Represent Vector API payload objects (`Vector`, `VectorMask`, 
> `VectorShuffle`) and `Float16` as value objects when preview features are 
> enabled. This makes them more closely resemble the SIMD registers they try to 
> model.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Note that the [`lworld+vector`] branch also has changes to [`VectorSupport`] to 
include a [multi‑field]‑based approach[^1], thus avoiding identity issues 
caused by the use of arrays.

[^1]: Which act like fixed‑size [frozen value arrays][jep‑frozen‑arrays] (as in 
frozen arrays that are values)

[`lworld+vector`]: https://github.com/openjdk/valhalla/tree/lworld+vector
[`VectorSupport`]: 
https://github.com/openjdk/valhalla/blob/lworld+vector/src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java#L179
[multi‑field]: 
https://github.com/openjdk/valhalla/blob/lworld+vector/src/java.base/share/classes/jdk/internal/vm/annotation/MultiField.java
[jep‑frozen‑arrays]: https://openjdk.org/jeps/8261007

src/java.base/share/classes/jdk/internal/vm/vector/VectorSupport.java line 171:

> 169:         public VectorPayload(Object payload) {
> 170:             this.payload = payload;
> 171:         }

This probably should do the `this.payload` assignment before the `super()` 
call, even when preview features are disabled:
Suggestion:

        public VectorPayload(Object payload) {
            this.payload = payload;
            super();
        }

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

PR Review: https://git.openjdk.org/jdk/pull/32113#pullrequestreview-4843616460
PR Review Comment: https://git.openjdk.org/jdk/pull/32113#discussion_r3703554285

Reply via email to