Re: RFR: 8339131: Remove rarely-used accessor methods from Opcode [v2]

2024-09-03 Thread Adam Sotona
On Tue, 3 Sep 2024 23:22:28 GMT, Chen Liang wrote: >> In offline discussion, we agreed that current fields of `Opcode` violate >> data oriented design to a large extent. The attributes not generic to all >> opcode are removed. >> >> Up for preliminary review; needs to be reworked for #20737. >

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Fei Yang
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Integrated: 8328877: [JNI] The JNI Specification needs to address the limitations of integer UTF-8 String lengths

2024-09-03 Thread David Holmes
On Fri, 30 Aug 2024 02:07:54 GMT, David Holmes wrote: > This is the implementation of a new method added to the JNI specification. > > From the CSR request: > > The `GetStringUTFLength` function returns the length as a `jint` (`jsize`) > value and so is limited to returning at most `Integer.MA

Re: RFR: 8338694: x86_64 intrinsic for tanh using libm [v2]

2024-09-03 Thread Jatin Bhateja
On Tue, 27 Aug 2024 22:23:44 GMT, Srinivas Vamsi Parasa wrote: >> I agree, this is all rather obscure. Ideally the same names that are used in >> wherever this comes from. >> >> Where does the algorithm come from? What are its accuracy guarantees? >> >> In addition, given the rarity of hyperb

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread David Holmes
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

2024-09-03 Thread Shaojin Wen
On Tue, 3 Sep 2024 17:33:37 GMT, David M. Lloyd wrote: >> Please review this change, which reduces the number of allocations in >> `StackMapDecoder::writeFrames` by using a sorted array instead of a >> `TreeMap` to sort and uniquify entries before writing. It also >> adds a validation missed b

Re: RFR: 8334048: -Xbootclasspath can not read some ZIP64 zip files [v3]

2024-09-03 Thread Andrew John Hughes
On Mon, 2 Sep 2024 16:02:31 GMT, Andrew John Hughes wrote: >> fitzsim has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootClassPathZipFileTest: Switch to createClassBytes, createZip static >> functions > > I can't review, as I ported th

Re: RFR: 8339317: Optimize ClassFile writeBuffer [v6]

2024-09-03 Thread Shaojin Wen
> A small optimization, optimize the BufferWriter implementation and use of > ClassFile, provide faster patchInt and skip Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - Eliminate redundant variables - buf skip - Chan

Re: RFR: 8338694: x86_64 intrinsic for tanh using libm [v2]

2024-09-03 Thread Joe Darcy
On Fri, 30 Aug 2024 20:26:05 GMT, Srinivas Vamsi Parasa wrote: >> The goal of this PR is to implement an x86_64 intrinsic for >> java.lang.Math.tanh() using libm >> >> Benchmark (ops/ms) | Stock JDK | Tanh intrinsic | Speedup >> -- | -- | -- | -- >> MathBench.tanhDouble | 70900 | 95618 | 1.35x

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v17]

2024-09-03 Thread Claes Redestad
On Tue, 3 Sep 2024 16:27:58 GMT, Shaojin Wen wrote: >> Use fast path for ascii characters 1 to 127 to improve the performance of >> writing Utf8Entry to BufferWriter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > optimize

Re: RFR: 8339317: Optimize ClassFile writeBuffer [v5]

2024-09-03 Thread Shaojin Wen
> A small optimization, optimize the BufferWriter implementation and use of > ClassFile, provide faster patchInt and skip Shaojin Wen 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/reb

Re: RFR: 8339131: Remove rarely-used accessor methods from Opcode [v2]

2024-09-03 Thread Chen Liang
> In offline discussion, we agreed that current fields of `Opcode` violate data > oriented design to a large extent. The attributes not generic to all opcode > are removed. > > Up for preliminary review; needs to be reworked for #20737. Chen Liang has updated the pull request with a new target

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v17]

2024-09-03 Thread Shaojin Wen
On Tue, 3 Sep 2024 16:27:58 GMT, Shaojin Wen wrote: >> Use fast path for ascii characters 1 to 127 to improve the performance of >> writing Utf8Entry to BufferWriter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > optimize

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc [v2]

2024-09-03 Thread Chen Liang
On Tue, 27 Aug 2024 11:52:38 GMT, Shaojin Wen wrote: >> The string concatenation of java.base module is implemented based on >> StringBuilder, which will result in extra object allocation and slow >> performance. We can solve this problem by using String.concat method and >> StringConcatHelper

Re: RFR: 8338694: x86_64 intrinsic for tanh using libm [v2]

2024-09-03 Thread Joe Darcy
On Fri, 30 Aug 2024 20:26:05 GMT, Srinivas Vamsi Parasa wrote: >> The goal of this PR is to implement an x86_64 intrinsic for >> java.lang.Math.tanh() using libm >> >> Benchmark (ops/ms) | Stock JDK | Tanh intrinsic | Speedup >> -- | -- | -- | -- >> MathBench.tanhDouble | 70900 | 95618 | 1.35x

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v2]

2024-09-03 Thread Sandhya Viswanathan
On Mon, 2 Sep 2024 12:15:10 GMT, Jatin Bhateja wrote: >> If the aim is to reduce the number of nodes, we could merge the >> Op_SaturatingAddVB, Op_SaturatingAddVS, Op_SaturatingAddVI, and >> Op_SaturatingAddVL into one Op_SaturatingAddV. Likewise for unsigned >> saturating add into Op_Saturati

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v5]

2024-09-03 Thread Sandhya Viswanathan
On Mon, 2 Sep 2024 12:20:59 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v4]

2024-09-03 Thread Sandhya Viswanathan
On Mon, 2 Sep 2024 12:17:08 GMT, Jatin Bhateja wrote: >> src/hotspot/cpu/x86/x86.ad line 10656: >> >>> 10654: match(Set dst (SaturatingSubVI src1 src2)); >>> 10655: match(Set dst (SaturatingSubVL src1 src2)); >>> 10656: effect(TEMP ktmp); >> >> This needs TEMP dst as well. > > There is no

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v5]

2024-09-03 Thread Sandhya Viswanathan
On Mon, 2 Sep 2024 12:20:59 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8328877: [JNI] The JNI Specification needs to address the limitations of integer UTF-8 String lengths [v3]

2024-09-03 Thread David Holmes
On Tue, 3 Sep 2024 20:50:09 GMT, Chris Plummer wrote: >> David Holmes has updated the pull request incrementally with one additional >> commit since the last revision: >> >> The JNI version update was incompete > > Marked as reviewed by cjplummer (Reviewer). Thanks @plummercj !

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v3]

2024-09-03 Thread Brian Burkhalter
On Tue, 3 Sep 2024 18:45:36 GMT, Brian Burkhalter wrote: >> Return the final path derived from the string returned by `canonicalize0()`. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8003887: If getFinalPath() fails,

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v4]

2024-09-03 Thread Brian Burkhalter
> Return the final path derived from the string returned by `canonicalize0()`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8003887: Test getCanonicalPath when the path contains links - Changes: - all: https://g

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v2]

2024-09-03 Thread Brian Burkhalter
On Tue, 3 Sep 2024 16:00:53 GMT, Brian Burkhalter wrote: >> Brian Burkhalter has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8003887: Free value allocated in and returned by getFinalPath() > > src/java.base/windows/classes/java/io/WinNTF

Re: RFR: 8328877: [JNI] The JNI Specification needs to address the limitations of integer UTF-8 String lengths [v3]

2024-09-03 Thread Chris Plummer
On Tue, 3 Sep 2024 03:00:56 GMT, David Holmes wrote: >> This is the implementation of a new method added to the JNI specification. >> >> From the CSR request: >> >> The `GetStringUTFLength` function returns the length as a `jint` (`jsize`) >> value and so is limited to returning at most `Integ

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 17:33:37 GMT, David M. Lloyd wrote: >> Please review this change, which reduces the number of allocations in >> `StackMapDecoder::writeFrames` by using a sorted array instead of a >> `TreeMap` to sort and uniquify entries before writing. It also >> adds a validation missed b

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Erik Joelsson
On Tue, 3 Sep 2024 12:50:01 GMT, Magnus Ihse Bursie wrote: > As a prerequisite for Hermetic Java, we need a statically linked `java` > launcher. It should behave like the normal, dynamically linked `java` > launcher, except that all JDK native libraries should be statically, not > dynamically,

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Magnus Ihse Bursie
On Tue, 3 Sep 2024 12:50:01 GMT, Magnus Ihse Bursie wrote: > As a prerequisite for Hermetic Java, we need a statically linked `java` > launcher. It should behave like the normal, dynamically linked `java` > launcher, except that all JDK native libraries should be statically, not > dynamically,

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Magnus Ihse Bursie
On Tue, 3 Sep 2024 18:10:06 GMT, Erik Joelsson wrote: > I'm guessing this would work if I built the regular image first, or at least > at the same time. No, I don't think that should matter. `static-jdk-image` depends on `exploded-image`, and the files in your error message resides in `jdk`, n

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

2024-09-03 Thread duke
On Tue, 3 Sep 2024 17:33:37 GMT, David M. Lloyd wrote: >> Please review this change, which reduces the number of allocations in >> `StackMapDecoder::writeFrames` by using a sorted array instead of a >> `TreeMap` to sort and uniquify entries before writing. It also >> adds a validation missed b

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v3]

2024-09-03 Thread Brian Burkhalter
> Return the final path derived from the string returned by `canonicalize0()`. Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision: 8003887: If getFinalPath() fails, return the string returned by canonicalize0() - Change

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Erik Joelsson
On Tue, 3 Sep 2024 12:50:01 GMT, Magnus Ihse Bursie wrote: > As a prerequisite for Hermetic Java, we need a statically linked `java` > launcher. It should behave like the normal, dynamically linked `java` > launcher, except that all JDK native libraries should be statically, not > dynamically,

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 17:33:37 GMT, David M. Lloyd wrote: >> Please review this change, which reduces the number of allocations in >> `StackMapDecoder::writeFrames` by using a sorted array instead of a >> `TreeMap` to sort and uniquify entries before writing. It also >> adds a validation missed b

Re: RFR: 8337279: Optimize format instant [v7]

2024-09-03 Thread Naoto Sato
On Tue, 27 Aug 2024 23:49:50 GMT, Shaojin Wen wrote: >> By removing the redundant code logic in >> DateTimeFormatterBuilder$InstantPrinterParser#formatTo, the codeSize can be >> reduced and the performance can be improved. > > Shaojin Wen has updated the pull request with a new target base due

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

2024-09-03 Thread David M . Lloyd
> Please review this change, which reduces the number of allocations in > `StackMapDecoder::writeFrames` by using a sorted array instead of a > `TreeMap` to sort and uniquify entries before writing. It also > adds a validation missed by the original implementation. > > Tested using `StackMapsTe

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 16:13:39 GMT, David M. Lloyd wrote: > Please review this change, which reduces the number of allocations in > `StackMapDecoder::writeFrames` by using a sorted array instead of a > `TreeMap` to sort and uniquify entries before writing. > > Tested using `StackMapsTest`. I thi

Re: RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Francesco Nigro
On Tue, 3 Sep 2024 15:44:34 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java >> line 642: >> >>> 640: // 0...0X00 >>> 641: if (remaining >= 4) { >>> 642: final int v = >>> SCOPED_MEMORY_A

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations

2024-09-03 Thread David M . Lloyd
On Tue, 3 Sep 2024 16:13:39 GMT, David M. Lloyd wrote: > Please review this change, which reduces the number of allocations in > `StackMapDecoder::writeFrames` by using a sorted array instead of a > `TreeMap` to sort and uniquify entries before writing. > > Tested using `StackMapsTest`. The p

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread Raffaello Giulietti
On Mon, 2 Sep 2024 16:19:01 GMT, fabioromano1 wrote: >> This implementation of MutableBigInteger.leftShift(int) optimizes the >> current version, avoiding unnecessary copy of the MutableBigInteger's value >> content and performing the primitive shifting only in the original portion >> of the v

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread Sergey Kuksenko
On Mon, 2 Sep 2024 16:19:01 GMT, fabioromano1 wrote: >> This implementation of MutableBigInteger.leftShift(int) optimizes the >> current version, avoiding unnecessary copy of the MutableBigInteger's value >> content and performing the primitive shifting only in the original portion >> of the v

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread fabioromano1
On Tue, 3 Sep 2024 16:29:10 GMT, Sergey Kuksenko wrote: >>> It would be nice to see some benchmarks where it gives performance benefits. >> >> @kuksenko Try to run the benchmark of the `BigInteger`'s square root, maybe >> there the benefits are more visibles... > >> > It would be nice to see so

Re: RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 16:13:39 GMT, David M. Lloyd wrote: > Please review this change, which reduces the number of allocations in > `StackMapDecoder::writeFrames` by using a sorted array instead of a > `TreeMap` to sort and uniquify entries before writing. > > Tested using `StackMapsTest`. Since

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread Sergey Kuksenko
On Tue, 3 Sep 2024 15:49:01 GMT, fabioromano1 wrote: > > It would be nice to see some benchmarks where it gives performance benefits. > > @kuksenko Try to run the benchmark of the `BigInteger`'s square root, maybe > there the benefits are more visible... "maybe" So, you don't have proof th

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v17]

2024-09-03 Thread Shaojin Wen
> Use fast path for ascii characters 1 to 127 to improve the performance of > writing Utf8Entry to BufferWriter. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: optimize for utf16 - Changes: - all: https://git.openjdk.

RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations

2024-09-03 Thread David M . Lloyd
Please review this change, which reduces the number of allocations in `StackMapDecoder::writeFrames` by using a sorted array instead of a `TreeMap` to sort and uniquify entries before writing. Tested using `StackMapsTest`. - Commit messages: - 8339492: StackMapDecoder::writeFrames

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Martin Doerr
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Re: RFR: 8311302: Allow for jlinking a custom runtime without packaged modules being present [v36]

2024-09-03 Thread Severin Gehwolf
> Please review this patch which adds a jlink mode to the JDK which doesn't > need the packaged modules being present. A.k.a run-time image based jlink. > Fundamentally this patch adds an option to use `jlink` even though your JDK > install might not come with the packaged modules (directory `jm

Re: RFR: 8333446: Add tests for hierarchical container support [v8]

2024-09-03 Thread Severin Gehwolf
> Please review this PR which adds test support for systemd slices so that bugs > like [JDK-8217338](https://bugs.openjdk.org/browse/JDK-8217338) can be > verified. The added test, `SystemdMemoryAwarenessTest` currently passes on > cgroups v1 and fails on cgroups v2 due to the way how > [JDK-82

Re: RFR: 8336881: [Linux] Support for hierarchical limits for Metrics [v5]

2024-09-03 Thread Severin Gehwolf
> Please review this fix for cgroups-based metrics reporting in the > `jdk.internal.platform` package. This fix is supposed to address wrong > reporting of certain limits if the limits aren't set at the leaf nodes. > > For example, on cg v2, the memory limit interface file is `memory.max`. > Co

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v2]

2024-09-03 Thread Brian Burkhalter
On Tue, 3 Sep 2024 15:56:36 GMT, Alan Bateman wrote: > Can you check the tests in java/nio/file. I think they may skip if > Files.createSymbolicLink fails, which it might do some Windows test machines > but not others. >From `Links.java`: // Check if sym links are supported tr

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread Raffaello Giulietti
On Tue, 3 Sep 2024 15:49:01 GMT, fabioromano1 wrote: >> It would be nice to see some benchmarks where it gives performance benefits. > >> It would be nice to see some benchmarks where it gives performance benefits. > > @kuksenko Try to run the benchmark of the `BigInteger`'s square root, maybe

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v2]

2024-09-03 Thread Brian Burkhalter
On Fri, 30 Aug 2024 21:39:47 GMT, Brian Burkhalter wrote: >> Return the final path derived from the string returned by `canonicalize0()`. > > Brian Burkhalter has updated the pull request incrementally with one > additional commit since the last revision: > > 8003887: Free value allocated in

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v2]

2024-09-03 Thread Alan Bateman
On Tue, 3 Sep 2024 15:41:38 GMT, Brian Burkhalter wrote: > Links can't be created without elevated permissions so I need to investigate > how to do this. I think it's already done in some other tests. Can you check the tests in java/nio/file. I think they may skip if Files.createSymbolicLink f

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Maurizio Cimadamore
On Thu, 8 Aug 2024 12:06:18 GMT, Jorn Vernee wrote: > I guess that upcalls are less performance critical Think of something like `qsort`, or OpenGL calling the "repaint" function, or, with something like `jextract` , calling the clang cursor visitor. While using upcalls might be rare, the kind

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace

2024-09-03 Thread Thomas Stuefe
On Tue, 27 Aug 2024 15:38:24 GMT, Thomas Stuefe wrote: >>> I don't think the costs for two address comparisons matter, not with the >>> comparatively few deallocations that happen (few hundreds or few thousand). >>> If deallocate is hot, we are using metaspace wrong. >> >> MethodData does a lo

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread fabioromano1
On Tue, 3 Sep 2024 14:03:16 GMT, Sergey Kuksenko wrote: > It would be nice to see some benchmarks where it gives performance benefits. @kuksenko Try to run the benchmark of the `BigInteger`'s square root, maybe there the benefits are more visibles... - PR Comment: https://git.open

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v16]

2024-09-03 Thread Shaojin Wen
On Tue, 3 Sep 2024 15:24:02 GMT, Shaojin Wen wrote: >> Use fast path for ascii characters 1 to 127 to improve the performance of >> writing Utf8Entry to BufferWriter. > > Shaojin Wen has updated the pull request incrementally with two additional > commits since the last revision: > > - sugges

Re: RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Maurizio Cimadamore
On Tue, 3 Sep 2024 11:51:57 GMT, Francesco Nigro wrote: >> This PR proposes to handle smaller FFM copy operations with Java code rather >> than transitioning to native code. This will improve performance. In this >> PR, copy operations involving zero to 63 bytes will be handled by Java code. >>

Re: RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Matthias Baesken
On Tue, 3 Sep 2024 14:09:23 GMT, Matthias Baesken wrote: > When running jtreg test java/lang/ProcessHandle/PermissionTest.java on macOS, > a few times this error occurs : > > java.lang.RuntimeException: Cannot allocate memory >at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Nat

Re: RFR: 8003887: File.getCanonicalFile() does not resolve symlinks on MS Windows [v2]

2024-09-03 Thread Brian Burkhalter
On Mon, 2 Sep 2024 09:06:59 GMT, Alan Bateman wrote: > Are you planning to add a test for this? Links can't be created without elevated permissions so I need to investigate how to do this. I think it's already done in some other tests. - PR Comment: https://git.openjdk.org/jdk/pul

Re: RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Alan Bateman
On Tue, 3 Sep 2024 14:46:00 GMT, Matthias Baesken wrote: > > ProcessHandle.children doesn't specify RuntimeException so I assume that > > needs to be looked into. > > Should we add RuntimeException to the javadoc ? Or throw some other exception > ? Are the cases that you ran into all due to a

Re: RFR: 8338890: Add monitoring/management interface for the virtual thread scheduler

2024-09-03 Thread ExE Boss
On Mon, 2 Sep 2024 12:25:05 GMT, Alan Bateman wrote: > This PR proposes to add a JDK-specific monitoring and management interface > for the virtual thread scheduler. The interface is named > VirtualThreadSchedulerMXBean and allows JMX based tooling monitor/manage the > scheduler's target paral

RFR: 8338890: Add monitoring/management interface for the virtual thread scheduler

2024-09-03 Thread Alan Bateman
This PR proposes to add a JDK-specific monitoring and management interface for the virtual thread scheduler. The interface is named VirtualThreadSchedulerMXBean and allows JMX based tooling monitor/manage the scheduler's target parallelism and monitor thread counts. The JDK 5/6 era JDK-specific

Re: RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Maurizio Cimadamore
On Tue, 3 Sep 2024 15:22:36 GMT, Maurizio Cimadamore wrote: >> This PR proposes to handle smaller FFM copy operations with Java code rather >> than transitioning to native code. This will improve performance. In this >> PR, copy operations involving zero to 63 bytes will be handled by Java cod

Re: RFR: 8338591: Improve performance of MemorySegment::copy

2024-09-03 Thread Maurizio Cimadamore
On Tue, 3 Sep 2024 07:52:44 GMT, Per Minborg wrote: > This PR proposes to handle smaller FFM copy operations with Java code rather > than transitioning to native code. This will improve performance. In this PR, > copy operations involving zero to 63 bytes will be handled by Java code. > > Here

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v16]

2024-09-03 Thread Shaojin Wen
> Use fast path for ascii characters 1 to 127 to improve the performance of > writing Utf8Entry to BufferWriter. Shaojin Wen has updated the pull request incrementally with two additional commits since the last revision: - suggestion from @cl4es - Revert "countGreaterThanZero -> CountNonNegat

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]

2024-09-03 Thread Claes Redestad
On Tue, 3 Sep 2024 14:32:16 GMT, Shaojin Wen wrote: >> We might rename these to `countAscii` and `countModifiedUtf8Compatible`. > > ascii includes '\0', `CountModifiedUtf8Compatible` Newbies don't seem to know > what it means I think naming internal low-level methods based precisely on what the

Re: RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Matthias Baesken
On Tue, 3 Sep 2024 14:09:23 GMT, Matthias Baesken wrote: > When running jtreg test java/lang/ProcessHandle/PermissionTest.java on macOS, > a few times this error occurs : > > java.lang.RuntimeException: Cannot allocate memory >at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Nat

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v15]

2024-09-03 Thread Claes Redestad
On Tue, 3 Sep 2024 13:22:41 GMT, Shaojin Wen wrote: >> Use fast path for ascii characters 1 to 127 to improve the performance of >> writing Utf8Entry to BufferWriter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > countGre

Re: RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Matthias Baesken
On Tue, 3 Sep 2024 14:37:04 GMT, Alan Bateman wrote: > ProcessHandle.children doesn't specify RuntimeException so I assume that > needs to be looked into. Should we add RuntimeException to the javadoc ? Or throw some other exception ? But I think the behavior is present for some time, it can ha

Re: RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Alan Bateman
On Tue, 3 Sep 2024 14:09:23 GMT, Matthias Baesken wrote: > When running jtreg test java/lang/ProcessHandle/PermissionTest.java on macOS, > a few times this error occurs : > > java.lang.RuntimeException: Cannot allocate memory >at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Nat

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]

2024-09-03 Thread Shaojin Wen
On Tue, 3 Sep 2024 13:45:26 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 397: >> >>> 395: >>> 396: /** >>> 397: * if string#coder() is Latin1 return the count of string#value() >>> leading greater than zero, else return 0 >> >> Ca

Re: RFR: 8339317: Optimize ClassFile writeBuffer [v4]

2024-09-03 Thread Shaojin Wen
> A small optimization, optimize the BufferWriter implementation and use of > ClassFile, provide faster patchInt and skip Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: revert skip - Changes: - all: https://git.openjd

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Jorn Vernee
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Re: RFR: 8339168: Optimize ClassFile Util slotSize [v5]

2024-09-03 Thread Shaojin Wen
> A small optimization to improve the performance of > jdk.internal.classfile.impl.Util#slotSize/isDoubleSlot Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: suggestion from @cl4es - Changes: - all: https://git.openjdk

RFR: 8339487: ProcessHandleImpl native exceptions - include message text and last error information

2024-09-03 Thread Matthias Baesken
When running jtreg test java/lang/ProcessHandle/PermissionTest.java on macOS, a few times this error occurs : java.lang.RuntimeException: Cannot allocate memory at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Native Method) at java.base/java.lang.ProcessHandleImpl.children

Re: RFR: 8339168: Optimize ClassFile Util slotSize [v4]

2024-09-03 Thread Shaojin Wen
> A small optimization to improve the performance of > jdk.internal.classfile.impl.Util#slotSize/isDoubleSlot Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: add benchmark - Changes: - all: https://git.openjdk.org/jdk/

Re: RFR: 8336274: MutableBigInteger.leftShift(int) optimization [v5]

2024-09-03 Thread Sergey Kuksenko
On Mon, 2 Sep 2024 16:19:01 GMT, fabioromano1 wrote: >> This implementation of MutableBigInteger.leftShift(int) optimizes the >> current version, avoiding unnecessary copy of the MutableBigInteger's value >> content and performing the primitive shifting only in the original portion >> of the v

Re: RFR: 8334048: -Xbootclasspath can not read some ZIP64 zip files [v3]

2024-09-03 Thread fitzsim
On Mon, 2 Sep 2024 16:02:31 GMT, Andrew John Hughes wrote: >> fitzsim has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BootClassPathZipFileTest: Switch to createClassBytes, createZip static >> functions > > I can't review, as I ported th

Re: RFR: 8339317: Optimize ClassFile writeBuffer [v3]

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 12:23:50 GMT, Shaojin Wen wrote: >> A small optimization, optimize the BufferWriter implementation and use of >> ClassFile, provide faster patchInt and skip > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > >

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Jorn Vernee
On Tue, 3 Sep 2024 04:52:08 GMT, Amit Kumar wrote: >> As discussed in the JBS issue: >> >> FFM upcall stubs embed a `Method*` of the target method in the stub. This >> `Method*` is read from the `LambdaForm::vmentry` field associated with the >> target method handle at the time when the upcall

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Martin Doerr
On Fri, 9 Aug 2024 12:44:45 GMT, Jorn Vernee wrote: > I think that's a good compromise. (Although I wish the C++ code was just as > fast, as it's much nicer) Agreed. > I'm not sure what other decorator would apply. I think `ON_STRONG_OOP_REF` and `IS_NOT_NULL` could also be used. But, I guess

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Jorn Vernee
On Thu, 8 Aug 2024 10:51:59 GMT, Martin Doerr wrote: > Can't we do these nasty loads in C++ code and use set_vm_result_2 in > UpcallLinker::on_entry? That's what I tried. I got a ~20% hit to execution time. > I guess that upcalls are less performance critical Why so? They are certainly much m

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Martin Doerr
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Jorn Vernee
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

Re: RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Amit Kumar
On Tue, 6 Aug 2024 17:26:55 GMT, Jorn Vernee wrote: > As discussed in the JBS issue: > > FFM upcall stubs embed a `Method*` of the target method in the stub. This > `Method*` is read from the `LambdaForm::vmentry` field associated with the > target method handle at the time when the upcall stu

RFR: 8337753: Target class of upcall stub may be unloaded

2024-09-03 Thread Jorn Vernee
As discussed in the JBS issue: FFM upcall stubs embed a `Method*` of the target method in the stub. This `Method*` is read from the `LambdaForm::vmentry` field associated with the target method handle at the time when the upcall stub is generated. The MH instance itself is stashed in a global J

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]

2024-09-03 Thread Chen Liang
On Tue, 3 Sep 2024 12:42:08 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update src/java.base/share/classes/java/lang/System.java >> >> Co-authored-by: Claes Redestad > > src/java.base/s

Integrated: 8339214: Remove misleading CodeBuilder.loadConstant(Opcode, ConstantDesc)

2024-09-03 Thread Chen Liang
On Thu, 29 Aug 2024 20:14:57 GMT, Chen Liang wrote: > `CodeBuilder::loadConstant(Opcode, ConstantDesc)` is error-prone and > confusing. Users should almost always use `loadConstant(ConstantDesc)` for > optimized instructions, or use specific factories `iconst_0` etc. or `bipush` > with argumen

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v15]

2024-09-03 Thread Shaojin Wen
> Use fast path for ascii characters 1 to 127 to improve the performance of > writing Utf8Entry to BufferWriter. Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: countGreaterThanZero -> CountNonNegatives - Changes: - al

Re: RFR: 8339168: Optimize ClassFile Util slotSize [v3]

2024-09-03 Thread Claes Redestad
On Tue, 3 Sep 2024 13:09:37 GMT, Shaojin Wen wrote: >> A small optimization to improve the performance of >> jdk.internal.classfile.impl.Util#slotSize/isDoubleSlot > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > suggestion

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v5]

2024-09-03 Thread Emanuel Peter
On Mon, 2 Sep 2024 12:20:59 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8339168: Optimize ClassFile Util slotSize [v3]

2024-09-03 Thread Shaojin Wen
> A small optimization to improve the performance of > jdk.internal.classfile.impl.Util#slotSize/isDoubleSlot Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision: suggestion from @liach & @cl4es - Changes: - all: https://gi

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v5]

2024-09-03 Thread Emanuel Peter
On Mon, 2 Sep 2024 12:20:59 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Magnus Ihse Bursie
On Tue, 3 Sep 2024 12:50:01 GMT, Magnus Ihse Bursie wrote: > As a prerequisite for Hermetic Java, we need a statically linked `java` > launcher. It should behave like the normal, dynamically linked `java` > launcher, except that all JDK native libraries should be statically, not > dynamically,

Re: RFR: 8325397: sun/java2d/Disposer/TestDisposerRace.java fails in linux-aarch64

2024-09-03 Thread Andrey Turbanov
On Thu, 29 Aug 2024 17:06:19 GMT, Andrey Turbanov wrote: >> My suspicion is that Condition::await() throws before having successfully >> reacquired the lock, and this exception is swallowed because Lock::unlock() >> then throws when invoke with an IllegalMonitorStateException as the current >>

RFR: 8339480: Build static-jdk image with a statically linked launcher

2024-09-03 Thread Magnus Ihse Bursie
As a prerequisite for Hermetic Java, we need a statically linked `java` launcher. It should behave like the normal, dynamically linked `java` launcher, except that all JDK native libraries should be statically, not dynamically, linked. This patch is the first step towards this goal. It will gen

Integrated: 8325397: sun/java2d/Disposer/TestDisposerRace.java fails in linux-aarch64

2024-09-03 Thread Viktor Klang
On Thu, 15 Aug 2024 18:22:54 GMT, Viktor Klang wrote: > My suspicion is that Condition::await() throws before having successfully > reacquired the lock, and this exception is swallowed because Lock::unlock() > then throws when invoke with an IllegalMonitorStateException as the current > thread

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v5]

2024-09-03 Thread Emanuel Peter
On Mon, 2 Sep 2024 12:20:59 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace

2024-09-03 Thread Coleen Phillimore
On Tue, 27 Aug 2024 15:38:24 GMT, Thomas Stuefe wrote: >>> I don't think the costs for two address comparisons matter, not with the >>> comparatively few deallocations that happen (few hundreds or few thousand). >>> If deallocate is hot, we are using metaspace wrong. >> >> MethodData does a lo

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]

2024-09-03 Thread Claes Redestad
On Tue, 3 Sep 2024 12:37:05 GMT, Shaojin Wen wrote: >> Use fast path for ascii characters 1 to 127 to improve the performance of >> writing Utf8Entry to BufferWriter. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > Update s

  1   2   >