Re: RFR: 8294982: Implementation of Classfile API [v13]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 15:20:15 GMT, Maurizio Cimadamore wrote: >> Adam Sotona has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - javadoc fixes >> - obsolete identifiers and unused imports cleanup >> - TypeAnnotation.TypePathComponent

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Wed, 8 Feb 2023 07:21:07 GMT, Adam Sotona wrote: >>> Class `Signature` (aka `JavaTypeSignature`), all subclasses, >>> `MethodSignature` and `ClassSignature` are designed according to [JVMS >>> 4.7.9.1 >>>

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Wed, 8 Feb 2023 07:21:07 GMT, Adam Sotona wrote: >>> Class `Signature` (aka `JavaTypeSignature`), all subclasses, >>> `MethodSignature` and `ClassSignature` are designed according to [JVMS >>> 4.7.9.1 >>>

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 15:47:25 GMT, Maurizio Cimadamore wrote: >> Class `Signature` (aka `JavaTypeSignature`), all subclasses, >> `MethodSignature` and `ClassSignature` are designed according to [JVMS >> 4.7.9.1 >>

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x [v2]

2023-02-07 Thread Amit Kumar
On Thu, 2 Feb 2023 08:27:55 GMT, Amit Kumar wrote: >> DeInflate.java test fails on s390x platform because size for out1 array >> which is responsible for storing the compressed data is insufficient. And >> being unable to write whole compressed data on array, on s390 whole data >> can't be

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x [v2]

2023-02-07 Thread Jaikiran Pai
On Thu, 2 Feb 2023 08:27:55 GMT, Amit Kumar wrote: >> DeInflate.java test fails on s390x platform because size for out1 array >> which is responsible for storing the compressed data is insufficient. And >> being unable to write whole compressed data on array, on s390 whole data >> can't be

RFR: 8300139 : [AIX] Use pthreads to avoid JNI_createVM call from primordial thread

2023-02-07 Thread Varada M
1. test/jdk/jni/nullCaller/NullCallerTest.java 2. test/jdk/java/lang/reflect/exeCallerAccessTest/CallerAccessTest.java 3. test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java The above tests were blocked on AIX [@require os.family != "aix"] because these tests are failing to call

Re: RFR: JDK-8301462: Convert Permission files to use lambda after JDK-8076596 [v2]

2023-02-07 Thread Jaikiran Pai
On Wed, 8 Feb 2023 03:42:16 GMT, Mandy Chung wrote: >> A trivial fix. Convert the use of anonymous inner classes in a few >> Permission classes to lambdas to work around JDK-8076596, which has been >> resolved. > > Mandy Chung has updated the pull request incrementally with one additional >

Re: RFR: 8296935: Arrays.asList().set() with wrong types throws undocumented ArrayStoreException [v7]

2023-02-07 Thread Tingjun Yuan
On Mon, 23 Jan 2023 07:33:21 GMT, Tingjun Yuan wrote: >> Document `java.util.Arrays.asList` that the list will throw an >> `ArrayStoreException` when attempting to set an element with a wrong type. > > Tingjun Yuan has updated the pull request incrementally with one additional > commit since

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v7]

2023-02-07 Thread David Schlosnagle
On Wed, 8 Feb 2023 00:07:14 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> clone arrays when `newLength` or range inputs span the input array. This >> helps eliminate range checks and has been verified to help various String >>

Re: RFR: JDK-8301462: Convert Permission files to use lambda after JDK-8076596 [v2]

2023-02-07 Thread Mandy Chung
On Wed, 8 Feb 2023 01:53:02 GMT, Jaikiran Pai wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> update copyright end year > > Hello Mandy, the changes look fine to me. > > Each of these files will need a copyright

Re: RFR: JDK-8301462: Convert Permission files to use lambda after JDK-8076596 [v2]

2023-02-07 Thread Mandy Chung
> A trivial fix. Convert the use of anonymous inner classes in a few > Permission classes to lambdas to work around JDK-8076596, which has been > resolved. Mandy Chung has updated the pull request incrementally with one additional commit since the last revision: update copyright end year

Re: RFR: 8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp [v3]

2023-02-07 Thread SUN Guoyun
On Tue, 7 Feb 2023 20:47:28 GMT, Roger Riggs wrote: > I'm going to backup a bit; so another question... This test is a fairly > simple test that should not be taxing on GC or any other resource so I'm > surprised the the default configuration is not sufficient. It might be worth > looking a

Re: RFR: JDK-8301462: Convert Permission files to use lambda after JDK-8076596

2023-02-07 Thread Jaikiran Pai
On Tue, 7 Feb 2023 22:25:43 GMT, Mandy Chung wrote: > A trivial fix. Convert the use of anonymous inner classes in a few > Permission classes to lambdas to work around JDK-8076596, which has been > resolved. Hello Mandy, the changes look fine to me. Each of these files will need a

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v7]

2023-02-07 Thread David Schlosnagle
On Wed, 8 Feb 2023 00:07:14 GMT, Claes Redestad wrote: >> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to >> clone arrays when `newLength` or range inputs span the input array. This >> helps eliminate range checks and has been verified to help various String >>

Re: RFR: 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes [v2]

2023-02-07 Thread Mandy Chung
On Fri, 3 Feb 2023 15:11:30 GMT, Adam Sotona wrote: >> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy >> classes and this patch converts it to use Classfile API. >> >> This pull request suppose to chain on the 8294982: Implementation of >> Classfile API

Re: RFR: 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes [v2]

2023-02-07 Thread Mandy Chung
On Fri, 3 Feb 2023 15:11:30 GMT, Adam Sotona wrote: >> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy >> classes and this patch converts it to use Classfile API. >> >> This pull request suppose to chain on the 8294982: Implementation of >> Classfile API

Re: RFR: JDK-8301202: Port fdlibm log to Java

2023-02-07 Thread Joe Darcy
On Wed, 8 Feb 2023 00:25:32 GMT, Joe Darcy wrote: > Next up on the FDLIBM porting countdown, the log method. > > Original C vs transliteration port: > > > $ diff -w Log.c Log.translit.java > 1c1 > < /* __ieee754_log(x) > --- >> /** > 51,58c51,52 > < > < #include "fdlibm.h" > < > <

RFR: JDK-8301202: Port fdlibm log to Java

2023-02-07 Thread Joe Darcy
Next up on the FDLIBM porting countdown, the log method. Original C vs transliteration port: $ diff -w Log.c Log.translit.java 1c1 < /* __ieee754_log(x) --- > /** 51,58c51,52 < < #include "fdlibm.h" < < #ifdef __STDC__ < static const double < #else < static double < #endif --- >

RFR: 8301269: Update Commons BCEL to Version 6.7.0

2023-02-07 Thread Joe Wang
Update Commons BCEL in the JDK from 6.5.0 to 6.7.0. 1. Improvement Code modernization (using relatively more modern language features), normalization (such as naming), javadocs, cleanup and minor improvements made up most of the changes. These changes do not change how BCEL works for the

Re: RFR: 8301958: Reduce Arrays.copyOf/-Range overheads [v7]

2023-02-07 Thread Claes Redestad
> This patch adds special-cases to `Arrays.copyOf` and `Arrays.copyOfRange` to > clone arrays when `newLength` or range inputs span the input array. This > helps eliminate range checks and has been verified to help various String > operations. Example: > > Baseline > > Benchmark

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v13]

2023-02-07 Thread Scott Gibbons
> Added code for Base64 acceleration (encode and decode) which will accelerate > ~4x for AVX2 platforms. > > Encode performance: > **Old:** > > Benchmark (maxNumBytes) Mode Cnt Score Error > Units > Base64Encode.testBase64Encode 1024 thrpt3

Re: RFR: 8301958: Reduce Arrays.copyOfRange overheads [v6]

2023-02-07 Thread Francesco Nigro
On Tue, 7 Feb 2023 22:43:15 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v4]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 13:23:26 GMT, Eirik Bjorsnos wrote: >> After finding a hash match, getEntryPos needs to compare the lookup name up >> to the encoded entry name in the CEN. This comparison is done by decoding >> the entry name into a String. The names can then be compared using the >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 19:10:08 GMT, Francesco Nigro wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> copyrights > > Thanks @cl4es to look into this! @franz1981 idea seems to apply nicely here, and going back and

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v6]

2023-02-07 Thread Claes Redestad
> This adds a local, specialized `copyBytes` method to `String` that avoids > certain redundant range checks and clamping that JIT has issues removing > fully. > > This has a small but statistically significant effect on `String` > microbenchmarks, eg.: > > Baseline > > Benchmark

RFR: JDK-8301462: Convert Permission files to use lambda after JDK-8076596

2023-02-07 Thread Mandy Chung
A trivial fix. Convert the use of anonymous inner classes in a few Permission classes to lambdas to work around JDK-8076596, which has been resolved. - Commit messages: - JDK-8301462: Convert Permission files to use lambda after JDK-8076596 Changes:

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v4]

2023-02-07 Thread Lance Andersen
This is still on my list to review will get to it in the next day or so On Feb 7, 2023, at 8:23 AM, Eirik Bjorsnos mailto:d...@openjdk.org>> wrote: After finding a hash match, getEntryPos needs to compare the lookup name up to the encoded entry name in the CEN. This comparison is done by

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Francesco Nigro
On Tue, 7 Feb 2023 20:32:11 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/String.java line 698: >> >>> 696: } >>> 697: >>> 698: static byte[] copyBytes(byte[] bytes, int offset, int length) { >> >> Given that the stub generated for array copy seems highly

Re: RFR: 8301737: java/rmi/server/UnicastRemoteObject/serialFilter/FilterUROTest.java fail with -Xcomp [v3]

2023-02-07 Thread Roger Riggs
On Tue, 7 Feb 2023 08:27:57 GMT, SUN Guoyun wrote: >> Hi all, >> When -Xcomp be used, this testcase will use more codecaches, causing the GC >> to be triggered early, then causing this test failed on LoongArch64 >> architecture. >> >> This PR fix the issue, Please help review it. >> >>

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test [v3]

2023-02-07 Thread Matthew Donovan
> Removed SSLSocketParametersTest.sh script (which just called a Java file) and > configured the java code to run directly with jtreg Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: added exceptions for cases 4 and 5

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread John R Rose
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test [v2]

2023-02-07 Thread Matthew Donovan
On Tue, 7 Feb 2023 20:10:47 GMT, Daniel Fuchs wrote: >> Matthew Donovan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> clarified cases 4 and 5 > > test/jdk/javax/rmi/ssl/SSLSocketParametersTest.java line 184: > >> 182:

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 19:08:59 GMT, Francesco Nigro wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> copyrights > > src/java.base/share/classes/java/lang/String.java line 698: > >> 696: } >> 697: >> 698:

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test [v2]

2023-02-07 Thread Daniel Fuchs
On Tue, 7 Feb 2023 19:33:23 GMT, Matthew Donovan wrote: >> Removed SSLSocketParametersTest.sh script (which just called a Java file) >> and configured the java code to run directly with jtreg > > Matthew Donovan has updated the pull request incrementally with one > additional commit since the

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread John R Rose
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Francesco Nigro
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 19:24:11 GMT, Stuart Marks wrote: > > It might be that the redundant checks in Arrays.copyOfRange would be > > eliminated properly with more inlining, and that the issue here is that the > > affected String constructor is particularly gnarly. This gnarliness is due > > 1)

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test [v2]

2023-02-07 Thread Matthew Donovan
On Tue, 7 Feb 2023 16:13:40 GMT, Daniel Fuchs wrote: >> The expected result of cases 4 and 5 is that an IllegalArgumentException is >> thrown because of the unsupported ciphersuite. The original code just caught >> `Exception` which would hide a problem in the test e.g., if >>

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test [v2]

2023-02-07 Thread Matthew Donovan
> Removed SSLSocketParametersTest.sh script (which just called a Java file) and > configured the java code to run directly with jtreg Matthew Donovan has updated the pull request incrementally with one additional commit since the last revision: clarified cases 4 and 5 -

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Stuart Marks
On Tue, 7 Feb 2023 19:12:38 GMT, Claes Redestad wrote: > It might be that the redundant checks in Arrays.copyOfRange would be > eliminated properly with more inlining, and that the issue here is that the > affected String constructor is particularly gnarly. This gnarliness is due 1) > the

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 18:35:32 GMT, John R Rose wrote: > Our source code is a reference implementation, and people will look at this > change as evidence that `Arrays::copyOfRange` should be hand-inlined by savvy > coders. Surely we could also fix this small performance pothole by improving >

Re: RFR: 8301767: Convert virtual thread tests to JUnit

2023-02-07 Thread Lance Andersen
On Sat, 4 Feb 2023 08:59:29 GMT, Alan Bateman wrote: > The non-hotspot tests integrated with JEP 425/428 were mostly TestNG tests. > We'd like to convert these JUnit in the main line in advance of other updates > to these tests in 21. The changes are mostly mechanical and trivial: > > -

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread John R Rose
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v12]

2023-02-07 Thread Scott Gibbons
> Added code for Base64 acceleration (encode and decode) which will accelerate > ~4x for AVX2 platforms. > > Encode performance: > **Old:** > > Benchmark (maxNumBytes) Mode Cnt Score Error > Units > Base64Encode.testBase64Encode 1024 thrpt3

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Stuart Marks
On Tue, 7 Feb 2023 15:25:05 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8297632: InputStream.transferTo() method should specify what the return value should be when the number of bytes transfered is larger than Long.MAX_VALUE [v6]

2023-02-07 Thread Brian Burkhalter
> `java.io.InputStream::transferTo` could conceivably return a negative value > if the count of bytes transferred overflows a `long`. Modify the method to > limit the number of bytes transferred to `Long.MAX_VALUE` per invocation. Brian Burkhalter has updated the pull request incrementally with

Re: RFR: 8294982: Implementation of Classfile API [v13]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 13:29:10 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >>

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Tue, 7 Feb 2023 14:51:06 GMT, Adam Sotona wrote: > Class `Signature` (aka `JavaTypeSignature`), all subclasses, > `MethodSignature` and `ClassSignature` are designed according to [JVMS > 4.7.9.1 > Signatures](https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.7.9.1)

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test

2023-02-07 Thread Daniel Fuchs
On Tue, 7 Feb 2023 16:02:30 GMT, Matthew Donovan wrote: >> test/jdk/javax/rmi/ssl/SSLSocketParametersTest.java line 192: >> >>> 190: throw exc; >>> 191: } >>> 192: } >> >> What is the story with the different exception catching here

Re: RFR: JDK-8301444: Port fdlibm hyperbolic transcendental functions to Java [v3]

2023-02-07 Thread Magnus Ihse Bursie
On Mon, 6 Feb 2023 22:08:06 GMT, Joe Darcy wrote: >> Initial pass of porting FDLIBM sinh/cosh/tanh to Java. I do intend to >> refactor the regression tests a bit to reduce duplication, but the actual >> ports should be ready for review. >> >> Diff'ing the ports as before, original vs

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test

2023-02-07 Thread Matthew Donovan
On Tue, 7 Feb 2023 15:54:06 GMT, Daniel Fuchs wrote: >> Removed SSLSocketParametersTest.sh script (which just called a Java file) >> and configured the java code to run directly with jtreg > > test/jdk/javax/rmi/ssl/SSLSocketParametersTest.java line 192: > >> 190: throw

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v11]

2023-02-07 Thread Sandhya Viswanathan
On Tue, 7 Feb 2023 02:49:44 GMT, Sandhya Viswanathan wrote: >> Scott Gibbons has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add algorithm comments > > src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 2227: > >> 2225: >> 2226: //

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test

2023-02-07 Thread Daniel Fuchs
On Mon, 9 Jan 2023 19:54:24 GMT, Matthew Donovan wrote: > Removed SSLSocketParametersTest.sh script (which just called a Java file) and > configured the java code to run directly with jtreg test/jdk/javax/rmi/ssl/SSLSocketParametersTest.java line 192: > 190: throw exc;

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v4]

2023-02-07 Thread Alan Bateman
On Tue, 7 Feb 2023 15:12:15 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v5]

2023-02-07 Thread Claes Redestad
> This adds a local, specialized `copyBytes` method to `String` that avoids > certain redundant range checks and clamping that JIT has issues removing > fully. > > This has a small but statistically significant effect on `String` > microbenchmarks, eg.: > > Baseline > > Benchmark

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v3]

2023-02-07 Thread Claes Redestad
On Tue, 7 Feb 2023 14:57:52 GMT, Alan Bateman wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update StringLatin1.trim for consistency > > src/java.base/share/classes/java/lang/String.java line 4546: > >> 4544:

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v4]

2023-02-07 Thread Claes Redestad
> This adds a local, specialized `copyBytes` method to `String` that avoids > certain redundant range checks and clamping that JIT has issues removing > fully. > > This has a small but statistically significant effect on `String` > microbenchmarks, eg.: > > Baseline > > Benchmark

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v3]

2023-02-07 Thread Alan Bateman
On Tue, 7 Feb 2023 14:39:31 GMT, Claes Redestad wrote: >> This adds a local, specialized `copyBytes` method to `String` that avoids >> certain redundant range checks and clamping that JIT has issues removing >> fully. >> >> This has a small but statistically significant effect on `String` >>

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 12:10:43 GMT, Maurizio Cimadamore wrote: >> The confusion come from simplified name. Signature probably should be called >> JavaTypeSignature according to the spec. ClassSignature and MethodSignature >> could not extend it, as it would not respect the reality. Each of them

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

2023-02-07 Thread Vyom Tewari
On Tue, 7 Feb 2023 09:38:13 GMT, Daniel Jeliński wrote: >> Please review this patch that reduces the socket timeout used in >> HandshakeTimeout test to its minimum value of 1 millisecond. >> >> This change makes the test complete 10 seconds faster; before this change it >> took 5 seconds for

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v2]

2023-02-07 Thread Claes Redestad
> This adds a local, specialized `copyBytes` method to `String` that avoids > certain redundant range checks and clamping that JIT has issues removing > fully. > > This has a small but statistically significant effect on `String` > microbenchmarks, eg.: > > Baseline > > Benchmark

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 14:14:50 GMT, Maurizio Cimadamore wrote: >> The relation is that each `Attribute` is applicable in N >> `AttributedElements` and not vice versa. >> For example `ClassModel::attributedElementKind` returns `CLASS` and for >> example >>

Re: RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String [v3]

2023-02-07 Thread Claes Redestad
> This adds a local, specialized `copyBytes` method to `String` that avoids > certain redundant range checks and clamping that JIT has issues removing > fully. > > This has a small but statistically significant effect on `String` > microbenchmarks, eg.: > > Baseline > > Benchmark

Re: RFR: JDK-8300808: Accelerate Base64 on x86 for AVX2 [v11]

2023-02-07 Thread Scott Gibbons
On Tue, 7 Feb 2023 00:12:21 GMT, Scott Gibbons wrote: >> Added code for Base64 acceleration (encode and decode) which will accelerate >> ~4x for AVX2 platforms. >> >> Encode performance: >> **Old:** >> >> Benchmark (maxNumBytes) Mode Cnt Score Error >> Units

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Tue, 7 Feb 2023 12:59:32 GMT, Adam Sotona wrote: >> Still, there seems to be a modelling issue here. The property of "where >> could this attribute go" is a property of the attribute. Of course, for >> usability reason, an AttributedElement might expose a predicate saying "I >> only accept

RFR: 8301958: Avoid Arrays.copyOfRange overhead in java.lang.String

2023-02-07 Thread Claes Redestad
This adds a local, specialized `copyBytes` method to `String` that avoids certain redundant range checks and clamping that JIT has issues removing fully. This has a small but statistically significant effect on `String` microbenchmarks, eg.: Baseline Benchmark

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

2023-02-07 Thread Mark Sheppard
On Tue, 7 Feb 2023 09:38:13 GMT, Daniel Jeliński wrote: >> Please review this patch that reduces the socket timeout used in >> HandshakeTimeout test to its minimum value of 1 millisecond. >> >> This change makes the test complete 10 seconds faster; before this change it >> took 5 seconds for

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v2]

2023-02-07 Thread Tagir F . Valeev
On Tue, 7 Feb 2023 13:09:39 GMT, ExE Boss wrote: >> @ExE-Boss which problem such an overload would solve? It looks like, `int >> clamp(long, int, int)` can be used everywhere where proposed `int clamp(int, >> int, int)` could be useful. > > A pure `int`‑only overload doesn’t have to go through

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v4]

2023-02-07 Thread Eirik Bjorsnos
> After finding a hash match, getEntryPos needs to compare the lookup name up > to the encoded entry name in the CEN. This comparison is done by decoding the > entry name into a String. The names can then be compared using the String > API. This decoding step adds a significat cost to this

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v3]

2023-02-07 Thread Claes Redestad
On Mon, 6 Feb 2023 16:14:14 GMT, Eirik Bjorsnos wrote: >> After finding a hash match, getEntryPos needs to compare the lookup name up >> to the encoded entry name in the CEN. This comparison is done by decoding >> the entry name into a String. The names can then be compared using the >>

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v2]

2023-02-07 Thread ExE Boss
On Mon, 6 Feb 2023 08:44:22 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/lang/Math.java line 2213: >> >>> 2211: * @since 21 >>> 2212: */ >>> 2213: public static int clamp(long value, int min, int max) { >> >> There should probably also be a pure `int` overload:

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 12:34:50 GMT, Maurizio Cimadamore wrote: >> `AttributedElement::attributedElementKind` identifies the one kind of the >> attributes holder. >> The "places where an attribute can appear" is available through >> `AttributeMapper::whereApplicable` and matched against >>

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v6]

2023-02-07 Thread Raffaello Giulietti
On Tue, 7 Feb 2023 12:43:56 GMT, Tagir F. Valeev wrote: >> test/jdk/java/lang/Math/Clamp.java line 149: >> >>> 147: {-0.0, 0.0, 0.0, 0.0}, >>> 148: {0.0, 0.0, 0.0, 0.0}, >>> 149: {1.0, 0.0, 0.0, 0.0}, >> >> What about adding similar tests for the

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v6]

2023-02-07 Thread Tagir F . Valeev
On Tue, 7 Feb 2023 11:33:12 GMT, Raffaello Giulietti wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Whitespace fixed > > test/jdk/java/lang/Math/Clamp.java line 149: > >> 147: {-0.0, 0.0,

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v8]

2023-02-07 Thread Tagir F . Valeev
> clamp() methods added to Math and StrictMath > > `int clamp(long, int, int)` is somewhat different, as it accepts a `long` > value and safely clamps it to an `int` range. Other overloads work with a > particular type (long, float and double). Using similar approach in other > cases (e.g.

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 12:14:40 GMT, Maurizio Cimadamore wrote: >> On the contrary, it has been deduplicated. Opcode is referencing numeric >> constants stored in Classfile. > > sure, but my question is - once you have a nice enum that is 1-1 with the > opcodes - why would a client want to use

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v7]

2023-02-07 Thread Tagir F . Valeev
> clamp() methods added to Math and StrictMath > > `int clamp(long, int, int)` is somewhat different, as it accepts a `long` > value and safely clamps it to an `int` range. Other overloads work with a > particular type (long, float and double). Using similar approach in other > cases (e.g.

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Tue, 7 Feb 2023 12:23:05 GMT, Adam Sotona wrote: >> Uhm - I can't see these usages... something seems to be off with my IDE >> configuration. I did a grep and I now saw the uses. That said, having the >> Kind/Location inside AttributedElement still looks weird to me. The "places >> where

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Adam Sotona
On Tue, 7 Feb 2023 11:48:28 GMT, Maurizio Cimadamore wrote: >> There are at least 72 usages of AttributedElement.Kind across the Classfile >> API. >> Do you suggest to rename it to something else (for example Location)? > > Uhm - I can't see these usages... something seems to be off with my

Re: RFR: JDK-8301444: Port fdlibm hyperbolic transcendental functions to Java [v3]

2023-02-07 Thread Raffaello Giulietti
On Mon, 6 Feb 2023 22:03:17 GMT, Joe Darcy wrote: >> Yes, it gave me pause when doing the transliteration. >> >> Unpacking the code a bit, >> >> >> /* |x| in [log(maxdouble), overflowthresold] */ >> // lx = *( (((*(unsigned*))>>29)) + (unsigned*)); >> lx =

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 14:35:43 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/Opcode.java line 39: >> >>> 37: */ >>> 38: public enum Opcode { >>> 39: NOP(Classfile.NOP, 1, Kind.NOP), >> >> This also duplicates the constants in classfile... > > On the contrary,

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 14:32:12 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/ClassSignature.java line >> 34: >> >>> 32: * Models the generic signature of a class file, as defined by JVMS >>> 4.7.9. >>> 33: */ >>> 34: public sealed interface ClassSignature >> >>

Re: RFR: 8298939: Refactor open/test/jdk/javax/rmi/ssl/SSLSocketParametersTest.sh to jtreg java test

2023-02-07 Thread Matthew Donovan
On Mon, 9 Jan 2023 19:54:24 GMT, Matthew Donovan wrote: > Removed SSLSocketParametersTest.sh script (which just called a Java file) and > configured the java code to run directly with jtreg Can someone take a look at this? Thanks! - PR: https://git.openjdk.org/jdk/pull/11910

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 14:09:08 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/BootstrapMethodEntry.java >> line 41: >> >>> 39: * part of the constant pool. >>> 40: */ >>> 41: public sealed interface BootstrapMethodEntry >> >> Usages of this seem all to fall into

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 13:55:59 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/AttributedElement.java >> line 94: >> >>> 92: * are permitted. >>> 93: */ >>> 94: enum Kind { >> >> Not sure how to interpret this. This seems to refer to an attribute -

Re: RFR: 8294982: Implementation of Classfile API [v12]

2023-02-07 Thread Maurizio Cimadamore
On Mon, 6 Feb 2023 12:41:44 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/TypeAnnotation.java line >> 75: >> >>> 73: * The kind of target on which the annotation appears. >>> 74: */ >>> 75: public enum TargetType { >> >> My IDE says this enum is

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v6]

2023-02-07 Thread Raffaello Giulietti
On Tue, 7 Feb 2023 10:24:24 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float

Re: RFR: 8299748: java/util/zip/Deinflate.java failing on s390x [v2]

2023-02-07 Thread Amit Kumar
On Thu, 2 Feb 2023 08:27:55 GMT, Amit Kumar wrote: >> DeInflate.java test fails on s390x platform because size for out1 array >> which is responsible for storing the compressed data is insufficient. And >> being unable to write whole compressed data on array, on s390 whole data >> can't be

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp [v2]

2023-02-07 Thread SUN Guoyun
On Fri, 3 Feb 2023 07:59:25 GMT, SUN Guoyun wrote: >> Hi all, >> When `-Xcomp` be used, java thread to block for longer, then causing >> StructuredTaskScopeTest.java failed frequently on the AArch64 and >> LoongArch64 architecture. >> >> This PR fix the issue, Please help review it. >> >>

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v4]

2023-02-07 Thread Tagir F . Valeev
On Tue, 7 Feb 2023 00:57:54 GMT, Joe Darcy wrote: >> Tagir F. Valeev has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added explanatory comments > > src/java.base/share/classes/java/lang/Math.java line 2266: > >> 2264: // If min

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v6]

2023-02-07 Thread Tagir F . Valeev
> clamp() methods added to Math and StrictMath > > `int clamp(long, int, int)` is somewhat different, as it accepts a `long` > value and safely clamps it to an `int` range. Other overloads work with a > particular type (long, float and double). Using similar approach in other > cases (e.g.

Re: RFR: 8301226: Add clamp() methods to java.lang.Math and to StrictMath [v5]

2023-02-07 Thread Tagir F . Valeev
> clamp() methods added to Math and StrictMath > > `int clamp(long, int, int)` is somewhat different, as it accepts a `long` > value and safely clamps it to an `int` range. Other overloads work with a > particular type (long, float and double). Using similar approach in other > cases (e.g.

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

2023-02-07 Thread Daniel Jeliński
On Tue, 7 Feb 2023 09:38:13 GMT, Daniel Jeliński wrote: >> Please review this patch that reduces the socket timeout used in >> HandshakeTimeout test to its minimum value of 1 millisecond. >> >> This change makes the test complete 10 seconds faster; before this change it >> took 5 seconds for

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange() [v3]

2023-02-07 Thread Xiaohong Gong
On Tue, 7 Feb 2023 09:51:19 GMT, Xiaohong Gong wrote: >> The Vector API `"indexInRange(int offset, int limit)"` is used >> to compute a vector mask whose lanes are set to true if the >> index of the lane is inside the range specified by the `"offset"` >> and `"limit"` arguments, otherwise the

Re: RFR: 8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange() [v3]

2023-02-07 Thread Xiaohong Gong
> The Vector API `"indexInRange(int offset, int limit)"` is used > to compute a vector mask whose lanes are set to true if the > index of the lane is inside the range specified by the `"offset"` > and `"limit"` arguments, otherwise the lanes are set to false. > > There are two special cases for

Re: RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

2023-02-07 Thread Daniel Jeliński
> Please review this patch that reduces the socket timeout used in > HandshakeTimeout test to its minimum value of 1 millisecond. > > This change makes the test complete 10 seconds faster; before this change it > took 5 seconds for the handshake to timeout, and the test attempts 2 >

Integrated: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp

2023-02-07 Thread SUN Guoyun
On Fri, 3 Feb 2023 03:19:05 GMT, SUN Guoyun wrote: > Hi all, > When `-Xcomp` be used, java thread to block for longer, then causing > StructuredTaskScopeTest.java failed frequently on the AArch64 and LoongArch64 > architecture. > > This PR fix the issue, Please help review it. > > Thanks.

Re: RFR: 8301736: jdk/incubator/concurrent/StructuredTaskScope/StructuredTaskScopeTest.java fail with -Xcomp [v2]

2023-02-07 Thread Jie Fu
On Tue, 7 Feb 2023 08:45:49 GMT, Alan Bateman wrote: > It's okay if your change goes first of course, it's just that I hope to > replace these sleeps to make the tests more robust. So just sponsor it. - PR: https://git.openjdk.org/jdk/pull/12398

  1   2   >