Re: RFR: 8270380: Change the default value of the java.security.manager system property to disallow

2021-08-30 Thread Weijun Wang
On Fri, 20 Aug 2021 22:44:34 GMT, Weijun Wang wrote: > This change modifies the default value of the `java.security.manager` system > property from "allow" to "disallow". This means unless it's explicitly set to > "allow", any call to `System.setSecurityManager()` would throw an UOE. > > The

Re: RFR: 8270380: Change the default value of the java.security.manager system property to disallow [v2]

2021-08-30 Thread Weijun Wang
> This change modifies the default value of the `java.security.manager` system > property from "allow" to "disallow". This means unless it's explicitly set to > "allow", any call to `System.setSecurityManager()` would throw an UOE. > > The `AllowSecurityManager.java` and

Re: RFR: 8272600: (test) Use native "sleep" in Basic.java [v3]

2021-08-30 Thread David Holmes
On Tue, 24 Aug 2021 19:06:55 GMT, Roger Riggs wrote: >> test/jdk/java/lang/ProcessBuilder/Basic.java line 30: >> >>> 28: * 6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958 >>> 29: * 4947220 7018606 7034570 4244896 5049299 8003488 8054494 8058464 >>> 30: *

Re: RFR: 8272600: (test) Use native "sleep" in Basic.java [v3]

2021-08-30 Thread David Holmes
On Sat, 28 Aug 2021 02:34:48 GMT, Roger Riggs wrote: >> The intermittent test in java/lang/ProcessBuilder/Basic.java has identified >> unexpected messages from a child Java VM >> as the cause of the test failure. Attempts to control the output of the >> child VM have failed, the VM is

Re: RFR: 8273092: Sort classlist in JDK image [v2]

2021-08-30 Thread Ioi Lam
> When the classlist is generated using build.tools.classlist.HelloClasslist, > its contents may be non-deterministic due to Java thread execution order. > > We should sort the generated classlist to make the JDK image's contents more > deterministic. > > Tested with Mach5 tier1, tier2,

Re: RFR: 8273092: Sort classlist in JDK image [v2]

2021-08-30 Thread Ioi Lam
On Mon, 30 Aug 2021 12:51:43 GMT, Daniel Fuchs wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @dfuch comments > > make/jdk/src/classes/build/tools/classlist/SortClasslist.java line 58: > >> 56: String

Re: RFR: 8272600: (test) Use native "sleep" in Basic.java [v3]

2021-08-30 Thread David Holmes
On Sat, 28 Aug 2021 02:34:48 GMT, Roger Riggs wrote: >> The intermittent test in java/lang/ProcessBuilder/Basic.java has identified >> unexpected messages from a child Java VM >> as the cause of the test failure. Attempts to control the output of the >> child VM have failed, the VM is

Re: RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v5]

2021-08-30 Thread Mandy Chung
> This reimplements core reflection with method handles. > > For `Constructor::newInstance` and `Method::invoke`, the new implementation > uses `MethodHandle`. For `Field` accessor, the new implementation uses > `VarHandle`.For the first few invocations of one of these reflective >

Re: RFR: 8078641: MethodHandle.asTypeCache can retain classes from unloading

2021-08-30 Thread Mandy Chung
On Thu, 26 Aug 2021 17:57:26 GMT, Paul Sandoz wrote: >> `MethodHandle.asTypeCache` keeps a strong reference to adapted >> `MethodHandle` and it can introduce a class loader leak through its >> `MethodType`. >> >> Proposed fix introduces a 2-level cache (1 element each) where 1st level can >>

Re: RFR: 8078641: MethodHandle.asTypeCache can retain classes from unloading

2021-08-30 Thread Mandy Chung
On Wed, 25 Aug 2021 09:31:51 GMT, Vladimir Ivanov wrote: > `MethodHandle.asTypeCache` keeps a strong reference to adapted `MethodHandle` > and it can introduce a class loader leak through its `MethodType`. > > Proposed fix introduces a 2-level cache (1 element each) where 1st level can > only

Re: RFR: 8271602: Add Math.ceilDiv() family parallel to Math.floorDiv() family

2021-08-30 Thread Brian Burkhalter
On Fri, 27 Aug 2021 18:53:23 GMT, Raffaello Giulietti wrote: > Please review this PR to add officially endorsed `ceilDiv()` and `ceilMod()` > methods do `j.l.[Strict]Math`. > > Beside adding fresh tests to `test/jdk/java/lang/Math/DivModTests.java`, this > PR also corrects small typos in it

Re: RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v4]

2021-08-30 Thread Mandy Chung
> This reimplements core reflection with method handles. > > For `Constructor::newInstance` and `Method::invoke`, the new implementation > uses `MethodHandle`. For `Field` accessor, the new implementation uses > `VarHandle`.For the first few invocations of one of these reflective >

Re: RFR: 8271602: Add Math.ceilDiv() family parallel to Math.floorDiv() family

2021-08-30 Thread Brian Burkhalter
On Fri, 27 Aug 2021 18:53:23 GMT, Raffaello Giulietti wrote: > Please review this PR to add officially endorsed `ceilDiv()` and `ceilMod()` > methods do `j.l.[Strict]Math`. > > Beside adding fresh tests to `test/jdk/java/lang/Math/DivModTests.java`, this > PR also corrects small typos in it

Re: RFR: 8271225: Add floorDivExact() method to java.lang.[Strict]Math [v3]

2021-08-30 Thread Joe Darcy
On Thu, 5 Aug 2021 18:57:42 GMT, Brian Burkhalter wrote: >> Add methods `floorDivExact(int,int)` and `floorDivExact(long,long)` to >> `java.lang.Math` and `java.lang.StrictMath`. > > Brian Burkhalter has updated the pull request with a new target base due to a > merge or a rebase. The pull

Re: RFR: 8270380: Change the default value of the java.security.manager system property to disallow

2021-08-30 Thread Sean Mullan
On Fri, 20 Aug 2021 22:44:34 GMT, Weijun Wang wrote: > This change modifies the default value of the `java.security.manager` system > property from "allow" to "disallow". This means unless it's explicitly set to > "allow", any call to `System.setSecurityManager()` would throw an UOE. > > The

Integrated: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null

2021-08-30 Thread Vicente Romero
On Mon, 23 Aug 2021 18:08:02 GMT, Vicente Romero wrote: > Please review this simple PR along with the associated CSR. The PR is > basically adding a line the the specification of method > `java.lang.runtime.ObjectMethods::bootstrap` stating under what conditions a > NPE will be thrown. > >

Re: RFR: 8214761: Bug in parallel Kahan summation implementation [v2]

2021-08-30 Thread Joe Darcy
On Wed, 21 Jul 2021 20:19:31 GMT, Ian Graves wrote: >> 8214761: Bug in parallel Kahan summation implementation > > Ian Graves has updated the pull request incrementally with three additional > commits since the last revision: > > - Updates with more test coverage > - stashing > - Stashing

Integrated: 8260265: UTF-8 by Default

2021-08-30 Thread Naoto Sato
On Thu, 8 Jul 2021 21:23:00 GMT, Naoto Sato wrote: > This is an implementation for the `JEP 400: UTF-8 by Default`. The gist of > the changes is `Charset.defaultCharset()` returning `UTF-8` and > `file.encoding` system property being added in the spec, but another notable > modification is in

Re: RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v4]

2021-08-30 Thread Vicente Romero
> Please review this simple PR along with the associated CSR. The PR is > basically adding a line the the specification of method > `java.lang.runtime.ObjectMethods::bootstrap` stating under what conditions a > NPE will be thrown. > > TIA > > link to the

Re: RFR: 8272347: ObjectMethods::bootstrap should specify NPE if any argument except lookup is null [v3]

2021-08-30 Thread Vicente Romero
On Mon, 30 Aug 2021 01:45:49 GMT, Mandy Chung wrote: >> Vicente Romero has updated the pull request incrementally with one >> additional commit since the last revision: >> >> clarifying that the names parameter is ignored in some cases > >

Re: RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible [v3]

2021-08-30 Thread Kevin Rushforth
On Mon, 30 Aug 2021 19:23:57 GMT, Сергей Цыпанов wrote: >> Just a very tiny clean-up. >> >> There are some places in JDK code base where we call >> `Enum.class.getEnumConstants()` to get all the values of the referenced >> `enum`. This is excessive, less-readable and slower than just calling

Re: RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible [v3]

2021-08-30 Thread Сергей Цыпанов
> Just a very tiny clean-up. > > There are some places in JDK code base where we call > `Enum.class.getEnumConstants()` to get all the values of the referenced > `enum`. This is excessive, less-readable and slower than just calling > `Enum.values()` as in `getEnumConstants()` we have volatile

Re: RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible [v2]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 17:54:45 GMT, Joe Darcy wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8273140: Fix copyright year > > src/java.desktop/share/classes/sun/font/AttributeValues.java line 2: > >> 1: /* >> 2:

Re: RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible [v2]

2021-08-30 Thread Сергей Цыпанов
> Just a very tiny clean-up. > > There are some places in JDK code base where we call > `Enum.class.getEnumConstants()` to get all the values of the referenced > `enum`. This is excessive, less-readable and slower than just calling > `Enum.values()` as in `getEnumConstants()` we have volatile

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Alan Bateman
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible

2021-08-30 Thread Joe Darcy
On Mon, 30 Aug 2021 14:26:56 GMT, Сергей Цыпанов wrote: > Just a very tiny clean-up. > > There are some places in JDK code base where we call > `Enum.class.getEnumConstants()` to get all the values of the referenced > `enum`. This is excessive, less-readable and slower than just calling >

Integrated: 8271302: Regex Test Refresh

2021-08-30 Thread Ian Graves
On Wed, 11 Aug 2021 18:22:42 GMT, Ian Graves wrote: > 8271302: Regex Test Refresh This pull request has now been integrated. Changeset: fecefb85 Author:Ian Graves URL: https://git.openjdk.java.net/jdk/commit/fecefb8541d5056b1a8b105126ac9c566875e056 Stats: 2253 lines in 3 files

Re: RFR: 8271820: Implementation of JEP 416: Reimplement Core Reflection with Method Handle [v3]

2021-08-30 Thread Mandy Chung
On Fri, 27 Aug 2021 13:28:08 GMT, Maurizio Cimadamore wrote: > Overall, seems like a solid piece of work. I did not review in full the > intricacies with caller sensitive (as I don't know that area too much), but > the general rewrite seems solid. Thanks for the review. > One thing I had

Integrated: 8272861: Add a micro benchmark for vector api

2021-08-30 Thread Sandhya Viswanathan
On Mon, 23 Aug 2021 23:18:28 GMT, Sandhya Viswanathan wrote: > This pull request adds a micro benchmark for Vector API. > The Black Scholes algorithm is implemented with and without Vector API. > We see about ~6x gain with Vector API for this micro benchmark using 256 bit > vectors. This pull

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Roger Riggs
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8271302: Regex Test Refresh [v5]

2021-08-30 Thread Ian Graves
> 8271302: Regex Test Refresh Ian Graves has updated the pull request incrementally with one additional commit since the last revision: Removing some notes re JUnit5 - Changes: - all: https://git.openjdk.java.net/jdk/pull/5092/files - new:

Re: RFR: 8271302: Regex Test Refresh [v4]

2021-08-30 Thread Ian Graves
On Fri, 27 Aug 2021 23:18:34 GMT, Stuart Marks wrote: >> Ian Graves has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Additional cleanup > > test/jdk/java/util/regex/RegExTest.java line 85: > >> 83: import static org.testng.Assert.fail;

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 14:52:12 GMT, Claes Redestad wrote: >> What about lines 582, 1003 and 1175? E.g. 582 >> >> public AbstractStringBuilder append(String str) { >> if (str == null) { >> return appendNull(); >> } >> int len = str.length(); >> ensureCapacityInternal(count

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: Proposal: JDK-8231640 - (prop) Canonical property storage

2021-08-30 Thread Roger Riggs
Hi Jaikiran, System properties, especially new ones, should be only settable on the command line and read once. It makes them visible to developers and avoids state-full dependencies and concurrency issues. Retiring system properties is quite difficult because there's no way to know if they

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 14:26:23 GMT, Сергей Цыпанов wrote: >> No, I don't think so. The only use of this I can find is at line 1298 which >> effectively adds a substring: `putStringAt(dstOffset, (String) s, start, >> end);` > > What about lines 582, 1003 and 1175? E.g. 582 > > public

RFR: 8273140: Replace usages of Enum.class.getEnumConstants() with Enum.values() where possible

2021-08-30 Thread Сергей Цыпанов
Just a very tiny clean-up. There are some places in JDK code base where we call `Enum.class.getEnumConstants()` to get all the values of the referenced `enum`. This is excessive, less-readable and slower than just calling `Enum.values()` as in `getEnumConstants()` we have volatile access:

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 13:54:13 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1730: >> >>> 1728: } >>> 1729: >>> 1730: private void putStringAt(int index, String str) { >> >> Can we replace all the calls to this method with calls to

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:35:23 GMT, Сергей Цыпанов wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Simplify and call getBytes(String, int, byte) when possible > >

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 14:04:27 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1714: >> >>> 1712: >>> 1713: private void inflateIfNeededFor(String input) { >>> 1714: if (COMPACT_STRINGS && (coder != input.coder())) { >> >> I'm not

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:29:56 GMT, Сергей Цыпанов wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Simplify and call getBytes(String, int, byte) when possible > >

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 13:15:20 GMT, Сергей Цыпанов wrote: > Hi, just curious how have you found out that the code should be extracted > into a separate methods? Profiler? I saw that `String::length` calls appeared more than once with async-profiler, then did some experiments to see if manually

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Сергей Цыпанов
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Integrated: 8273098: Unnecessary Vector usage in java.naming

2021-08-30 Thread Andrey Turbanov
On Thu, 26 Aug 2021 07:04:45 GMT, Andrey Turbanov wrote: > Usage of thread-safe collection Vector is unnecessary. It's recommended to > use ArrayList/array if a thread-safe implementation is not needed. In > post-BiasedLocking times, this is gets worse, as every access is synchronized. > I

Re: RFR: 8273092: Sort classlist in JDK image

2021-08-30 Thread Daniel Fuchs
On Fri, 27 Aug 2021 23:12:52 GMT, Ioi Lam wrote: > When the classlist is generated using build.tools.classlist.HelloClasslist, > its contents may be non-deterministic due to Java thread execution order. > > We should sort the generated classlist to make the JDK image's contents more >

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
On Mon, 30 Aug 2021 11:49:49 GMT, Claes Redestad wrote: >> Refactor to improve inlining, which helps some microbenchmarks exer >> StringBuilder.append(String) > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision: > > Simplify and

Re: Proposal: JDK-8231640 - (prop) Canonical property storage

2021-08-30 Thread Magnus Ihse Bursie
On 2021-08-28 17:16, Alan Bateman wrote: On 28/08/2021 05:45, Jaikiran Pai wrote: I hadn't considered the system property approach to switch to old behaviour in my proposals, so this is a very good input and I personally think the most logical proposals so far. Roger may be right that few

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v3]

2021-08-30 Thread Claes Redestad
> Refactor to improve inlining, which helps some microbenchmarks exer > StringBuilder.append(String) Claes Redestad has updated the pull request incrementally with one additional commit since the last revision: Simplify and call getBytes(String, int, byte) when possible -

Re: RFR: 8273092: Sort classlist in JDK image

2021-08-30 Thread Magnus Ihse Bursie
On Fri, 27 Aug 2021 23:12:52 GMT, Ioi Lam wrote: > When the classlist is generated using build.tools.classlist.HelloClasslist, > its contents may be non-deterministic due to Java thread execution order. > > We should sort the generated classlist to make the JDK image's contents more >

Re: RFR: 8273098: Unnecessary Vector usage in java.naming

2021-08-30 Thread Daniel Fuchs
On Thu, 26 Aug 2021 07:04:45 GMT, Andrey Turbanov wrote: > Usage of thread-safe collection Vector is unnecessary. It's recommended to > use ArrayList/array if a thread-safe implementation is not needed. In > post-BiasedLocking times, this is gets worse, as every access is synchronized. > I

Re: RFR: 8273098: Unnecessary Vector usage in java.naming

2021-08-30 Thread Aleksei Efimov
On Thu, 26 Aug 2021 07:04:45 GMT, Andrey Turbanov wrote: > Usage of thread-safe collection Vector is unnecessary. It's recommended to > use ArrayList/array if a thread-safe implementation is not needed. In > post-BiasedLocking times, this is gets worse, as every access is synchronized. > I

Re: RFR: 8273100: Improve AbstractStringBuilder.append(String) when using CompactStrings [v2]

2021-08-30 Thread Claes Redestad
> Refactor to improve inlining, which helps some microbenchmarks exer > StringBuilder.append(String) Claes Redestad has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull

Re: RFR: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo [v7]

2021-08-30 Thread Wang Huang
> Dear all, > Can you do me a favor to review this patch. This patch use `ldp` to > implement String.compareTo. > > * We add a JMH test case > * Here is the result of this test case > > Benchmark|(size)| Mode| Cnt|Score | Error |Units >