Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code

2023-05-26 Thread Matthias Baesken
On Thu, 25 May 2023 16:13:49 GMT, JoKern65 wrote: >> test/jdk/java/io/File/libGetXSpace.c line 128: >> >>> 126: #else >>> 127: struct statfs buf; >>> 128: int result = statfs((char*)chars, &buf); >> >> Is this working around a bug in IBM's declaration? >> >> Also, pre-existing, the cas

Re: RFR: 8308286 Fix clang warnings in linux code

2023-05-26 Thread Daniel Jeliński
On Wed, 17 May 2023 12:28:47 GMT, Artem Semenov wrote: > When using the clang compiler to build OpenJDk on Linux, we encounter various > "warnings as errors". > They can be fixed with small changes. According to our docs, [clang is a supported compiler for Linux](https://github.com/openjdk/jdk

Re: RFR: 8308842: Consolidate exceptions thrown from Class-File API [v2]

2023-05-26 Thread Adam Sotona
> Class-File API actually throws wide variety of exceptions based on the actual > situation. Complete error handling code must cover > `IndexOutOfBoundsException`, `IllegalStateException` and > `IllegalArgumentException`. > > Based on previous discussions we decided to consolidate on > `Illeg

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 07:12:07 GMT, Matthias Baesken wrote: >> This is IBMs declaration of statfs >> `extern int statfs(char *, struct statfs *);` >> So the compiler will not accept a `const char*` >> Indeed I do not know if this ever worked, but my change makes it not worse. > > Here is the docume

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk > on AIX , we run into various "warnings as errors". > Some of those are in shared codebase and could be addressed by small > adjustments. > A lot of those changes are in hotspot, some might be somewhere else in the >

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 00:13:57 GMT, Andrei Pangin wrote: >> UUID is the very important class that is used to track identities of objects >> in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% >> of total CPU time, and is frequently a scalability bottleneck due to >> `Secu

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 00:50:04 GMT, Brett Okken wrote: >> UUID is the very important class that is used to track identities of objects >> in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% >> of total CPU time, and is frequently a scalability bottleneck due to >> `Secure

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 06:47:29 GMT, Hannes Greule wrote: >> src/java.base/share/classes/java/util/UUID.java line 286: >> >>> 284: long lsb = 0; >>> 285: for (int i = start; i < start + 8; i++) { >>> 286: msb = (msb << 8) | (data[i] & 0xff); >> >> Can we use VarHandle/B

Re: RFR: 8306431: File.listRoots method description should be re-examined [v7]

2023-05-26 Thread Nagata-Haruhito
On Mon, 22 May 2023 07:27:00 GMT, Nagata-Haruhito wrote: >> I fixed File.listRoots description. >> * remove "the insertion or ejection of removable media" >> * change "available" to "existing" >> >> Please review this change. > > Nagata-Haruhito has updated the pull request incrementally with on

Re: RFR: 8308842: Consolidate exceptions thrown from Class-File API [v2]

2023-05-26 Thread Adam Sotona
On Thu, 25 May 2023 22:45:01 GMT, ExE Boss wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed javadoc > > src/java.base/share/classes/jdk/internal/classfile/CodeBuilder.java line 389: > >> 387: // Check

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 00:16:19 GMT, Andrei Pangin wrote: >> UUID is the very important class that is used to track identities of objects >> in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% >> of total CPU time, and is frequently a scalability bottleneck due to >> `Secu

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 08:39:10 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/util/UUID.java line 260: >> >>> 258: buf[c + 8] &= 0x3f; /* clear variant*/ >>> 259: buf[c + 8] |= (byte) 0x80; /* set to IETF >>> variant */

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v2]

2023-05-26 Thread Aleksey Shipilev
> UUID is the very important class that is used to track identities of objects > in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% > of total CPU time, and is frequently a scalability bottleneck due to > `SecureRandom` synchronization. > > The major issue with UUID cod

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v2]

2023-05-26 Thread Aleksey Shipilev
On Thu, 25 May 2023 12:17:27 GMT, Alan Bateman wrote: >> Aleksey Shipilev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Handle privileged properties >> - Use ByteArray to convert. Do version/variant preparations straight on >> loca

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v2]

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 08:37:49 GMT, Aleksey Shipilev wrote: >> `jdk.internal.util.ByteArray` has VarHandle-based methods ready for that > > Yes, I have that optimization in the pipeline, and wanted to do so > separately. I can still fold it here, let me see. Did so in new commit. -

Re: RFR: 8308803: Improve java/util/UUID/UUIDTest.java

2023-05-26 Thread Aleksey Shipilev
On Wed, 24 May 2023 19:18:33 GMT, Aleksey Shipilev wrote: > UUID is very important class that is used to track identities of objects in > large scale systems. Yet, the coverage in JDK test is disappointing: it tests > only 100 of UUID instances per test, which is way too small to detect > coll

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those chang

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those chang

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:05:56 GMT, JoKern65 wrote: > src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c:1251:7: error: > '_ALLBSD_SOURCE' is not defined, evaluates to 0 [-Werror,-Wundef] > #elif _ALLBSD_SOURCE > Should probably better be `#elif defined(_ALLBSD_SOURCE)` - P

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:18:37 GMT, JoKern65 wrote: > src/java.base/share/native/libjli/java.c:2311:22: error: format string is not > a string literal [-Werror,-Wformat-nonliteral] vfprintf(stderr, fmt, vl); ^~~ We disable this warning too for clang on all platforms in BUILD_LIBJLI ( DISABLED_WA

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Matthias Baesken
On Fri, 26 May 2023 10:18:37 GMT, JoKern65 wrote: > Here are the reasons for the disabled warnings in > make/modules/java.base/lib/CoreLibraries.gmk > DISABLED_WARNINGS_clang_aix_ProcessHandleImpl_unix.c := sign-compare, > DISABLED_WARNINGS_clang_aix := gnu-pointer-arith, DISABLED_WARNINGS_cla

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v2]

2023-05-26 Thread Daniel Fuchs
On Fri, 26 May 2023 09:51:47 GMT, Aleksey Shipilev wrote: >> UUID is the very important class that is used to track identities of objects >> in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% >> of total CPU time, and is frequently a scalability bottleneck due to >> `S

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v3]

2023-05-26 Thread Aleksey Shipilev
> UUID is the very important class that is used to track identities of objects > in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% > of total CPU time, and is frequently a scalability bottleneck due to > `SecureRandom` synchronization. > > The major issue with UUID cod

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v2]

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 11:24:10 GMT, Daniel Fuchs wrote: >> Aleksey Shipilev has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Handle privileged properties >> - Use ByteArray to convert. Do version/variant preparations straight on >> loca

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v3]

2023-05-26 Thread Andrei Pangin
On Fri, 26 May 2023 08:36:46 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/util/UUID.java line 224: >> >>> 222: // Try to pull the UUID from the current buffer at >>> current position. >>> 223: if (stamp != 0) { >>> 224:

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v3]

2023-05-26 Thread Andrei Pangin
On Fri, 26 May 2023 11:43:11 GMT, Aleksey Shipilev wrote: >> UUID is the very important class that is used to track identities of objects >> in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% >> of total CPU time, and is frequently a scalability bottleneck due to >> `S

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread JoKern65
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those chang

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v20]

2023-05-26 Thread Jim Laskey
On Fri, 26 May 2023 06:20:14 GMT, Rémi Forax wrote: >> test/jdk/tools/launcher/InstanceMainTest.java line 31: >> >>> 29: * @run main InstanceMainTest >>> 30: */ >>> 31: public class InstanceMainTest extends TestHelper { >> >> By my reading of the spec, "main" methods can be defined in record

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v21]

2023-05-26 Thread Jim Laskey
> Add flexible main methods and anonymous main classes to the Java language. Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Add main tests for inferface/enum/record - Changes: - all: https://git.openjdk.org/jdk/pull/13

Re: RFR: 8291065: Creating a VarHandle for a static field triggers class initialization [v3]

2023-05-26 Thread Chen Liang
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote: >> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`. >> >> A few implementation-detail methods in VarHandle are now documented with the >> implied constraints to avoid subtle problems in the future. Changed >> `Indire

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v22]

2023-05-26 Thread Jim Laskey
> Add flexible main methods and anonymous main classes to the Java language. Jim Laskey has updated the pull request incrementally with one additional commit since the last revision: Remove trailing whitespace - Changes: - all: https://git.openjdk.org/jdk/pull/13689/files - n

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Martin Doerr
On Fri, 26 May 2023 08:31:46 GMT, JoKern65 wrote: >> When using the new xlc17 compiler (based on a recent clang) to build OpenJDk >> on AIX , we run into various "warnings as errors". >> Some of those are in shared codebase and could be addressed by small >> adjustments. >> A lot of those chang

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v4]

2023-05-26 Thread Aleksey Shipilev
> UUID is the very important class that is used to track identities of objects > in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% > of total CPU time, and is frequently a scalability bottleneck due to > `SecureRandom` synchronization. > > The major issue with UUID cod

RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Roger Riggs
Decouple the jdk.internal.util OperatingSystem and Version classes to simplify class loading and avoid an indirect cyclic initialization. Move the method to get the current OS version from OperatingSystem to the Version class and its initialization. Revert to using String.toUpperCase() instead o

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v3]

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 12:01:50 GMT, Andrei Pangin wrote: >> Aleksey Shipilev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fine-tune exceptions > > src/java.base/share/classes/java/util/UUID.java line 226: > >> 224: // s

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Roger Riggs
On Fri, 26 May 2023 15:21:42 GMT, Daniel Fuchs wrote: > Should we take this opportunity to rename `jdk.internal.util.Version` into > something like `OsVersion` to make it more clear what its `current()` method > actually returns? ok, it will give a bit more flavor; there are already multiple v

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v4]

2023-05-26 Thread Roger Riggs
On Thu, 25 May 2023 14:04:35 GMT, Aleksey Shipilev wrote: >> src/java.base/share/classes/java/util/UUID.java line 149: >> >>> 147: } else { >>> 148: try { >>> 149: return SecureRandom.getInstance(PRNG_NAME); >> >> Part of the change here is that t

RFR: 8308748: JNU_GetStringPlatformChars may write to String's internal memory array

2023-05-26 Thread Rudi Horn
This change prevents the contents of the internal string array from being copied back when releasing it. - Commit messages: - Use JNI_ABORT to release string bytes Changes: https://git.openjdk.org/jdk/pull/14117/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14117&range=00

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Daniel Fuchs
On Fri, 26 May 2023 14:57:21 GMT, Roger Riggs wrote: > Decouple the jdk.internal.util OperatingSystem and Version classes to > simplify class loading and avoid an indirect cyclic initialization. > > Move the method to get the current OS version from OperatingSystem to the > Version class and i

Re: RFR: 8308452: Extend internal Architecture enum with byte order and address size [v2]

2023-05-26 Thread Roger Riggs
> The internal enum jdk.internal.util.Architecture does not provide information > about the big or little endianness or the address size (64 or 32 bits). The > endian-ness and address size are intrinsic to the architecture. > > The values of the enum are extended to separately identify the big

Re: RFR: 8290499: new File(parent, "/") breaks normalization – creates File with slash at the end

2023-05-26 Thread Roger Riggs
On Tue, 23 May 2023 22:49:57 GMT, Brian Burkhalter wrote: > In `java.io.File`, change the constructors `File(File,String)` and > `File(String,String)` so that they do not for typical cases return a `File` > whose path has a trailing name separator. LGTM - Marked as reviewed by rr

Re: RFR: 8306431: File.listRoots method description should be re-examined [v7]

2023-05-26 Thread Brian Burkhalter
On Fri, 26 May 2023 08:46:09 GMT, Nagata-Haruhito wrote: > Would you please review this PR ? We are in the last two weeks before JDK 21 rampdown phase 1 and so are rather busy. This PR has not been forgotten. Thanks for you patience. - PR Comment: https://git.openjdk.org/jdk/pull/

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 14:57:21 GMT, Roger Riggs wrote: > Decouple the jdk.internal.util OperatingSystem and Version classes to > simplify class loading and avoid an indirect cyclic initialization. > > Move the method to get the current OS version from OperatingSystem to the > Version class and i

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 15:32:20 GMT, Roger Riggs wrote: > Should we take this opportunity to rename `jdk.internal.util.Version` into > something like `OsVersion` to make it more clear what its `current()` method > actually returns? Alternatively, move `Version` record as a nested class in `Operat

Re: RFR: 8291065: Creating a VarHandle for a static field triggers class initialization [v3]

2023-05-26 Thread Mandy Chung
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote: >> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`. >> >> A few implementation-detail methods in VarHandle are now documented with the >> implied constraints to avoid subtle problems in the future. Changed >> `Indire

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 14:57:21 GMT, Roger Riggs wrote: > Decouple the jdk.internal.util OperatingSystem and Version classes to > simplify class loading and avoid an indirect cyclic initialization. > > Move the method to get the current OS version from OperatingSystem to the > Version class and i

Withdrawn: 8308293: A linker should expose the layouts it supports

2023-05-26 Thread Maurizio Cimadamore
On Wed, 17 May 2023 17:15:06 GMT, Maurizio Cimadamore wrote: > This patch adds an instance method on `Linker`, namely > `Linker::canonicalLayouts` which returns all the layouts known by the linker > as implementing some ABI type. For instance, if I call this on my machine > (Linux/x64) I get

Re: RFR: 8308293: A linker should expose the layouts it supports [v6]

2023-05-26 Thread Maurizio Cimadamore
On Wed, 24 May 2023 09:36:34 GMT, Maurizio Cimadamore wrote: >> This patch adds an instance method on `Linker`, namely >> `Linker::canonicalLayouts` which returns all the layouts known by the linker >> as implementing some ABI type. For instance, if I call this on my machine >> (Linux/x64) I

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Roger Riggs
On Fri, 26 May 2023 14:57:21 GMT, Roger Riggs wrote: > Decouple the jdk.internal.util OperatingSystem and Version classes to > simplify class loading and avoid an indirect cyclic initialization. > > Move the method to get the current OS version from OperatingSystem to the > Version class and i

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes

2023-05-26 Thread Daniel Fuchs
On Fri, 26 May 2023 16:16:58 GMT, Mandy Chung wrote: > Alternatively, move `Version` record as a nested class in `OperatingSystem`. That would work WRT naming, but I thought the point was to not have to load OperatingSystem in order to load Version? Unless loading a static inner class doesn't f

Re: RFR: 8308960: Decouple internal Version and OperatingSystem classes [v2]

2023-05-26 Thread Roger Riggs
> Decouple the jdk.internal.util OperatingSystem and Version classes to > simplify class loading and avoid an indirect cyclic initialization. > > Move the method to get the current OS version from OperatingSystem to the > Version class and its initialization. > Revert to using String.toUpperCase

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Thomas Stuefe
On Thu, 25 May 2023 18:18:43 GMT, Martin Doerr wrote: >> src/hotspot/share/utilities/globalDefinitions_xlc.hpp line 47: >> >>> 45: #undef malloc >>> 46: extern void *malloc(size_t) asm("vec_malloc"); >>> 47: #endif >> >> Wow! And I don't mean that in a good way. I'm not questioning whethe

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v5]

2023-05-26 Thread Aleksey Shipilev
> UUID is the very important class that is used to track identities of objects > in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% > of total CPU time, and is frequently a scalability bottleneck due to > `SecureRandom` synchronization. > > The major issue with UUID cod

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v5]

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 15:30:29 GMT, Roger Riggs wrote: >> Yes, I used them for testing, but left them in, because it would be >> convenient to have them around for field tuning and diagnostics. This would >> require a CSR, right? > > I don't think there is a strong case for adding the system prop

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v5]

2023-05-26 Thread Aleksey Shipilev
On Fri, 26 May 2023 15:30:29 GMT, Roger Riggs wrote: >> Yes, I used them for testing, but left them in, because it would be >> convenient to have them around for field tuning and diagnostics. This would >> require a CSR, right? > > I don't think there is a strong case for adding the system prop

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-26 Thread Thomas Stuefe
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v6]

2023-05-26 Thread Aleksey Shipilev
> UUID is the very important class that is used to track identities of objects > in large scale systems. On some of our systems, `UUID.randomUUID` takes >1% > of total CPU time, and is frequently a scalability bottleneck due to > `SecureRandom` synchronization. > > The major issue with UUID cod

Re: RFR: 8308748: JNU_GetStringPlatformChars may write to String's internal memory array

2023-05-26 Thread Michael McMahon
On Wed, 24 May 2023 09:24:46 GMT, Rudi Horn wrote: > This change prevents the contents of the internal string array from being > copied back when releasing it. There was an unrelated change to these functions recently. You might want to rebase this PR with the latest version. - P

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v3]

2023-05-26 Thread Maurizio Cimadamore
> As the FFM API evolved over time, some parts of the javadoc went out of sync. > Now that most of the API is stable, it is a good time to look again at the > javadoc as a whole, and bring some more consistency. > > While most of the changes in this PR are stylistic, I'd like to call out few >

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v2]

2023-05-26 Thread Maurizio Cimadamore
On Thu, 25 May 2023 15:31:43 GMT, Maurizio Cimadamore wrote: >> As the FFM API evolved over time, some parts of the javadoc went out of >> sync. Now that most of the API is stable, it is a good time to look again at >> the javadoc as a whole, and bring some more consistency. >> >> While most

Re: [External] : Re: Classes used in method body are loaded lazily or eagerly depending on method return type

2023-05-26 Thread Raffaello Giulietti
My bad. In the modifications of the original code, I proposed to replace URL classFileB = TestLoading.class.getResource(TestLoading.class.getSimpleName() + "$ChildClass.class"); with URL classFileB = TestLoading.class.getResource(ChildClass.class.getSimpleName() + ".class"); Howe

Re: RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v7]

2023-05-26 Thread Roger Riggs
On Thu, 25 May 2023 15:25:40 GMT, Volker Simonis wrote: >> Since JDK13, executing commands in a sub-process defaults to the so called >> `POSIX_SPAWN` launching mechanism (i.e. >> `-Djdk.lang.Process.launchMechanism=POSIX_SPAWN`) on Linux. This works by >> using `posix_spawn(3)` to firstly sta

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Sun, 7 May 2023 13:34:54 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 8308645: Javadoc of FFM API needs to be refreshed [v3]

2023-05-26 Thread ExE Boss
On Fri, 26 May 2023 18:11:14 GMT, Maurizio Cimadamore wrote: >> As the FFM API evolved over time, some parts of the javadoc went out of >> sync. Now that most of the API is stable, it is a good time to look again at >> the javadoc as a whole, and bring some more consistency. >> >> While most

Re: RFR: 8308452: Extend internal Architecture enum with byte order and address size [v2]

2023-05-26 Thread Roger Riggs
On Wed, 24 May 2023 16:26:28 GMT, Alan Bateman wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Review suggestions > > src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 140: > >> 138: */ >

Re: RFR: 8291065: Creating a VarHandle for a static field triggers class initialization [v3]

2023-05-26 Thread ExE Boss
On Wed, 17 May 2023 17:20:37 GMT, Chen Liang wrote: >> Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`. >> >> A few implementation-detail methods in VarHandle are now documented with the >> implied constraints to avoid subtle problems in the future. Changed >> `Indire

Re: RFR: 8308748: JNU_GetStringPlatformChars may write to String's internal memory array

2023-05-26 Thread Rudi Horn
On Fri, 26 May 2023 17:36:12 GMT, Michael McMahon wrote: > There was an unrelated change to these functions recently. You might want to > rebase this PR with the latest version. Done - PR Comment: https://git.openjdk.org/jdk/pull/14117#issuecomment-1564855730

Re: RFR: 8308748: JNU_GetStringPlatformChars may write to String's internal memory array [v2]

2023-05-26 Thread Rudi Horn
> This change prevents the contents of the internal string array from being > copied back when releasing it. Rudi Horn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: Use JNI_ABORT to release string bytes -

Re: RFR: 8307858: [REDO] JDK-8307194 Add make target for optionally building a complete set of all JDK and hotspot libjvm static libraries [v4]

2023-05-26 Thread Jiangli Zhou
On Thu, 25 May 2023 01:19:11 GMT, Jiangli Zhou wrote: > > > > My build job is still running, but it has failed in two distinct ways > > > > already. See below for mac fix. Our cross build of arm32 fails with > > > > this message: > > > > ``` > > > > [2023-05-24T19:25:15,310Z] > > > > /opt/mach

Re: RFR: JDK-8308288: Fix xlc17 clang warnings in shared code [v2]

2023-05-26 Thread Martin Doerr
On Fri, 26 May 2023 16:58:41 GMT, Thomas Stuefe wrote: >> The crazy thing is that `malloc` is defined! That means all places where we >> use the term malloc are getting replaced without such a workaround. (E.g. >> for log tags.) > > So, we do this only for malloc? Not for calloc, posix_memalign

Re: RFR: 8306889: Convert MethodTypeDescImpl parameter storage from array to immutable list [v4]

2023-05-26 Thread Mandy Chung
On Wed, 24 May 2023 02:29:09 GMT, Chen Liang wrote: >> This patch moves the parameters to an immutable list, to avoid allocations >> on `parameterList` as well. In addition, it fixes 8304932, the bug where if >> a caller keeps a reference to the array passed into `MethodTypeDesc.of`, the >> ca

Re: RFR: 8307858: [REDO] JDK-8307194 Add make target for optionally building a complete set of all JDK and hotspot libjvm static libraries [v5]

2023-05-26 Thread Jiangli Zhou
On Wed, 24 May 2023 21:02:00 GMT, Jiangli Zhou wrote: >> Original description for JDK-8307194 change: >> - >> This PR is branched from the makefile changes for >> https://bugs.openjdk.org/browse/JDK-8303796 and contains the following for >> handling the JDK/hotspot static libraries: >> >>

RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread Joe Darcy
Explain in java.lang.Class how unnamed classes are modeled in core reflection. - Commit messages: - Cleanup and edit text. - Respond to review comments. - Appease jcheck. - JDK-8308913: Update core reflection for JEP 445 (preview) Changes: https://git.openjdk.org/jdk/pull/14165/f

Re: RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 02:06:55 GMT, Joe Darcy wrote: > Explain in java.lang.Class how unnamed classes are modeled in core reflection. Looks fine. This version matches the current implementation where `getCanonicalName` returns non-null. When the implementation of `getCanonicalName` is update

Re: RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread Joe Darcy
On Fri, 26 May 2023 02:06:55 GMT, Joe Darcy wrote: > Explain in java.lang.Class how unnamed classes are modeled in core reflection. > > Looks fine. This version matches the current implementation where > > `getCanonicalName` returns non-null. When the implementation of > > `getCanonicalName` i

Re: RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread Joe Darcy
On Fri, 26 May 2023 17:18:42 GMT, Mandy Chung wrote: > Looks fine. This version matches the current implementation where > `getCanonicalName` returns non-null. When the implementation of > `getCanonicalName` is updated to return null, the spec should be updated. > > Nit: `` is needed assuming

Re: RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread David Holmes
On Fri, 26 May 2023 02:06:55 GMT, Joe Darcy wrote: > Explain in java.lang.Class how unnamed classes are modeled in core reflection. src/java.base/share/classes/java/lang/Class.java line 192: > 190: * Unnamed Classes > 191: * > 192: * The {@code class} file representing an unnnamed class is g

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Chen Liang
On Fri, 26 May 2023 18:39:53 GMT, Mandy Chung wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove assertion, no longer true with teleport definition in MHP > > src/java.base/share/classes/java/lang/invoke/MethodHa

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 21:05:39 GMT, Chen Liang wrote: > This approach also requires the Class loading checks since the interface is > not unconditionally exported and fails security manager. Are you referring to `ClassLoader::checkPackageAccess` change? As MHProxy implements `sun.invoke.Wrappe

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Chen Liang
On Fri, 26 May 2023 21:23:32 GMT, Mandy Chung wrote: >> John Rose argues against using class data for Leyden. Since class data is >> the only known way to defend against user-manufactured annotations, I >> switched back to an extra wrapper interface. This approach also requires the >> Class lo

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v22]

2023-05-26 Thread Joe Darcy
On Fri, 26 May 2023 13:22:59 GMT, Jim Laskey wrote: >> Add flexible main methods and anonymous main classes to the Java language. > > Jim Laskey has updated the pull request incrementally with one additional > commit since the last revision: > > Remove trailing whitespace In case I overlooke

Re: RFR: JDK-8308913: Update core reflection for JEP 445 (preview)

2023-05-26 Thread Chen Liang
On Fri, 26 May 2023 02:06:55 GMT, Joe Darcy wrote: > Explain in java.lang.Class how unnamed classes are modeled in core reflection. src/java.base/share/classes/java/lang/Class.java line 212: > 210: * {@linkplain #getTypeName type name}, {@linkplain #getSimpleName > 211: * simple name}, and {@

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 21:06:36 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line >> 209: >> >>> 207: if (intfc.isHidden()) >>> 208: throw newIllegalArgumentException("a hidden interface", >>> intfc.getName()); >>> 209:

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 21:31:40 GMT, Mandy Chung wrote: >> Yes. Unfortunately, it fails at >> https://github.com/openjdk/jdk/blob/bd21e68e679c41c98f39dd2fbd38270ae7d55ed9/src/java.base/share/classes/java/lang/SecurityManager.java#L1317 >> because a conditionally-exported package is considered a >

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 21:29:14 GMT, Chen Liang wrote: >>> This approach also requires the Class loading checks since the interface is >>> not unconditionally exported and fails security manager. >> >> Are you referring to `ClassLoader::checkPackageAccess` change? As MHProxy >> implements `sun.

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Mandy Chung
On Fri, 26 May 2023 22:03:40 GMT, Mandy Chung wrote: >> If we keep a cache of all MHProxy classes, I think this would not need >> `sun.invoke.WrapperInstance`. OTOH, `sun.invoke` does not have any other >> class except `WrapperInstance` and the `ensureOriginalLookup` method would >> need to

Re: RFR: 8306889: Convert MethodTypeDescImpl parameter storage from array to immutable list [v4]

2023-05-26 Thread Chen Liang
On Wed, 24 May 2023 02:29:09 GMT, Chen Liang wrote: >> This patch moves the parameters to an immutable list, to avoid allocations >> on `parameterList` as well. In addition, it fixes 8304932, the bug where if >> a caller keeps a reference to the array passed into `MethodTypeDesc.of`, the >> ca

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v16]

2023-05-26 Thread Chen Liang
On Fri, 26 May 2023 22:05:06 GMT, Mandy Chung wrote: >>> because a conditionally-exported package is considered a >>> non-(unconditionally-)exported package. >> >> OK. I need to look into the right solution for this. The Proxy >> implementation uses null protection domain to define the prox