On Tue, 24 Mar 2026 08:52:19 GMT, Yasumasa Suenaga <[email protected]> wrote:

> According to [Javadoc of 
> `jdk.incubator.vector.Vector`](https://docs.oracle.com/en/java/javase/26/docs/api/jdk.incubator.vector/jdk/incubator/vector/Vector.html),
>  vector classes are declared as value based class. However all vector classes 
> (e.g. `IntVector256`) do not have `@jdk.internal.ValueBased`, so 
> `DiagnoseSyncOnValueBasedClasses` does not affect if vector object are used 
> as a monitor.
> 
> This PR fixes all of final classes of vector, but most of files were 
> generated by `gen-src.sh`. Essense of this PR is a chenge for 
> `X-VectorBits.java.template`.
> After this change, we can see following logs if 
> `-XX:DiagnoseSyncOnValueBasedClasses` is set and vector class is used as 
> monitor object.
> 
> 
> $ java --add-modules jdk.incubator.vector 
> -XX:DiagnoseSyncOnValueBasedClasses=2  ValueBaseLock
> WARNING: Using incubator modules: jdk.incubator.vector
> [0.453s][info][valuebasedclasses] Synchronizing on object 0x00000000823b1258 
> of klass jdk.incubator.vector.IntVector256
> [0.453s][info][valuebasedclasses]       at 
> ValueBaseLock.run(ValueBaseLock.java:9)
> [0.453s][info][valuebasedclasses]       - locked <0x00000000823b1258> (a 
> jdk.incubator.vector.IntVector256)
> [0.453s][info][valuebasedclasses]       at 
> java.lang.Thread.runWith(java.base@27-internal/Thread.java:1540)
> [0.453s][info][valuebasedclasses]       at 
> java.lang.Thread.run(java.base@27-internal/Thread.java:1527)

This pull request has now been integrated.

Changeset: 960161db
Author:    Yasumasa Suenaga <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/960161db82191b679b92094c8bd661e868dfb424
Stats:     124 lines in 31 files changed: 62 ins; 0 del; 62 mod

8380764: Vector classes should have @ValueBased

Reviewed-by: liach

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

PR: https://git.openjdk.org/jdk/pull/30392

Reply via email to