From roger.riggs at oracle.com Thu Jan 2 14:12:32 2025 From: roger.riggs at oracle.com (Roger Riggs) Date: Thu, 2 Jan 2025 09:12:32 -0500 Subject: Current thinking about the future nullability of java.time.Duration In-Reply-To: References: Message-ID: Hi, In addition, changing from null allowed to null-restricted in APIs would be an incompatible change. So existing uses would not be changed. It would be advisable (as always) in new APIs to be very specific about the meaning of null; throwing or allowed. As currently specified, there is no clean Duration value that could be used as a sentinel (alternative to null) except in a some application specific use. Happy New Year, Roger On 12/29/24 2:48 PM, Glavo wrote: > Hi?Jean-No?l, > > From what I understand, the null-restricted types are use-site > specified, which means that `Duration` is not null-restricted, but > `Duration!` is null-restricted,?even though it is a value class. > > It is also worth noting that null-restricted types are not a > requirement for flattening value objects. > For a variable of a nullable value type, Valhalla may use a "null > channel" to distinguish between null and non-null values. > The null channel could be a boolean variable or something else, you > can read?this article[1] to learn more about it. > > Glavo > > [1]: https://cr.openjdk.org/~jrose/values/flattened-values.html > > On Mon, Dec 30, 2024 at 12:49?AM Jean-No?l Rouvignac > wrote: > > Hello, > > I have a use case for configuration objects where I would like to > use?java.time.Duration to represent time intervals, timeouts, > delays, etc. for example. > > In these configuration objects, sometimes users may not provide a > value, and the configuration framework does not have a default > value for it either. This is to be interpreted as "disable the > feature" or "let the library decide". For this specific case, I > was considering returning `null` to mean "disable the feature" or > "let the library decide". > > java.time.Duration being marked as a value based class, I wanted > to confirm that using `null` will not force significant rework in > the future? i.e. java.time.Duration will not opt-in to become a > null-restricted value class type (https://openjdk.org/jeps/8316779). > > Thanks a lot, and thanks for the huge work on Valhalla. Good luck > for bringing it into mainline Java ! > > Jean-No?l > > /CONFIDENTIALITY NOTICE: This email may contain confidential and > privileged material for the sole use of the intended recipient(s). > Any review, use, distribution or disclosure by others is strictly > prohibited.? If you have received this communication in error, > please notify the sender immediately by e-mail and delete the > message and any file attachments from your computer. Thank you./ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jbhateja at openjdk.org Thu Jan 2 18:56:00 2025 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Thu, 2 Jan 2025 18:56:00 GMT Subject: [lworld+vector] Integrated: Merge lworld Message-ID: <5dv6jZqQfIEt1rxGEnNmPAbRBIBz_SiVfIKd3Oi6NDg=.dfd03f3a-aa10-4e9d-9b6d-7d9fd2fd9071@github.com> Merge the latest code from lworld into lworld+vector. This is a major merge after 6 months. Validation: - All VectorAPI Jtreg tests now pass with default options apart from a few KNL failures. - Validation is done with InlineFieldMaxFlatSize=default (128) and 512. - There is one regression in Valhalla tests compiler/valhalla/inlinetypes/TestLWorld.java The above bugs will be fixed in subsequent PR / follow-up merges. Best Regards, Jatin ------------- Commit messages: - jcheck fixes - Merge branch 'lworld' of https://github.com/openjdk/valhalla into merge_lworld - Merge lworld - Merge lworld - Merge lworld - JDK 8327435: [lworld+vector] Align existing Vector API support with JEP 401 - Merge lworld - 8319945: [lworld+vector] Fix vector api jtreg crash with "-XX:-EnableVectorSupport" - 8319972: [lworld+vector] Enable intrinsification of Unsafe.finishPrivateBuffer. - 8319971: [lworld+vector] Fallback implementation cleanups. - ... and 14 more: https://git.openjdk.org/valhalla/compare/265189e2...0e6affa7 The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/valhalla/pull/1326/files Stats: 12027 lines in 271 files changed: 4623 ins; 2628 del; 4776 mod Patch: https://git.openjdk.org/valhalla/pull/1326.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1326/head:pull/1326 PR: https://git.openjdk.org/valhalla/pull/1326 From jbhateja at openjdk.org Thu Jan 2 18:56:05 2025 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Thu, 2 Jan 2025 18:56:05 GMT Subject: [lworld+vector] Integrated: Merge lworld In-Reply-To: <5dv6jZqQfIEt1rxGEnNmPAbRBIBz_SiVfIKd3Oi6NDg=.dfd03f3a-aa10-4e9d-9b6d-7d9fd2fd9071@github.com> References: <5dv6jZqQfIEt1rxGEnNmPAbRBIBz_SiVfIKd3Oi6NDg=.dfd03f3a-aa10-4e9d-9b6d-7d9fd2fd9071@github.com> Message-ID: <0urcbpXLzAsXve6Yj8xuhY2bPh3cOchgPxO8wS7oZjg=.635fe2ec-c1e3-4e4f-ba03-107798dbe209@github.com> On Thu, 2 Jan 2025 18:46:08 GMT, Jatin Bhateja wrote: > Merge the latest code from lworld into lworld+vector. > > This is a major merge after 6 months. > > Validation: > - All VectorAPI Jtreg tests now pass with default options apart from a few KNL failures. > - Validation is done with InlineFieldMaxFlatSize=default (128) and 512. > - There is one regression in Valhalla tests compiler/valhalla/inlinetypes/TestLWorld.java > > The above bugs will be fixed in subsequent PR / follow-up merges. > > Best Regards, > Jatin This pull request has now been integrated. Changeset: 2e925093 Author: Jatin Bhateja URL: https://git.openjdk.org/valhalla/commit/2e925093483ddf370c8019966f6055237092c0a6 Stats: 1209004 lines in 13208 files changed: 592135 ins; 231508 del; 385361 mod Merge lworld ------------- PR: https://git.openjdk.org/valhalla/pull/1326 From rriggs at openjdk.org Mon Jan 6 20:10:33 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 6 Jan 2025 20:10:33 GMT Subject: [lworld] RFR: 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException Message-ID: Add APINote and javadoc for IdentityException where it will be useful to know that identity or value objects are treated differently. Simplified WeakHashMap javadoc updates for IdentityException. Added note to System.identityHashCode to include value objects. Added to class javadoc for IdentityHashMap for value objects. ------------- Commit messages: - 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException Changes: https://git.openjdk.org/valhalla/pull/1327/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1327&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346307 Stats: 131 lines in 6 files changed: 123 ins; 0 del; 8 mod Patch: https://git.openjdk.org/valhalla/pull/1327.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1327/head:pull/1327 PR: https://git.openjdk.org/valhalla/pull/1327 From rriggs at openjdk.org Wed Jan 8 18:33:07 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 8 Jan 2025 18:33:07 GMT Subject: [lworld] Integrated: 8346035: [lworld] javadoc for value objects when enable preview In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 22:02:25 GMT, Roger Riggs wrote: > Updated javadoc for value objects when preview is enabled. > > Added text and decoration to highlight preview behavior of identity classes that are value classes with --enable-preview > The decorations are similar to the existing preview highlights for Preview classes and methods. > > The updates include all of the wrapper classes, java.time, and java.util.Optional* and other classed annotated with @ValueBased. > > The ValueBased is updated to describe the behavior when --enable-preview. This pull request has now been integrated. Changeset: ca707ff5 Author: Roger Riggs URL: https://git.openjdk.org/valhalla/commit/ca707ff597f5b2fab52d52fd04c1bcc14afad6ca Stats: 460 lines in 37 files changed: 297 ins; 3 del; 160 mod 8346035: [lworld] javadoc for value objects when enable preview Reviewed-by: liach ------------- PR: https://git.openjdk.org/valhalla/pull/1316 From fparain at openjdk.org Wed Jan 8 20:30:24 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 8 Jan 2025 20:30:24 GMT Subject: [lworld] RFR: 8347292: [lworld] oopDesc->print() is broken Message-ID: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> Fix implementation of oopDesc->print(): - remove invalid assert - fix printing for better readability - fix offsets of nested fields More details are available in the CR. ------------- Commit messages: - Fix oopDesc->print() Changes: https://git.openjdk.org/valhalla/pull/1328/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1328&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8347292 Stats: 30 lines in 4 files changed: 11 ins; 3 del; 16 mod Patch: https://git.openjdk.org/valhalla/pull/1328.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1328/head:pull/1328 PR: https://git.openjdk.org/valhalla/pull/1328 From fparain at openjdk.org Thu Jan 9 20:13:30 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 9 Jan 2025 20:13:30 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v5] In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: Christian's patch to fix JIT code ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1315/files - new: https://git.openjdk.org/valhalla/pull/1315/files/048b88c4..6e4729e0 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=04 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=03-04 Stats: 15 lines in 8 files changed: 3 ins; 0 del; 12 mod Patch: https://git.openjdk.org/valhalla/pull/1315.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1315/head:pull/1315 PR: https://git.openjdk.org/valhalla/pull/1315 From coleenp at openjdk.org Thu Jan 9 20:50:57 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Thu, 9 Jan 2025 20:50:57 GMT Subject: [lworld] RFR: 8347292: [lworld] oopDesc->print() is broken In-Reply-To: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> References: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> Message-ID: On Wed, 8 Jan 2025 20:18:13 GMT, Frederic Parain wrote: > Fix implementation of oopDesc->print(): > - remove invalid assert > - fix printing for better readability > - fix offsets of nested fields > > More details are available in the CR. Looks good except I had one question. src/hotspot/share/runtime/fieldDescriptor.cpp line 173: > 171: vk->do_nonstatic_fields(&print_field); > 172: if (this->field_flags().has_null_marker()) { > 173: for (int i = 0; i < + 1; i++) st->print(" "); Should this be indent + 1 ? ------------- Marked as reviewed by coleenp (Committer). PR Review: https://git.openjdk.org/valhalla/pull/1328#pullrequestreview-2540894933 PR Review Comment: https://git.openjdk.org/valhalla/pull/1328#discussion_r1909410802 From fparain at openjdk.org Thu Jan 9 21:25:37 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 9 Jan 2025 21:25:37 GMT Subject: [lworld] RFR: 8347292: [lworld] oopDesc->print() is broken [v2] In-Reply-To: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> References: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> Message-ID: > Fix implementation of oopDesc->print(): > - remove invalid assert > - fix printing for better readability > - fix offsets of nested fields > > More details are available in the CR. Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: Fix loop argument ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1328/files - new: https://git.openjdk.org/valhalla/pull/1328/files/a9cb6566..8601a41e Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1328&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1328&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1328.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1328/head:pull/1328 PR: https://git.openjdk.org/valhalla/pull/1328 From fparain at openjdk.org Thu Jan 9 21:30:58 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 9 Jan 2025 21:30:58 GMT Subject: [lworld] RFR: 8347292: [lworld] oopDesc->print() is broken [v2] In-Reply-To: References: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> Message-ID: On Thu, 9 Jan 2025 21:25:37 GMT, Frederic Parain wrote: >> Fix implementation of oopDesc->print(): >> - remove invalid assert >> - fix printing for better readability >> - fix offsets of nested fields >> >> More details are available in the CR. > > Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: > > Fix loop argument Coleen, Thank you for your review. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1328#issuecomment-2581277745 From fparain at openjdk.org Thu Jan 9 21:30:59 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 9 Jan 2025 21:30:59 GMT Subject: [lworld] Integrated: 8347292: [lworld] oopDesc->print() is broken In-Reply-To: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> References: <7awlNb2-z1KwG8XnO1SgAs-kPvMxY3Kaz1vKl754-Jk=.cc9be9fc-b253-4798-9d73-ad858750c4fe@github.com> Message-ID: <-6J9sc9qhZS1i1c2pfyeIO5M0ytmtyfE8_naF3i-610=.fd6adb4b-7afb-47d7-b231-94c0b0a7883d@github.com> On Wed, 8 Jan 2025 20:18:13 GMT, Frederic Parain wrote: > Fix implementation of oopDesc->print(): > - remove invalid assert > - fix printing for better readability > - fix offsets of nested fields > > More details are available in the CR. This pull request has now been integrated. Changeset: 2d3a319f Author: Frederic Parain URL: https://git.openjdk.org/valhalla/commit/2d3a319fc36824837e921aabbf05564a1373372d Stats: 30 lines in 4 files changed: 11 ins; 3 del; 16 mod 8347292: [lworld] oopDesc->print() is broken Reviewed-by: coleenp ------------- PR: https://git.openjdk.org/valhalla/pull/1328 From jean-noel.rouvignac at pingidentity.com Fri Jan 10 13:02:36 2025 From: jean-noel.rouvignac at pingidentity.com (=?UTF-8?Q?Jean=2DNo=C3=ABl_Rouvignac?=) Date: Fri, 10 Jan 2025 14:02:36 +0100 Subject: Current thinking about the future nullability of java.time.Duration In-Reply-To: References: Message-ID: After your comments, I realize that, except primitive types, no type in the JDK will opt-in to become a null-restricted value class type because this would be an incompatible change. Future added types may opt into being null-restricted value types from the get go. It means`null` can be used today with confidence it won't go away in the future. > As currently specified, there is no clean Duration value that could be used as a sentinel (alternative to null) except in some application specific use. That's true. I currently have a `public static final Duration UNLIMITED = Duration.ofSeconds(Long.MAX_VALUE);`, but this is not really a sentinel, and any other `Duration.ofSeconds(Long.MAX_VALUE)` is equal to it. So it's not a problem. Thanks all! -- _CONFIDENTIALITY NOTICE: This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited.? If you have received this communication in error, please notify the sender immediately by e-mail and delete the message and any file attachments from your computer. Thank you._ -------------- next part -------------- An HTML attachment was scrubbed... URL: From caleb.cushing at gmail.com Fri Jan 10 23:16:35 2025 From: caleb.cushing at gmail.com (Caleb Cushing) Date: Fri, 10 Jan 2025 18:16:35 -0500 Subject: Current thinking about the future nullability of java.time.Duration In-Reply-To: References: Message-ID: And we think there might be a few more things although I'm not sure they're types that would opt in to this. There are several methods that I can "think" of that will throw errors if you pass them nulls. For example Optional.of would make no sense not to have its parameter as non null. Although maybe they would opt for that so people can catch the exception which I find ridiculous On Fri, Jan 10, 2025, 8:03?AM Jean-No?l Rouvignac < jean-noel.rouvignac at pingidentity.com> wrote: > After your comments, I realize that, except primitive types, no type in > the JDK will opt-in to become a null-restricted value class type because > this would be an incompatible change. > Future added types may opt into being null-restricted value types from the > get go. > It means`null` can be used today with confidence it won't go away in the > future. > > > As currently specified, there is no clean Duration value that could be > used as a sentinel (alternative to null) except in some application > specific use. > > That's true. > I currently have a `public static final Duration UNLIMITED = > Duration.ofSeconds(Long.MAX_VALUE);`, but this is not really a sentinel, > and any other `Duration.ofSeconds(Long.MAX_VALUE)` is equal to it. So it's > not a problem. > > Thanks all! > > *CONFIDENTIALITY NOTICE: This email may contain confidential and > privileged material for the sole use of the intended recipient(s). Any > review, use, distribution or disclosure by others is strictly prohibited. > If you have received this communication in error, please notify the sender > immediately by e-mail and delete the message and any file attachments from > your computer. Thank you.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From fparain at openjdk.org Mon Jan 13 17:28:17 2025 From: fparain at openjdk.org (Frederic Parain) Date: Mon, 13 Jan 2025 17:28:17 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v6] In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred Frederic Parain has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: - Fix markWord for nullable flat arrays - Merge remote-tracking branch 'upstream/lworld' into array_ext_hdr - Christian's patch to fix JIT code - Fix bad register usage causing mdp corruption - Small cleanups - Merge remote-tracking branch 'upstream/lworld' into array_ext_hdr - CDS fixes and various cleanup - Merge remote-tracking branch 'upstream/lworld' into array_ext_hdr - More flat arrays work and code cleanup ------------- Changes: https://git.openjdk.org/valhalla/pull/1315/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=05 Stats: 1570 lines in 66 files changed: 939 ins; 281 del; 350 mod Patch: https://git.openjdk.org/valhalla/pull/1315.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1315/head:pull/1315 PR: https://git.openjdk.org/valhalla/pull/1315 From vromero at openjdk.org Mon Jan 13 19:40:08 2025 From: vromero at openjdk.org (Vicente Romero) Date: Mon, 13 Jan 2025 19:40:08 GMT Subject: Integrated: Merge lworld Message-ID: Merge branch 'lworld' into lw5_merge_lworld # Conflicts: # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java ------------- Commit messages: - Merge branch 'lworld' into lw5_merge_lworld - Merge lworld - Merge lworld - Merge lworld - Merge lworld - 8340125: [lw5] null checks are not being generated for method invocations and array writes - Merge lworld - 8340027: [lw5] the ACC_STRICT flag is not being set for non-nullable static fields - Merge lworld - 8339357: [lw5] make non-nullable instance fields strict - ... and 54 more: https://git.openjdk.org/valhalla/compare/2d3a319f...a6c46e2a The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/valhalla/pull/1329/files Stats: 6861 lines in 106 files changed: 6739 ins; 5 del; 117 mod Patch: https://git.openjdk.org/valhalla/pull/1329.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1329/head:pull/1329 PR: https://git.openjdk.org/valhalla/pull/1329 From vromero at openjdk.org Mon Jan 13 19:40:10 2025 From: vromero at openjdk.org (Vicente Romero) Date: Mon, 13 Jan 2025 19:40:10 GMT Subject: Integrated: Merge lworld In-Reply-To: References: Message-ID: On Mon, 13 Jan 2025 19:33:38 GMT, Vicente Romero wrote: > Merge branch 'lworld' into lw5_merge_lworld > # Conflicts: > # src/jdk.compiler/share/classes/com/sun/tools/javac/code/Source.java This pull request has now been integrated. Changeset: c3a73cfc Author: Vicente Romero URL: https://git.openjdk.org/valhalla/commit/c3a73cfcd1a78eb4bd65ee8ddf8c91f080dac729 Stats: 303473 lines in 2068 files changed: 126085 ins; 154021 del; 23367 mod Merge lworld ------------- PR: https://git.openjdk.org/valhalla/pull/1329 From rriggs at openjdk.org Mon Jan 13 21:15:30 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 13 Jan 2025 21:15:30 GMT Subject: [lworld] RFR: 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException [v2] In-Reply-To: References: Message-ID: > Add APINote and javadoc for IdentityException where it will be useful to know that identity or value objects are treated differently. > Simplified WeakHashMap javadoc updates for IdentityException. > Added note to System.identityHashCode to include value objects. > Added to class javadoc for IdentityHashMap for value objects. Roger Riggs has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'openjdk:lworld' into 8346307-throws-identityexception - 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException Add APINote and javadoc for IdentityException where it will be useful to know. Simplified WeakHashMap javadoc updates for IdentityException. Added note to System.identityHashCode to include value objects. ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1327/files - new: https://git.openjdk.org/valhalla/pull/1327/files/339bc421..2aae8e67 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1327&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1327&range=00-01 Stats: 490 lines in 41 files changed: 308 ins; 6 del; 176 mod Patch: https://git.openjdk.org/valhalla/pull/1327.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1327/head:pull/1327 PR: https://git.openjdk.org/valhalla/pull/1327 From rriggs at openjdk.org Mon Jan 13 22:09:42 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 13 Jan 2025 22:09:42 GMT Subject: [lworld] RFR: 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException [v3] In-Reply-To: References: Message-ID: > Add APINote and javadoc for IdentityException where it will be useful to know that identity or value objects are treated differently. > Simplified WeakHashMap javadoc updates for IdentityException. > Added note to System.identityHashCode to include value objects. > Added to class javadoc for IdentityHashMap for value objects. Roger Riggs has updated the pull request incrementally with two additional commits since the last revision: - Merge remote-tracking branch 'refs/remotes/origin/8346307-throws-identityexception' into 8346307-throws-identityexception - 8346307: [lworld] Document WeakHashMap and other apis that may throw IdentityException Add APINote and javadoc for IdentityException where it will be useful to know. Updated Objects.hasIdentity to return true for non-null reference to identity class; else false Added Objects.isValueObject to return true for non-null reference to value class; else false Updated tests for value objects. ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1327/files - new: https://git.openjdk.org/valhalla/pull/1327/files/2aae8e67..850923bd Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1327&range=02 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1327&range=01-02 Stats: 141 lines in 8 files changed: 77 ins; 21 del; 43 mod Patch: https://git.openjdk.org/valhalla/pull/1327.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1327/head:pull/1327 PR: https://git.openjdk.org/valhalla/pull/1327 From fparain at openjdk.org Tue Jan 14 14:31:24 2025 From: fparain at openjdk.org (Frederic Parain) Date: Tue, 14 Jan 2025 14:31:24 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v7] In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: Remove unnecessary changes ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1315/files - new: https://git.openjdk.org/valhalla/pull/1315/files/93545b71..dd59d0f3 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=06 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=05-06 Stats: 5 lines in 4 files changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/valhalla/pull/1315.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1315/head:pull/1315 PR: https://git.openjdk.org/valhalla/pull/1315 From fparain at openjdk.org Tue Jan 14 22:13:10 2025 From: fparain at openjdk.org (Frederic Parain) Date: Tue, 14 Jan 2025 22:13:10 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v8] In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: <0z1wXYUNTEx1TToOqJ1VqOV4b2gP9QTtqVQYQq1xWCU=.da2219b3-41d5-4499-be27-d65f09c75cb5@github.com> > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: Update copyrights year ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1315/files - new: https://git.openjdk.org/valhalla/pull/1315/files/dd59d0f3..4370f69f Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=07 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=06-07 Stats: 62 lines in 62 files changed: 0 ins; 0 del; 62 mod Patch: https://git.openjdk.org/valhalla/pull/1315.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1315/head:pull/1315 PR: https://git.openjdk.org/valhalla/pull/1315 From dsimms at openjdk.org Wed Jan 15 15:09:52 2025 From: dsimms at openjdk.org (David Simms) Date: Wed, 15 Jan 2025 15:09:52 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v8] In-Reply-To: <0z1wXYUNTEx1TToOqJ1VqOV4b2gP9QTtqVQYQq1xWCU=.da2219b3-41d5-4499-be27-d65f09c75cb5@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> <0z1wXYUNTEx1TToOqJ1VqOV4b2gP9QTtqVQYQq1xWCU=.da2219b3-41d5-4499-be27-d65f09c75cb5@github.com> Message-ID: On Tue, 14 Jan 2025 22:13:10 GMT, Frederic Parain wrote: >> Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. >> >> This patch has been tested in interpreted mode only on both x86_64 and aarch64. >> >> Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. >> >> Regards, >> >> Fred > > Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: > > Update copyrights year src/hotspot/share/oops/flatArrayKlass.hpp line 50: > 48: public: > 49: > 50: FlatArrayKlass() {} // Why? Nuke it ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1315#discussion_r1916822621 From fparain at openjdk.org Wed Jan 15 16:30:32 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 15 Jan 2025 16:30:32 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v9] In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: Fix comment ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1315/files - new: https://git.openjdk.org/valhalla/pull/1315/files/4370f69f..d3ea894c Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=08 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1315&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1315.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1315/head:pull/1315 PR: https://git.openjdk.org/valhalla/pull/1315 From fparain at openjdk.org Wed Jan 15 16:30:34 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 15 Jan 2025 16:30:34 GMT Subject: [lworld] RFR: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts [v8] In-Reply-To: References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> <0z1wXYUNTEx1TToOqJ1VqOV4b2gP9QTtqVQYQq1xWCU=.da2219b3-41d5-4499-be27-d65f09c75cb5@github.com> Message-ID: On Wed, 15 Jan 2025 15:07:00 GMT, David Simms wrote: >> Frederic Parain has updated the pull request incrementally with one additional commit since the last revision: >> >> Update copyrights year > > src/hotspot/share/oops/flatArrayKlass.hpp line 50: > >> 48: public: >> 49: >> 50: FlatArrayKlass() {} // Why? > > Nuke it After investigation, it is used by CppVtableCloner::initialize() to create the dummy instance. Comment has been updated. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1315#discussion_r1916979828 From fparain at openjdk.org Wed Jan 15 23:59:58 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 15 Jan 2025 23:59:58 GMT Subject: [lworld] Integrated: 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts In-Reply-To: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> References: <-owOlQjyoQC0Le-Q6EaS6ZFWy7-8OrLvqkiYJpe8jLw=.2240bc95-2d23-4265-b6c9-f702e4918c12@github.com> Message-ID: On Wed, 11 Dec 2024 13:43:24 GMT, Frederic Parain wrote: > Here's a redesign of flat arrays to support multiple flat layouts (NON_ATOMIC_FLAT, ATOMIC_FLAT, NULLABLE_ATOMIC_FLAT). The patch contains a lot of cleanup and simplification of the flat arrays access code. > > This patch has been tested in interpreted mode only on both x86_64 and aarch64. > > Unfortunately, it currently triggers a number of failures when run with JITs enabled. After a discussion with Tobias, this PR will probably not be integrated until a patch for the JITs is available. > > Regards, > > Fred This pull request has now been integrated. Changeset: b9960ffe Author: Frederic Parain URL: https://git.openjdk.org/valhalla/commit/b9960ffe7c8539b6396480c81f1ebda7a0c72db5 Stats: 1625 lines in 63 files changed: 939 ins; 281 del; 405 mod 8345995: [lworld] Flat arrays need to be redesigned to support new flat layouts ------------- PR: https://git.openjdk.org/valhalla/pull/1315 From fparain at openjdk.org Thu Jan 16 14:52:03 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 16 Jan 2025 14:52:03 GMT Subject: [lworld] Integrated: 8346702: [lworld] ShouldNotReachHere in FieldLayout::remove_null_marker() Message-ID: Small fix to prevent calls to remove_null_marker() when processing an empty value (empty values don't have a dedicated slot for null markers, the injected field is used instead). ------------- Commit messages: - Guard remove_null_marker() against empty values Changes: https://git.openjdk.org/valhalla/pull/1330/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1330&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346702 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1330.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1330/head:pull/1330 PR: https://git.openjdk.org/valhalla/pull/1330 From fparain at openjdk.org Thu Jan 16 14:52:03 2025 From: fparain at openjdk.org (Frederic Parain) Date: Thu, 16 Jan 2025 14:52:03 GMT Subject: [lworld] Integrated: 8346702: [lworld] ShouldNotReachHere in FieldLayout::remove_null_marker() In-Reply-To: References: Message-ID: On Thu, 16 Jan 2025 14:45:52 GMT, Frederic Parain wrote: > Small fix to prevent calls to remove_null_marker() when processing an empty value (empty values don't have a dedicated slot for null markers, the injected field is used instead). This pull request has now been integrated. Changeset: 90055bb6 Author: Frederic Parain URL: https://git.openjdk.org/valhalla/commit/90055bb6d39db507d5dae88538598520054bc1c6 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod 8346702: [lworld] ShouldNotReachHere in FieldLayout::remove_null_marker() ------------- PR: https://git.openjdk.org/valhalla/pull/1330 From vromero at openjdk.org Thu Jan 16 21:21:23 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 16 Jan 2025 21:21:23 GMT Subject: RFR: 8347754: [lw5] fix the order of nullness markers in signatures Message-ID: Null markers must be at the end of signatures, currently they are being generated at the beginning see [1] [1] https://bugs.openjdk.org/browse/JDK-8317766 ------------- Commit messages: - 8347754: [lw5] fix the order of nullness markers in signatures Changes: https://git.openjdk.org/valhalla/pull/1331/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1331&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8347754 Stats: 156 lines in 5 files changed: 71 ins; 25 del; 60 mod Patch: https://git.openjdk.org/valhalla/pull/1331.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1331/head:pull/1331 PR: https://git.openjdk.org/valhalla/pull/1331 From vromero at openjdk.org Thu Jan 16 21:25:53 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 16 Jan 2025 21:25:53 GMT Subject: Integrated: 8347754: [lw5] fix the order of nullness markers in signatures In-Reply-To: References: Message-ID: <3-QTZ3NXIf3L1eghALJoioG-dxcOiFkvEWJnY1m7aNE=.cb141208-6b09-4964-b491-a0aa1b390feb@github.com> On Thu, 16 Jan 2025 21:16:38 GMT, Vicente Romero wrote: > Null markers must be at the end of signatures, currently they are being generated at the beginning see [1] > > [1] https://bugs.openjdk.org/browse/JDK-8317766 This pull request has now been integrated. Changeset: 90628e46 Author: Vicente Romero URL: https://git.openjdk.org/valhalla/commit/90628e467a133ce3d0099574ad41fccdcbd58245 Stats: 156 lines in 5 files changed: 71 ins; 25 del; 60 mod 8347754: [lw5] fix the order of nullness markers in signatures ------------- PR: https://git.openjdk.org/valhalla/pull/1331 From duke at openjdk.org Fri Jan 17 15:09:13 2025 From: duke at openjdk.org (Andrew Byrd) Date: Fri, 17 Jan 2025 15:09:13 GMT Subject: [valhalla-docs] RFR: Add Brian Goetz presentation from July 2024 Message-ID: Looking into the present state of project Valhalla, I found a very good presentation from July of 2024 at https://inside.java/tag/valhalla that was not listed on the page at https://openjdk.org/projects/valhalla/ but seems to fit well alongside the other presentations listed there. I updated the page to include this presentation from Brian Goetz. I also sorted the presentations in reverse chronological order, as some of the information in this 2024 presentation seems to supersede previous ones. ------------- Commit messages: - Add Brian Goetz presentation (July 2024) Changes: https://git.openjdk.org/valhalla-docs/pull/13/files Webrev: https://webrevs.openjdk.org/?repo=valhalla-docs&pr=13&range=00 Stats: 6 lines in 1 file changed: 4 ins; 2 del; 0 mod Patch: https://git.openjdk.org/valhalla-docs/pull/13.diff Fetch: git fetch https://git.openjdk.org/valhalla-docs.git pull/13/head:pull/13 PR: https://git.openjdk.org/valhalla-docs/pull/13 From bkilambi at openjdk.org Fri Jan 17 17:51:25 2025 From: bkilambi at openjdk.org (Bhavana Kilambi) Date: Fri, 17 Jan 2025 17:51:25 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines Message-ID: This patch adds mid-end support for Float16.valueOf() routines - conversions from int/long/double to half float and backend aarch64 support. ------------- Commit messages: - 8345053: Add support for FP16 valueOf routines Changes: https://git.openjdk.org/valhalla/pull/1332/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1332&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345053 Stats: 1308 lines in 27 files changed: 609 ins; 2 del; 697 mod Patch: https://git.openjdk.org/valhalla/pull/1332.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1332/head:pull/1332 PR: https://git.openjdk.org/valhalla/pull/1332 From bkilambi at openjdk.org Mon Jan 20 09:19:55 2025 From: bkilambi at openjdk.org (Bhavana Kilambi) Date: Mon, 20 Jan 2025 09:19:55 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines In-Reply-To: References: Message-ID: On Fri, 17 Jan 2025 17:47:20 GMT, Bhavana Kilambi wrote: > This patch adds intrinsic support for Float16.valueOf() routines - conversions from int/long/double to half float. Hi @jatin-bhateja , could you please review this PR? Thanks! ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1332#issuecomment-2601847081 From fparain at openjdk.org Tue Jan 21 21:58:27 2025 From: fparain at openjdk.org (Frederic Parain) Date: Tue, 21 Jan 2025 21:58:27 GMT Subject: [lworld] RFR: 8348215: [lworld] Unsafe.getValue() and Unsafe.putValue() need nullable flat layout support Message-ID: Quick fix to Unsafe.getValue() and Unsafe.putValue() in order to support nullable flat fields and elements. This will fix the substitutability test when values have nullable flat fields. This is a temporary implementation, the call to find_field_from_offset() being too costly for an Unsafe method. A better fix would be to allow Unsafe to get the layout kind of the field, to cache it and to pass it back to the VM when calling getValue() or putValue(), the same way it proceeds with the field offset. But this would imply changing all the JDK codes and tests currently using getValue() or putValue(). So this following step will be addressed in a different CR (fixing the substitutability test being more urgent). The changeset also fixes several bugs encountered while fixing Unsafe. Fred ------------- Commit messages: - Add nullable layout support to Unsafe.getValue() and Unsage.putValue() Changes: https://git.openjdk.org/valhalla/pull/1334/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1334&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348215 Stats: 176 lines in 4 files changed: 157 ins; 16 del; 3 mod Patch: https://git.openjdk.org/valhalla/pull/1334.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1334/head:pull/1334 PR: https://git.openjdk.org/valhalla/pull/1334 From jbhateja at openjdk.org Wed Jan 22 11:59:54 2025 From: jbhateja at openjdk.org (Jatin Bhateja) Date: Wed, 22 Jan 2025 11:59:54 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines In-Reply-To: References: Message-ID: On Mon, 20 Jan 2025 09:17:40 GMT, Bhavana Kilambi wrote: >> This patch adds intrinsic support for Float16.valueOf() routines - conversions from int/long/double to half float. > > Hi @jatin-bhateja , could you please review this PR? Thanks! Hi @Bhavana-Kilambi , Kindly extend [test/micro/org/openjdk/bench/java/lang/Float16OpsBenchmark.java](test/micro/org/openjdk/bench/java/lang/Float16OpsBenchmark.java) to cover newly intrinsified operations and share the results with and without changes. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1332#issuecomment-2607050593 From fparain at openjdk.org Wed Jan 22 12:50:51 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 22 Jan 2025 12:50:51 GMT Subject: [lworld] Integrated: 8348215: [lworld] Unsafe.getValue() and Unsafe.putValue() need nullable flat layout support In-Reply-To: References: Message-ID: On Tue, 21 Jan 2025 21:53:36 GMT, Frederic Parain wrote: > Quick fix to Unsafe.getValue() and Unsafe.putValue() in order to support nullable flat fields and elements. This will fix the substitutability test when values have nullable flat fields. > > This is a temporary implementation, the call to find_field_from_offset() being too costly for an Unsafe method. A better fix would be to allow Unsafe to get the layout kind of the field, to cache it and to pass it back to the VM when calling getValue() or putValue(), the same way it proceeds with the field offset. > > But this would imply changing all the JDK codes and tests currently using getValue() or putValue(). So this following step will be addressed in a different CR (fixing the substitutability test being more urgent). > > The changeset also fixes several bugs encountered while fixing Unsafe. > > Fred This pull request has now been integrated. Changeset: 25520ca1 Author: Frederic Parain URL: https://git.openjdk.org/valhalla/commit/25520ca1f63f3b805b9cbfea740867244041acad Stats: 176 lines in 4 files changed: 157 ins; 16 del; 3 mod 8348215: [lworld] Unsafe.getValue() and Unsafe.putValue() need nullable flat layout support ------------- PR: https://git.openjdk.org/valhalla/pull/1334 From rriggs at openjdk.org Thu Jan 23 21:35:43 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 23 Jan 2025 21:35:43 GMT Subject: [lworld] RFR: 8348428: [lworld] ProcessReaper stack size too small in debug build Message-ID: Increase process reaper debug stack size to 64kb Some tests of the fastdebug Java Runtime with -Xcomp experience a StackOverflow exception in the ProcessReaper in ProcessHandleImpl. Some combination of -Xcomp and the MH generation done by isSubstitutability for value objects in debug mode is larger. The current 16kb bump for the non-release builds should be raised to 64k. ------------- Commit messages: - 8348428: [lworld] ProcessReaper stack size too small in debug build Changes: https://git.openjdk.org/valhalla/pull/1335/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1335&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348428 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1335.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1335/head:pull/1335 PR: https://git.openjdk.org/valhalla/pull/1335 From rriggs at openjdk.org Fri Jan 24 02:05:09 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 24 Jan 2025 02:05:09 GMT Subject: [lworld] Integrated: 8348428: [lworld] ProcessReaper stack size too small in debug build In-Reply-To: References: Message-ID: <89TsyDoaIms7ykFQpG7jMeHoah8pb7enhIjMmnKZO0g=.8da0884f-1e29-43eb-b141-1fadd713b6de@github.com> On Thu, 23 Jan 2025 21:29:43 GMT, Roger Riggs wrote: > Increase process reaper debug stack size to 64kb > > Some tests of the fastdebug Java Runtime with -Xcomp experience a StackOverflow exception in the ProcessReaper in ProcessHandleImpl. > Some combination of -Xcomp and the MH generation done by isSubstitutability for value objects in debug mode is larger. > > The current 16kb bump for the non-release builds should be raised to 64k. This pull request has now been integrated. Changeset: 287a7b55 Author: Roger Riggs URL: https://git.openjdk.org/valhalla/commit/287a7b55eca9db951ed7cddbdd35896b5c20d858 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8348428: [lworld] ProcessReaper stack size too small in debug build ------------- PR: https://git.openjdk.org/valhalla/pull/1335 From bkilambi at openjdk.org Fri Jan 24 13:45:42 2025 From: bkilambi at openjdk.org (Bhavana Kilambi) Date: Fri, 24 Jan 2025 13:45:42 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines [v2] In-Reply-To: References: Message-ID: <1iteJZNvJrsydropaIEAl8ZYuXRd0cK34JAQ-FWzV2o=.53139579-3812-4cc1-b5f3-b26c284d36a2@github.com> > This patch adds intrinsic support for Float16.valueOf() routines - conversions from int/long/double to half float. Bhavana Kilambi has updated the pull request incrementally with one additional commit since the last revision: Add new microbenchmarks for valueOf() routines ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1332/files - new: https://git.openjdk.org/valhalla/pull/1332/files/342c0304..f7b98148 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1332&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1332&range=00-01 Stats: 34 lines in 1 file changed: 33 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1332.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1332/head:pull/1332 PR: https://git.openjdk.org/valhalla/pull/1332 From bkilambi at openjdk.org Fri Jan 24 13:45:43 2025 From: bkilambi at openjdk.org (Bhavana Kilambi) Date: Fri, 24 Jan 2025 13:45:43 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines In-Reply-To: References: Message-ID: On Fri, 17 Jan 2025 17:47:20 GMT, Bhavana Kilambi wrote: > This patch adds intrinsic support for Float16.valueOf() routines - conversions from int/long/double to half float. Hi Jatin, I have uploaded a new commit with benchmark tests for valueOf() routines. Here are the results on an N1 (128-bit) machine - Benchmark (vectorDim) Mode Cnt Gain Float16OpsBenchmark.DoubleToFP16 1024 thrpt 25 5.47 Float16OpsBenchmark.IntToFP16 1024 thrpt 25 10.77 Float16OpsBenchmark.LongToFP16 1024 thrpt 25 2.36 I have observed similar/larger gains on other Arm based machines as well. Please review the patch. Thanks ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1332#issuecomment-2612560341 From fparain at openjdk.org Fri Jan 24 19:12:42 2025 From: fparain at openjdk.org (Frederic Parain) Date: Fri, 24 Jan 2025 19:12:42 GMT Subject: [lworld] RFR: 8348599: [lworld] Unsafe.getValue() and Unsafe.putValue() have expensive lookup code Message-ID: New version of Unsafe methods to read and write flat values. More details in the CR. ------------- Commit messages: - New Unsafe get/put method with LayoutKind argument Changes: https://git.openjdk.org/valhalla/pull/1336/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1336&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348599 Stats: 258 lines in 3 files changed: 242 ins; 0 del; 16 mod Patch: https://git.openjdk.org/valhalla/pull/1336.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1336/head:pull/1336 PR: https://git.openjdk.org/valhalla/pull/1336 From fparain at openjdk.org Mon Jan 27 14:58:04 2025 From: fparain at openjdk.org (Frederic Parain) Date: Mon, 27 Jan 2025 14:58:04 GMT Subject: [lworld] Integrated: 8348599: [lworld] Unsafe.getValue() and Unsafe.putValue() have expensive lookup code In-Reply-To: References: Message-ID: On Fri, 24 Jan 2025 19:07:37 GMT, Frederic Parain wrote: > New version of Unsafe methods to read and write flat values. > More details in the CR. This pull request has now been integrated. Changeset: 4d7ba024 Author: Frederic Parain URL: https://git.openjdk.org/valhalla/commit/4d7ba024a36a1522e3cf7574bfbd1e5c82ec5bba Stats: 258 lines in 3 files changed: 242 ins; 0 del; 16 mod 8348599: [lworld] Unsafe.getValue() and Unsafe.putValue() have expensive lookup code ------------- PR: https://git.openjdk.org/valhalla/pull/1336 From dsimms at openjdk.org Tue Jan 28 08:46:26 2025 From: dsimms at openjdk.org (David Simms) Date: Tue, 28 Jan 2025 08:46:26 GMT Subject: [lworld] RFR: Merge jdk Message-ID: <3VZfEG3fdgpCUoHLWcQcCj6IH53QKdLWwQAW7BJXCZI=.fb4f2ce7-ac0d-4899-a857-b434b560c2ef@github.com> Merge jdk-24+24 ------------- Commit messages: - More SinceChecking with Valhalla features - Exclude failing COH tests for now - imm encoding - Disable COH CDS archive for now - Update comment - Merge tag 'jdk-24+24' into lworld_merge_jdk_24_24 - 8343875: Minor improvements of jpackage test library - 8344074: RISC-V: C1: More accurate _exception_handler_size and _deopt_handler_size - 8339288: Improve diagnostic logging runtime/cds/DeterministicDump.java - 8343984: Fix Unsafe address overflow - ... and 121 more: https://git.openjdk.org/valhalla/compare/90055bb6...72ce812a The webrevs contain the conflicts with lworld and the adjustments done while merging with regards to each parent branch: - merge conflicts: https://webrevs.openjdk.org/?repo=valhalla&pr=1337&range=00.conflicts - lworld: https://webrevs.openjdk.org/?repo=valhalla&pr=1337&range=00.0 - jdk: https://webrevs.openjdk.org/?repo=valhalla&pr=1337&range=00.1 Changes: https://git.openjdk.org/valhalla/pull/1337/files Stats: 107247 lines in 2835 files changed: 28091 ins; 70190 del; 8966 mod Patch: https://git.openjdk.org/valhalla/pull/1337.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1337/head:pull/1337 PR: https://git.openjdk.org/valhalla/pull/1337 From dsimms at openjdk.org Tue Jan 28 08:56:59 2025 From: dsimms at openjdk.org (David Simms) Date: Tue, 28 Jan 2025 08:56:59 GMT Subject: [lworld] RFR: Merge jdk [v2] In-Reply-To: <3VZfEG3fdgpCUoHLWcQcCj6IH53QKdLWwQAW7BJXCZI=.fb4f2ce7-ac0d-4899-a857-b434b560c2ef@github.com> References: <3VZfEG3fdgpCUoHLWcQcCj6IH53QKdLWwQAW7BJXCZI=.fb4f2ce7-ac0d-4899-a857-b434b560c2ef@github.com> Message-ID: > Merge jdk-24+24 David Simms has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 132 commits: - Merge branch 'lworld' into lworld_merge_jdk_24_24 - More SinceChecking with Valhalla features - Exclude failing COH tests for now - imm encoding - Disable COH CDS archive for now - Update comment - Merge tag 'jdk-24+24' into lworld_merge_jdk_24_24 Added tag jdk-24+24 for changeset 95a00f8a - 8343875: Minor improvements of jpackage test library Reviewed-by: almatvee - 8344074: RISC-V: C1: More accurate _exception_handler_size and _deopt_handler_size Reviewed-by: mli, fjiang - 8339288: Improve diagnostic logging runtime/cds/DeterministicDump.java Reviewed-by: ccheung, iklam - ... and 122 more: https://git.openjdk.org/valhalla/compare/4d7ba024...7266e344 ------------- Changes: https://git.openjdk.org/valhalla/pull/1337/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1337&range=01 Stats: 107247 lines in 2835 files changed: 28091 ins; 70190 del; 8966 mod Patch: https://git.openjdk.org/valhalla/pull/1337.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1337/head:pull/1337 PR: https://git.openjdk.org/valhalla/pull/1337 From dsimms at openjdk.org Tue Jan 28 09:34:05 2025 From: dsimms at openjdk.org (David Simms) Date: Tue, 28 Jan 2025 09:34:05 GMT Subject: [lworld] Integrated: Merge jdk In-Reply-To: <3VZfEG3fdgpCUoHLWcQcCj6IH53QKdLWwQAW7BJXCZI=.fb4f2ce7-ac0d-4899-a857-b434b560c2ef@github.com> References: <3VZfEG3fdgpCUoHLWcQcCj6IH53QKdLWwQAW7BJXCZI=.fb4f2ce7-ac0d-4899-a857-b434b560c2ef@github.com> Message-ID: On Tue, 28 Jan 2025 08:40:49 GMT, David Simms wrote: > Merge jdk-24+24 > > Disabled `UseCompactObjectHeaders` tests and CDS archive test, under this bug: https://bugs.openjdk.org/browse/JDK-8348568 > > Two main issues (but there might be dragons): > > - Load/store of `oop->klass()` need to look at `UseCompactObjectHeaders` do it the `UseCompactObjectHeaders` way, or CompressedKlassPtrs or vanilla. > > - Valhalla klass prototype initialization doesn't play nice with `UseCompactObjectHeaders ` so `oop->klass()` can be corrupt. This pull request has now been integrated. Changeset: f0d58c5a Author: David Simms URL: https://git.openjdk.org/valhalla/commit/f0d58c5a16ced94980d1a8bacded7d41a1d7b406 Stats: 107247 lines in 2835 files changed: 28091 ins; 70190 del; 8966 mod Merge jdk Merge jdk-24+24 ------------- PR: https://git.openjdk.org/valhalla/pull/1337 From dsimms at openjdk.org Tue Jan 28 12:28:21 2025 From: dsimms at openjdk.org (David Simms) Date: Tue, 28 Jan 2025 12:28:21 GMT Subject: [lworld] RFR: Merge jdk Message-ID: Merge tag 'jdk-24+25' into lworld_merge_jdk_24_25 Added tag jdk-24+25 for changeset 4fbf2720 ------------- Commit messages: - Merge tag 'jdk-24+25' into lworld_merge_jdk_24_25 - 8344526: RISC-V: implement -XX:+VerifyActivationFrameSize - 8340334: Update jcmd VM.events max parameter to be INT - 8344524: Remove SecurityManager related code from jdk.jlink module - 8344471: Remove SecurityManager related code from java.compiler module - 8344057: Remove doPrivileged calls from unix platform sources in the java.desktop module - 8344595: State transitions in internal VirtualThread comment needs to be updated - 8344064: Remove doPrivileged calls from print/imageio/media classes in the java.desktop module - 8344578: Clean up left over java.security and sun.security imports in Swing classes - 8289771: jpackage: ResourceEditor error when path is overly long on Windows - ... and 165 more: https://git.openjdk.org/valhalla/compare/f0d58c5a...5992fd53 The webrevs contain the adjustments done while merging with regards to each parent branch: - lworld: https://webrevs.openjdk.org/?repo=valhalla&pr=1338&range=00.0 - jdk: https://webrevs.openjdk.org/?repo=valhalla&pr=1338&range=00.1 Changes: https://git.openjdk.org/valhalla/pull/1338/files Stats: 82484 lines in 1444 files changed: 37439 ins; 38862 del; 6183 mod Patch: https://git.openjdk.org/valhalla/pull/1338.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1338/head:pull/1338 PR: https://git.openjdk.org/valhalla/pull/1338 From rriggs at openjdk.org Tue Jan 28 23:25:13 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Tue, 28 Jan 2025 23:25:13 GMT Subject: [lworld] RFR: 8348585: [lworld] ProcessReaper stack size too small Message-ID: The reaper stack size is insufficient to initialize the method handles for the equals methods of the primitive classes. Instead of incrasing the stack size, perform the initialization before the reaper thread is created. An earlier change to increase the stack only for a debug build is reverted, it is no longer needed. ------------- Commit messages: - 8348585: [lworld] ProcessReaper stack size too small Changes: https://git.openjdk.org/valhalla/pull/1339/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1339&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348585 Stats: 7 lines in 1 file changed: 4 ins; 0 del; 3 mod Patch: https://git.openjdk.org/valhalla/pull/1339.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1339/head:pull/1339 PR: https://git.openjdk.org/valhalla/pull/1339 From dsimms at openjdk.org Wed Jan 29 07:25:08 2025 From: dsimms at openjdk.org (David Simms) Date: Wed, 29 Jan 2025 07:25:08 GMT Subject: [lworld] Integrated: Merge jdk In-Reply-To: References: Message-ID: <01erUdwtf5gbCYnGSFbQQte2ZEKfgIOrHPqL3Xj9MzY=.078e6345-bfe1-4e51-bc95-513377569908@github.com> On Tue, 28 Jan 2025 12:22:32 GMT, David Simms wrote: > Merge tag 'jdk-24+25' into lworld_merge_jdk_24_25 > Added tag jdk-24+25 for changeset 4fbf2720 This pull request has now been integrated. Changeset: 4f042037 Author: David Simms URL: https://git.openjdk.org/valhalla/commit/4f042037c52d95c4c6e7a3ae647baea5e819415a Stats: 82484 lines in 1444 files changed: 37439 ins; 38862 del; 6183 mod Merge jdk Merge jdk-24+25 ------------- PR: https://git.openjdk.org/valhalla/pull/1338 From bkilambi at openjdk.org Wed Jan 29 10:18:10 2025 From: bkilambi at openjdk.org (Bhavana Kilambi) Date: Wed, 29 Jan 2025 10:18:10 GMT Subject: [lworld+fp16] RFR: 8345053: Add support for FP16 valueOf routines In-Reply-To: References: Message-ID: On Wed, 22 Jan 2025 11:56:48 GMT, Jatin Bhateja wrote: >> Hi @jatin-bhateja , could you please review this PR? Thanks! > > Hi @Bhavana-Kilambi , Kindly extend [test/micro/org/openjdk/bench/java/lang/Float16OpsBenchmark.java](test/micro/org/openjdk/bench/java/lang/Float16OpsBenchmark.java) to cover newly intrinsified operations and share the results with and without changes. Hi @jatin-bhateja , I have addressed your comments in the new patch. Can you please review and give your feedback? Thanks! ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1332#issuecomment-2621214829 From liach at openjdk.org Wed Jan 29 17:50:19 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 29 Jan 2025 17:50:19 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated Message-ID: Core libraries counterpart of #1336. This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. Testing: test/jdk/java/lang/invoke ------------- Commit messages: - Remove redundant checks for missing locations - New field in MemberName for now - Adapt layouts stage 1 (need to store in MemberName) Changes: https://git.openjdk.org/valhalla/pull/1340/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348607 Stats: 234 lines in 13 files changed: 63 ins; 0 del; 171 mod Patch: https://git.openjdk.org/valhalla/pull/1340.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1340/head:pull/1340 PR: https://git.openjdk.org/valhalla/pull/1340 From liach at openjdk.org Wed Jan 29 21:11:16 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 29 Jan 2025 21:11:16 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: References: Message-ID: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> > Core libraries counterpart of #1336. > > This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. > > Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. > > Testing: test/jdk/java/lang/invoke Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Completely trust the value stored in fields (checked by verifier) - Merge branch 'lworld' of https://github.com/openjdk/valhalla into fix/vh-layout - Fix TestIntrinsics, safety remarks - Fix DMH too - Remove redundant checks for missing locations - New field in MemberName for now - Adapt layouts stage 1 (need to store in MemberName) ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1340/files - new: https://git.openjdk.org/valhalla/pull/1340/files/1c08852b..a06cb9dc Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=00-01 Stats: 82602 lines in 1449 files changed: 37468 ins; 38902 del; 6232 mod Patch: https://git.openjdk.org/valhalla/pull/1340.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1340/head:pull/1340 PR: https://git.openjdk.org/valhalla/pull/1340 From liach at openjdk.org Wed Jan 29 22:28:02 2025 From: liach at openjdk.org (Chen Liang) Date: Wed, 29 Jan 2025 22:28:02 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> References: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> Message-ID: On Wed, 29 Jan 2025 21:11:16 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: > > - Completely trust the value stored in fields (checked by verifier) > - Merge branch 'lworld' of https://github.com/openjdk/valhalla into fix/vh-layout > - Fix TestIntrinsics, safety remarks > - Fix DMH too > - Remove redundant checks for missing locations > - New field in MemberName for now > - Adapt layouts stage 1 (need to store in MemberName) Currently the TestIntrinsics fails on debug because the new getFlatValue/setFlagValue methods do not have intrinsics. Don't know if it's easier to comment out those tests or add new intrinsics. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1340#issuecomment-2623015702 From thartmann at openjdk.org Thu Jan 30 08:24:39 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Thu, 30 Jan 2025 08:24:39 GMT Subject: [lworld] RFR: 8341759: [lworld] JIT support for nullable, atomic, flat fields Message-ID: This change adds support for nullable, atomic, flat fields in C1 and C2 on AArch64 and x64. This includes: - Null marker support in fields and in the calling convention (which currently mirrors the field layout). The main complexity comes from the fact that null markers are no real fields and therefore need to be special cased in quite a few places. - Converting a value object to / from a payload. This required significant changes, especially in C2 where we need to emit shift/mask operations for packing/unpacking field values to/from the scalar representation. C2 did not like loading a long value and suddenly assuming that a part of this long is now an oop, and we also need to be careful that this conversion does not float below a safepoint because then the GC would not know about the oop. - GC barrier changes to support writing a payload that includes (narrow) oops. This was challenging due to G1 late barrier expansion that expects that there is a 1-1 relation between stores and pre-/post-barriers but now we might require two barriers for an atomic store to a flat field with two 32-bit compressed oops. The current implementation is rather hacky and should be re-visited later. - Lots of new tests and some problem listing of existing / independent issues to get compiler stress testing clean. Follow-up work will be done when implementing support for nullable, atomic, flat arrays with [JDK-8341767](https://bugs.openjdk.org/browse/JDK-8341767). Thanks, Tobias ------------- Commit messages: - GC asserts - Fixed problem listing - More refactoring - Refactoring, step 2 - Refactoring step 1 - More fixes - Merge branch 'lworld' into JDK-8341759 - More fixes - Some refactoring - More fixes - ... and 30 more: https://git.openjdk.org/valhalla/compare/287a7b55...900839bb Changes: https://git.openjdk.org/valhalla/pull/1318/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1318&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341759 Stats: 2313 lines in 65 files changed: 2030 ins; 72 del; 211 mod Patch: https://git.openjdk.org/valhalla/pull/1318.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1318/head:pull/1318 PR: https://git.openjdk.org/valhalla/pull/1318 From thartmann at openjdk.org Thu Jan 30 09:22:01 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Thu, 30 Jan 2025 09:22:01 GMT Subject: [lworld] RFR: 8341759: [lworld] JIT support for nullable, atomic, flat fields [v2] In-Reply-To: References: Message-ID: > This change adds support for nullable, atomic, flat fields in C1 and C2 on AArch64 and x64. > > This includes: > - Null marker support in fields and in the calling convention (which currently mirrors the field layout). The main complexity comes from the fact that null markers are no real fields and therefore need to be special cased in quite a few places. > - Converting a value object to / from a payload. This required significant changes, especially in C2 where we need to emit shift/mask operations for packing/unpacking field values to/from the scalar representation. C2 did not like loading a long value and suddenly assuming that a part of this long is now an oop, and we also need to be careful that this conversion does not float below a safepoint because then the GC would not know about the oop. > - GC barrier changes to support writing a payload that includes (narrow) oops. This was challenging due to G1 late barrier expansion that expects that there is a 1-1 relation between stores and pre-/post-barriers but now we might require two barriers for an atomic store to a flat field with two 32-bit compressed oops. The current implementation is rather hacky and should be re-visited later. > - Lots of new tests and some problem listing of existing / independent issues to get compiler stress testing clean. > > Follow-up work will be done when implementing support for nullable, atomic, flat arrays with [JDK-8341767](https://bugs.openjdk.org/browse/JDK-8341767). > > Thanks, > Tobias Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision: Disabled assert due to 8343835 ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1318/files - new: https://git.openjdk.org/valhalla/pull/1318/files/900839bb..1ebb2c2d Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1318&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1318&range=00-01 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/1318.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1318/head:pull/1318 PR: https://git.openjdk.org/valhalla/pull/1318 From dsimms at openjdk.org Thu Jan 30 12:24:40 2025 From: dsimms at openjdk.org (David Simms) Date: Thu, 30 Jan 2025 12:24:40 GMT Subject: [lworld] RFR: Merge jdk Message-ID: Merge jdk-24+27 ------------- Commit messages: - More COH - Exception message change after merge - Bad merge, compilation fix - Merge tag 'jdk-24+27' into lworld_merge_jdk_24_26 - 8344607: Link Time Optimization - basic support for clang - 8345302: Building microbenchmarks require larger Java heap - 8345514: Should use internal class name when calling ClassLoader.getResourceAsByteArray - 8345591: [aarch64] macroAssembler_aarch64.cpp compile fails ceil_log2 not declared - 8328944: NMT reports "unknown" memory - 8345565: Remove remaining SecurityManager motivated APIs from sun.reflect.util - ... and 316 more: https://git.openjdk.org/valhalla/compare/4f042037...53fe4713 The webrevs contain the adjustments done while merging with regards to each parent branch: - lworld: https://webrevs.openjdk.org/?repo=valhalla&pr=1341&range=00.0 - jdk: https://webrevs.openjdk.org/?repo=valhalla&pr=1341&range=00.1 Changes: https://git.openjdk.org/valhalla/pull/1341/files Stats: 121323 lines in 1896 files changed: 84867 ins; 27402 del; 9054 mod Patch: https://git.openjdk.org/valhalla/pull/1341.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1341/head:pull/1341 PR: https://git.openjdk.org/valhalla/pull/1341 From thartmann at openjdk.org Thu Jan 30 13:04:07 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Thu, 30 Jan 2025 13:04:07 GMT Subject: [lworld] Integrated: 8341759: [lworld] JIT support for nullable, atomic, flat fields In-Reply-To: References: Message-ID: On Mon, 16 Dec 2024 13:34:44 GMT, Tobias Hartmann wrote: > This change adds support for nullable, atomic, flat fields in C1 and C2 on AArch64 and x64. > > This includes: > - Null marker support in fields and in the calling convention (which currently mirrors the field layout). The main complexity comes from the fact that null markers are no real fields and therefore need to be special cased in quite a few places. > - Converting a value object to / from a payload. This required significant changes, especially in C2 where we need to emit shift/mask operations for packing/unpacking field values to/from the scalar representation. C2 did not like loading a long value and suddenly assuming that a part of this long is now an oop, and we also need to be careful that this conversion does not float below a safepoint because then the GC would not know about the oop. > - GC barrier changes to support writing a payload that includes (narrow) oops. This was challenging due to G1 late barrier expansion that expects that there is a 1-1 relation between stores and pre-/post-barriers but now we might require two barriers for an atomic store to a flat field with two 32-bit compressed oops. The current implementation is rather hacky and should be re-visited later. > - Lots of new tests and some problem listing of existing / independent issues to get compiler stress testing clean. > > Follow-up work will be done when implementing support for nullable, atomic, flat arrays with [JDK-8341767](https://bugs.openjdk.org/browse/JDK-8341767). > > Thanks, > Tobias This pull request has now been integrated. Changeset: aef1e5b7 Author: Tobias Hartmann URL: https://git.openjdk.org/valhalla/commit/aef1e5b7e3177f63bbb626cafc57f3a611459d8c Stats: 2314 lines in 65 files changed: 2031 ins; 72 del; 211 mod 8341759: [lworld] JIT support for nullable, atomic, flat fields ------------- PR: https://git.openjdk.org/valhalla/pull/1318 From thartmann at openjdk.org Thu Jan 30 13:51:14 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Thu, 30 Jan 2025 13:51:14 GMT Subject: [lworld] RFR: [lworld] Fix broken build due to conflicting mainline merge + 8341759 Message-ID: https://github.com/openjdk/valhalla/pull/1318 conflicts with changes that just came in with the mainline merge. Thanks, Tobias ------------- Commit messages: - [lworld] Fix broken build due to conflicting mainline merge + 8341759 Changes: https://git.openjdk.org/valhalla/pull/1342/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1342&range=00 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1342.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1342/head:pull/1342 PR: https://git.openjdk.org/valhalla/pull/1342 From thartmann at openjdk.org Thu Jan 30 14:01:07 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Thu, 30 Jan 2025 14:01:07 GMT Subject: [lworld] Integrated: [lworld] Fix broken build due to conflicting mainline merge + 8341759 In-Reply-To: References: Message-ID: On Thu, 30 Jan 2025 13:47:41 GMT, Tobias Hartmann wrote: > https://github.com/openjdk/valhalla/pull/1318 conflicts with changes that just came in with the mainline merge. > > Thanks, > Tobias This pull request has now been integrated. Changeset: 27bb9eb2 Author: Tobias Hartmann URL: https://git.openjdk.org/valhalla/commit/27bb9eb2d41e5296daa9c7ec9a22798dd6a24461 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod [lworld] Fix broken build due to conflicting mainline merge + 8341759 ------------- PR: https://git.openjdk.org/valhalla/pull/1342 From dsimms at openjdk.org Thu Jan 30 15:05:57 2025 From: dsimms at openjdk.org (David Simms) Date: Thu, 30 Jan 2025 15:05:57 GMT Subject: [lworld] RFR: Merge jdk [v2] In-Reply-To: References: Message-ID: > Merge jdk-24+27 David Simms has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 327 commits: - Merge branch 'lworld' into lworld_merge_jdk_24_26 - More COH - Exception message change after merge - Bad merge, compilation fix - Merge tag 'jdk-24+27' into lworld_merge_jdk_24_26 Added tag jdk-24+27 for changeset 85fedbf6 - 8344607: Link Time Optimization - basic support for clang Reviewed-by: lucy, jkern, ihse - 8345302: Building microbenchmarks require larger Java heap Reviewed-by: shade, mcimadamore - 8345514: Should use internal class name when calling ClassLoader.getResourceAsByteArray Reviewed-by: iklam, matsaave - 8345591: [aarch64] macroAssembler_aarch64.cpp compile fails ceil_log2 not declared Reviewed-by: coleenp, alanb, syan - 8328944: NMT reports "unknown" memory Reviewed-by: jsjolen, coleenp - ... and 317 more: https://git.openjdk.org/valhalla/compare/27bb9eb2...bb16d983 ------------- Changes: https://git.openjdk.org/valhalla/pull/1341/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1341&range=01 Stats: 121322 lines in 1896 files changed: 84866 ins; 27402 del; 9054 mod Patch: https://git.openjdk.org/valhalla/pull/1341.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1341/head:pull/1341 PR: https://git.openjdk.org/valhalla/pull/1341 From dsimms at openjdk.org Thu Jan 30 15:11:25 2025 From: dsimms at openjdk.org (David Simms) Date: Thu, 30 Jan 2025 15:11:25 GMT Subject: [lworld] Integrated: Merge jdk In-Reply-To: References: Message-ID: On Thu, 30 Jan 2025 12:17:27 GMT, David Simms wrote: > Merge jdk-24+27 This pull request has now been integrated. Changeset: eec4e6de Author: David Simms URL: https://git.openjdk.org/valhalla/commit/eec4e6de5d50ba1843f12f310e6d6e895cd4483b Stats: 121322 lines in 1896 files changed: 84866 ins; 27402 del; 9054 mod Merge jdk Merge jdk-24+27 ------------- PR: https://git.openjdk.org/valhalla/pull/1341 From rriggs at openjdk.org Thu Jan 30 17:44:59 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 30 Jan 2025 17:44:59 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> References: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> Message-ID: On Wed, 29 Jan 2025 21:11:16 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: > > - Completely trust the value stored in fields (checked by verifier) > - Merge branch 'lworld' of https://github.com/openjdk/valhalla into fix/vh-layout > - Fix TestIntrinsics, safety remarks > - Fix DMH too > - Remove redundant checks for missing locations > - New field in MemberName for now > - Adapt layouts stage 1 (need to store in MemberName) src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 118: > 116: } else { > 117: long offset = MethodHandleNatives.objectFieldOffset(member); > 118: int layout = member.isFlat() ? member.getLayout() : 0; It would be cleaner to define layout == 0 as flat, so separate tests were not necessary. The layout field should always have a value. src/java.base/share/classes/java/lang/invoke/MemberName.java line 450: > 448: /** > 449: * VM-internal layout code for this field {@link jdk.internal.misc.Unsafe#fieldLayout(Field)}. > 450: * Only meaningful if the field {@link #isFlat()}, otherwise this may be garbage. Can this be improved to have layout == 0 if !isFlat? It would be cleaner and allow fewer tests in the code. It might even be able to save a bit by testing the `highFlags & MN_HIGHT_LAYOUT_MASK == 0` instead of isFlat. And Yes, I know this comes from the VM changes, it would need to be pushed back to the vm. src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template line 52: > 50: final CheckedType checkedFieldType; > 51: #end[Object] > 52: #if[Value] Can this parameter "Value" be changed to "FlatValue" to be consistent with the other method and variable names supporting flat values. src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 246: > 244: * or layout control with this value, it is just an opaque token > 245: * used for performance reasons. This value may be garbage if this field > 246: * is not {@link #isFlatField}. 1. Other code implicitly assumes this is only 3 bits. Somewhere there should be an assert checking that assumption. 2. We should request that the VM has a default value so it is never garbage. 3. The test to know whether the value is valid should be documented here. 4. The test for null seems redundant with the check in the VM's Unsafe_FieldLayout implementation. 5. Please fix the indentation on the `return` below. test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestIntrinsics.java line 1625: > 1623: Field field = Test80Value1.class.getDeclaredField("v"); > 1624: var flat = U.isFlatField(field); > 1625: Asserts.assertEQ(test80(v, flat, flat ? U.fieldLayout(field) : 0, U.objectFieldOffset(field)), v.v); This is a good example showing why fieldLayout() should return a known value even if not flat. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1935825887 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1935830967 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1935812096 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1935853016 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936030768 From rriggs at openjdk.org Thu Jan 30 17:49:06 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Thu, 30 Jan 2025 17:49:06 GMT Subject: [lworld] Integrated: 8348585: [lworld] ProcessReaper stack size too small In-Reply-To: References: Message-ID: On Tue, 28 Jan 2025 23:19:57 GMT, Roger Riggs wrote: > The reaper stack size is insufficient to initialize the method handles for the equals methods of the primitive classes. > Instead of incrasing the stack size, perform the initialization before the reaper thread is created. > > An earlier change to increase the stack only for a debug build is reverted, it is no longer needed. This pull request has now been integrated. Changeset: f1afc426 Author: Roger Riggs URL: https://git.openjdk.org/valhalla/commit/f1afc426f3e3b9041d9f06246a9c60c2ba0cd4cf Stats: 7 lines in 1 file changed: 4 ins; 0 del; 3 mod 8348585: [lworld] ProcessReaper stack size too small ------------- PR: https://git.openjdk.org/valhalla/pull/1339 From liach at openjdk.org Thu Jan 30 19:26:04 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 30 Jan 2025 19:26:04 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: References: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> Message-ID: On Thu, 30 Jan 2025 15:35:05 GMT, Roger Riggs wrote: >> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Completely trust the value stored in fields (checked by verifier) >> - Merge branch 'lworld' of https://github.com/openjdk/valhalla into fix/vh-layout >> - Fix TestIntrinsics, safety remarks >> - Fix DMH too >> - Remove redundant checks for missing locations >> - New field in MemberName for now >> - Adapt layouts stage 1 (need to store in MemberName) > > src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 118: > >> 116: } else { >> 117: long offset = MethodHandleNatives.objectFieldOffset(member); >> 118: int layout = member.isFlat() ? member.getLayout() : 0; > > It would be cleaner to define layout == 0 as flat, so separate tests were not necessary. > The layout field should always have a value. Sure, currently `layout == 0` means non-flat (reference pointer). We can do that for MemberName and other things. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936164679 From vromero at openjdk.org Thu Jan 30 22:56:40 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 30 Jan 2025 22:56:40 GMT Subject: [lworld] Integrated: 8349073: [lworld] minimal support for @Strict In-Reply-To: References: Message-ID: On Thu, 30 Jan 2025 22:51:33 GMT, Vicente Romero wrote: > Additional experimental support for `@Strict` annotation in javac This pull request has now been integrated. Changeset: dd86b1e4 Author: Vicente Romero URL: https://git.openjdk.org/valhalla/commit/dd86b1e4e31313feaac8f7ca4978b87f24b6f532 Stats: 75 lines in 6 files changed: 70 ins; 0 del; 5 mod 8349073: [lworld] minimal support for @Strict ------------- PR: https://git.openjdk.org/valhalla/pull/1344 From vromero at openjdk.org Thu Jan 30 22:56:39 2025 From: vromero at openjdk.org (Vicente Romero) Date: Thu, 30 Jan 2025 22:56:39 GMT Subject: [lworld] Integrated: 8349073: [lworld] minimal support for @Strict Message-ID: Additional experimental support for `@Strict` annotation in javac ------------- Commit messages: - 8349073: [lworld] minimal support for @Strict Changes: https://git.openjdk.org/valhalla/pull/1344/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1344&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8349073 Stats: 75 lines in 6 files changed: 70 ins; 0 del; 5 mod Patch: https://git.openjdk.org/valhalla/pull/1344.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1344/head:pull/1344 PR: https://git.openjdk.org/valhalla/pull/1344 From liach at openjdk.org Thu Jan 30 23:54:36 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 30 Jan 2025 23:54:36 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v3] In-Reply-To: References: Message-ID: <2pKEQdCEcKLTK_PQLbTlJQVfCuf7XC5tW_Hi7nKdcEY=.6a2638b0-6072-4602-bd88-5168284fbdeb@github.com> > Core libraries counterpart of #1336. > > This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. > > Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. > > Testing: test/jdk/java/lang/invoke Chen Liang has updated the pull request incrementally with one additional commit since the last revision: Review remarks and other adjustments Value in template -> FlatValue Update flat encoding in MemberName, remove high flags for now layout 0 means non-flat reliably Problemlist TestIntrinsics, issue created ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1340/files - new: https://git.openjdk.org/valhalla/pull/1340/files/a06cb9dc..87a21b8c Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=02 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=01-02 Stats: 171 lines in 11 files changed: 13 ins; 27 del; 131 mod Patch: https://git.openjdk.org/valhalla/pull/1340.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1340/head:pull/1340 PR: https://git.openjdk.org/valhalla/pull/1340 From liach at openjdk.org Thu Jan 30 23:54:41 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 30 Jan 2025 23:54:41 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: References: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> Message-ID: On Thu, 30 Jan 2025 23:50:16 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/invoke/MemberName.java line 450: >> >>> 448: /** >>> 449: * VM-internal layout code for this field {@link jdk.internal.misc.Unsafe#fieldLayout(Field)}. >>> 450: * Only meaningful if the field {@link #isFlat()}, otherwise this may be garbage. >> >> Can this be improved to have layout == 0 if !isFlat? >> It would be cleaner and allow fewer tests in the code. >> It might even be able to save a bit by testing the `highFlags & MN_HIGHT_LAYOUT_MASK == 0` instead of isFlat. >> And Yes, I know this comes from the VM changes, it would need to be pushed back to the vm. > > Yep, removed the flat bit, and as a result removed the high flags in MemberName. Flat is now derived from the 3 layout bits all being 0. Formalized `layout == 0` for non-flat, other values are for flat, but up to VM interpretation. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936464628 From liach at openjdk.org Thu Jan 30 23:54:40 2025 From: liach at openjdk.org (Chen Liang) Date: Thu, 30 Jan 2025 23:54:40 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v2] In-Reply-To: References: <3XEFOvI5tr8xNQBEH4g_2dncQVrZCdAb98WPHerh-AU=.88f47539-cee4-4355-ae81-1fd2303deb2d@github.com> Message-ID: On Thu, 30 Jan 2025 15:37:53 GMT, Roger Riggs wrote: >> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: >> >> - Completely trust the value stored in fields (checked by verifier) >> - Merge branch 'lworld' of https://github.com/openjdk/valhalla into fix/vh-layout >> - Fix TestIntrinsics, safety remarks >> - Fix DMH too >> - Remove redundant checks for missing locations >> - New field in MemberName for now >> - Adapt layouts stage 1 (need to store in MemberName) > > src/java.base/share/classes/java/lang/invoke/MemberName.java line 450: > >> 448: /** >> 449: * VM-internal layout code for this field {@link jdk.internal.misc.Unsafe#fieldLayout(Field)}. >> 450: * Only meaningful if the field {@link #isFlat()}, otherwise this may be garbage. > > Can this be improved to have layout == 0 if !isFlat? > It would be cleaner and allow fewer tests in the code. > It might even be able to save a bit by testing the `highFlags & MN_HIGHT_LAYOUT_MASK == 0` instead of isFlat. > And Yes, I know this comes from the VM changes, it would need to be pushed back to the vm. Yep, removed the flat bit, and as a result removed the high flags in MemberName. Flat is now derived from the 3 layout bits all being 0. > src/java.base/share/classes/java/lang/invoke/X-VarHandle.java.template line 52: > >> 50: final CheckedType checkedFieldType; >> 51: #end[Object] >> 52: #if[Value] > > Can this parameter "Value" be changed to "FlatValue" to be consistent with the other method and variable names supporting flat values. Done. > src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 246: > >> 244: * or layout control with this value, it is just an opaque token >> 245: * used for performance reasons. This value may be garbage if this field >> 246: * is not {@link #isFlatField}. > > 1. Other code implicitly assumes this is only 3 bits. Somewhere there should be an assert checking that assumption. > 2. We should request that the VM has a default value so it is never garbage. > 3. The test to know whether the value is valid should be documented here. > 4. The test for null seems redundant with the check in the VM's Unsafe_FieldLayout implementation. > 5. Please fix the indentation on the `return` below. Done, check added in VM code that fills MemberName. The only known-to-lib info now is that 0 is non-flat, other values are random flat values specific to VM. ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936464164 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936464217 PR Review Comment: https://git.openjdk.org/valhalla/pull/1340#discussion_r1936463015 From liach at openjdk.org Fri Jan 31 00:29:53 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 31 Jan 2025 00:29:53 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v4] In-Reply-To: References: Message-ID: <_CcSta0f7K6jCuviM9mhtUvL5qh4DAeOO2-BzxTX_v0=.e82675db-c346-446f-bf9c-c58ed8a75b51@github.com> > Core libraries counterpart of #1336. > > This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. > > Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. > > Testing: test/jdk/java/lang/invoke Chen Liang has updated the pull request incrementally with one additional commit since the last revision: Omitted remnants ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1340/files - new: https://git.openjdk.org/valhalla/pull/1340/files/87a21b8c..7fef36f8 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=03 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=02-03 Stats: 2 lines in 2 files changed: 0 ins; 2 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/1340.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1340/head:pull/1340 PR: https://git.openjdk.org/valhalla/pull/1340 From thartmann at openjdk.org Fri Jan 31 08:16:03 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 31 Jan 2025 08:16:03 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v4] In-Reply-To: <_CcSta0f7K6jCuviM9mhtUvL5qh4DAeOO2-BzxTX_v0=.e82675db-c346-446f-bf9c-c58ed8a75b51@github.com> References: <_CcSta0f7K6jCuviM9mhtUvL5qh4DAeOO2-BzxTX_v0=.e82675db-c346-446f-bf9c-c58ed8a75b51@github.com> Message-ID: <0QoVdNsqNEWGClkwdKYJwVCPEbw79xzDzNboApV8alY=.342b2504-ec23-4881-927f-5130566ccf0f@github.com> On Fri, 31 Jan 2025 00:29:53 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Omitted remnants Instead of problem listing the entire TestIntrinsics.java, could you please only exclude the failing sub-tests, via `-DExclude=...`? See "2.6 Framework Debug and Stress Flags" of https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/README.md ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1340#issuecomment-2626577919 From liach at openjdk.org Fri Jan 31 11:30:54 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 31 Jan 2025 11:30:54 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: > Core libraries counterpart of #1336. > > This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. > > Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. > > Testing: test/jdk/java/lang/invoke Chen Liang has updated the pull request incrementally with one additional commit since the last revision: Use exclude, do not use problemlist ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1340/files - new: https://git.openjdk.org/valhalla/pull/1340/files/7fef36f8..226767b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=04 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1340&range=03-04 Stats: 5 lines in 2 files changed: 3 ins; 2 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/1340.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1340/head:pull/1340 PR: https://git.openjdk.org/valhalla/pull/1340 From liach at openjdk.org Fri Jan 31 11:34:04 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 31 Jan 2025 11:34:04 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v4] In-Reply-To: <0QoVdNsqNEWGClkwdKYJwVCPEbw79xzDzNboApV8alY=.342b2504-ec23-4881-927f-5130566ccf0f@github.com> References: <_CcSta0f7K6jCuviM9mhtUvL5qh4DAeOO2-BzxTX_v0=.e82675db-c346-446f-bf9c-c58ed8a75b51@github.com> <0QoVdNsqNEWGClkwdKYJwVCPEbw79xzDzNboApV8alY=.342b2504-ec23-4881-927f-5130566ccf0f@github.com> Message-ID: On Fri, 31 Jan 2025 08:12:58 GMT, Tobias Hartmann wrote: >> Chen Liang has updated the pull request incrementally with one additional commit since the last revision: >> >> Omitted remnants > > Instead of problem listing the entire TestIntrinsics.java, could you please only exclude the failing sub-tests, via `-DExclude=...`? See "2.6 Framework Debug and Stress Flags" of https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/lib/ir_framework/README.md @TobiHartmann Done. This works for the linux-x64-debug config. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1340#issuecomment-2626989340 From thartmann at openjdk.org Fri Jan 31 12:47:06 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Fri, 31 Jan 2025 12:47:06 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: On Fri, 31 Jan 2025 11:30:54 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Use exclude, do not use problemlist Perfect, thank you! ------------- PR Review: https://git.openjdk.org/valhalla/pull/1340#pullrequestreview-2586550101 From duke at openjdk.org Fri Jan 31 14:03:05 2025 From: duke at openjdk.org (duke) Date: Fri, 31 Jan 2025 14:03:05 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: On Fri, 31 Jan 2025 11:30:54 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Use exclude, do not use problemlist @liach Your change (at version 226767b25d8dd24c9760ea2d7cd2e5eb145f014c) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1340#issuecomment-2627425095 From rriggs at openjdk.org Fri Jan 31 15:35:55 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 31 Jan 2025 15:35:55 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: On Fri, 31 Jan 2025 11:30:54 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Use exclude, do not use problemlist For a change of this magnitude and context, please wait for a reviewer. Though Valhalla does not require a reviewer, reviews by knowledgeable developers are important. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1340#issuecomment-2627630826 From rriggs at openjdk.org Fri Jan 31 16:29:58 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 31 Jan 2025 16:29:58 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: <38yH7823XU7mogIftpUmBPIIRojbtqo8ZK0DQCBb2pc=.419368fe-240c-421b-a05c-bbed0ec2ccdf@github.com> On Fri, 31 Jan 2025 11:30:54 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Use exclude, do not use problemlist Looks good, thanks for the renaming and consolidation of the isFlat and layout fields. ------------- Marked as reviewed by rriggs (Committer). PR Review: https://git.openjdk.org/valhalla/pull/1340#pullrequestreview-2587234440 From fparain at openjdk.org Fri Jan 31 17:33:06 2025 From: fparain at openjdk.org (Frederic Parain) Date: Fri, 31 Jan 2025 17:33:06 GMT Subject: [lworld] RFR: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated [v5] In-Reply-To: References: Message-ID: On Fri, 31 Jan 2025 11:30:54 GMT, Chen Liang wrote: >> Core libraries counterpart of #1336. >> >> This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. >> >> Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. >> >> Testing: test/jdk/java/lang/invoke > > Chen Liang has updated the pull request incrementally with one additional commit since the last revision: > > Use exclude, do not use problemlist LGTM Thank you for fixing those classes. ------------- Marked as reviewed by fparain (Committer). PR Review: https://git.openjdk.org/valhalla/pull/1340#pullrequestreview-2587359066 From liach at openjdk.org Fri Jan 31 17:35:55 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 31 Jan 2025 17:35:55 GMT Subject: [lworld] Integrated: 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated In-Reply-To: References: Message-ID: On Wed, 29 Jan 2025 17:46:05 GMT, Chen Liang wrote: > Core libraries counterpart of #1336. > > This requires MemberName to fetch more information in initialization. A new int high flag field is added, in anticipation to a merger with the regular int flag field in the future. Currently, directly migrating the flags field to long is too impactful to the whole codebase. > > Also 8348680 is addressed as well; it's some minor updates to make the null checks specific to references VH. > > Testing: test/jdk/java/lang/invoke This pull request has now been integrated. Changeset: ab4ae37b Author: Chen Liang Committer: Roger Riggs URL: https://git.openjdk.org/valhalla/commit/ab4ae37b80e79d324351c175b9f887aec0cb7427 Stats: 332 lines in 15 files changed: 80 ins; 43 del; 209 mod 8348607: [lworld] Calls to Unsafe.getValue() / Unsafe.putValue() must be updated 8348680: [lworld] Useless checks in generated VarHandle code for flat fields Reviewed-by: rriggs, fparain ------------- PR: https://git.openjdk.org/valhalla/pull/1340 From rriggs at openjdk.org Fri Jan 31 20:31:18 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Fri, 31 Jan 2025 20:31:18 GMT Subject: [lworld] RFR: 8348904: [lworld] Remove concept of default value object and zeroInstance Message-ID: Remove support for the default value object and zeroInstance, no longer included in the spec. In related tests, test cases were removed if no longer applicable or replaced by a hand created zero/null object. ------------- Commit messages: - 8348904: [lworld] Remove concept of default value object and zeroInstance Changes: https://git.openjdk.org/valhalla/pull/1346/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1346&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8348904 Stats: 99 lines in 13 files changed: 4 ins; 60 del; 35 mod Patch: https://git.openjdk.org/valhalla/pull/1346.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1346/head:pull/1346 PR: https://git.openjdk.org/valhalla/pull/1346 From fparain at openjdk.org Fri Jan 31 21:53:38 2025 From: fparain at openjdk.org (Frederic Parain) Date: Fri, 31 Jan 2025 21:53:38 GMT Subject: [lworld] RFR: 8349162: [lworld] VM Flags controlling flattening need an update Message-ID: This patch is mostly about VM flags update and internal renaming. Renaming a few symbols to make them consistent with previous code cleanup: - data_for_oop() -> payload_address() - first_field_offset() -> payload_offset() - LayoutKind::PAYLOAD -> LayoutKind::BUFFERED (it is only used to describe layout in buffered values, and it makes it an adjective like the other LayoutKind values) VM flags controlling flattening: - size based VM flags are removed: FlatArrayElementMaxSize, InlineFieldMaxFlatSize. For now, FlatArrayElementMaxOops is still present because some compiler tests rely on it, but it will be removed eventually - InlineArrayAtomicAccess has been removed, use AlwaysAtomicAccesses instead - new VM flags to control the generation of the new layouts: NonAtomicValueFlattening, AtomicValueFlattening, NullableValueFlattening. Note that that those flags control the generation of the layouts, not the way they are used (see flags below) - new VM flags to control use of flat layouts: UseFlatField, UseFlatArray Example: To enable flattening of nullable fields, the flag combination is -XX:+NullableValueFlattening -XX:+UseFlatField The new VM flags controlling flattening are flags for testing or troubleshooting (they should probably be turned into DIAGNOSTIC flags before preview). They are not designed for performance tuning. Feel free to propose new names for those flags if you think they are not explicit enough. Thank you, Fred ------------- Commit messages: - Merge remote-tracking branch 'upstream/lworld' into renaming - Renaming and VM flags cleanup Changes: https://git.openjdk.org/valhalla/pull/1345/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1345&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8349162 Stats: 644 lines in 89 files changed: 324 ins; 20 del; 300 mod Patch: https://git.openjdk.org/valhalla/pull/1345.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1345/head:pull/1345 PR: https://git.openjdk.org/valhalla/pull/1345