Re: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v9]

2021-05-31 Thread Vyom Tewari
On Mon, 31 May 2021 14:10:50 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.io`, >> `java.math`, and `java.text` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 22:36:52 GMT, David Holmes wrote: > > OTOH when CLASS retention is changing to RUNTIME, such as in this case, the > > ways of looking up are widening (there is some new desire to lookup the > > annotation at runtime via reflection). To facilitate that, the annotation > >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread David Holmes
On 1/06/2021 4:20 am, Peter Levart wrote: On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: That reads backwards to me. +PreserveAllAnnotations means that CLASS retention annotations are retained by the VM not just RUNTIME ones. So in that sense it might be a migration aid if moving from

Re: RFR: 8236569: -Xss not multiple of 4K does not work for the main thread on macOS

2021-05-31 Thread Vladimir Kempik
On Sun, 30 May 2021 03:00:56 GMT, David Holmes wrote: >> …d on macOS >> >> This patch simply round up the specified stack size to multiple of the >> system page size. >> >> Test is trivial, simply run java with -Xss option against following code. On >> MacOS, before the fix, running with

Re: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v9]

2021-05-31 Thread Iris Clark
On Mon, 31 May 2021 14:10:50 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.io`, >> `java.math`, and `java.text` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: > That reads backwards to me. +PreserveAllAnnotations means that CLASS > retention annotations are retained by the VM not just RUNTIME ones. So > in that sense it might be a migration aid if moving from RUNTIME to > CLASS, not CLASS to

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 12:37:55 GMT, David Holmes wrote: > > Hi Jaroslav, > > If you change `@JavaScriptBody` retention to `RUNTIME`, you don't need to > > re-compile any code that uses this annotation. You just have to use > > `-XX:+PreserveAllAnnotations` to expose all anotations to JVM and >

Integrated: 8267921: Remove redundant loop from sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()

2021-05-31 Thread Сергей Цыпанов
On Mon, 31 May 2021 07:36:10 GMT, Сергей Цыпанов wrote: > This a tiny follop-up of https://github.com/openjdk/jdk/pull/3571. > > The loop in `sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()` is > redundant since `Class.getPackageName()` will already return the package name > of the

Re: RFR: 8267921: Remove redundant loop from sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()

2021-05-31 Thread Mandy Chung
On Mon, 31 May 2021 07:36:10 GMT, Сергей Цыпанов wrote: > This a tiny follop-up of https://github.com/openjdk/jdk/pull/3571. > > The loop in `sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()` is > redundant since `Class.getPackageName()` will already return the package name > of the

Re: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v6]

2021-05-31 Thread Lance Andersen
On Mon, 31 May 2021 15:02:57 GMT, Weijun Wang wrote: >> Please review this implementation of [JEP >> 411](https://openjdk.java.net/jeps/411). >> >> The code change is divided into 3 commits. Please review them one by one. >> >> 1. >>

Re: RFR: 8267921: Remove redundant loop from sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()

2021-05-31 Thread Alan Bateman
On Mon, 31 May 2021 07:36:10 GMT, Сергей Цыпанов wrote: > This a tiny follop-up of https://github.com/openjdk/jdk/pull/3571. > > The loop in `sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()` is > redundant since `Class.getPackageName()` will already return the package name > of the

Re: RFR: 8264859: Implement Context-Specific Deserialization Filters [v13]

2021-05-31 Thread Daniel Fuchs
On Mon, 31 May 2021 15:44:06 GMT, Roger Riggs wrote: >> JEP 415: Context-specific Deserialization Filters extends the >> deserialization filtering mechanisms with more flexible and customizable >> protections against malicious deserialization. See JEP 415: >>

Re: RFR: 8264859: Implement Context-Specific Deserialization Filters [v13]

2021-05-31 Thread Roger Riggs
> JEP 415: Context-specific Deserialization Filters extends the deserialization > filtering mechanisms with more flexible and customizable protections against > malicious deserialization. See JEP 415: https://openjdk.java.net/jeps/415. > The `java.io.ObjectInputFilter` and

Re: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v6]

2021-05-31 Thread Weijun Wang
On Mon, 31 May 2021 15:02:57 GMT, Weijun Wang wrote: >> Please review this implementation of [JEP >> 411](https://openjdk.java.net/jeps/411). >> >> The code change is divided into 3 commits. Please review them one by one. >> >> 1. >>

Re: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v6]

2021-05-31 Thread Weijun Wang
> Please review this implementation of [JEP > 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. > https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 > The essential change for this JEP,

Re: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v9]

2021-05-31 Thread Chris Hegarty
On Mon, 31 May 2021 14:07:54 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.io`, >> `java.math`, and `java.text` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated

Re: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v9]

2021-05-31 Thread Patrick Concannon
> Hi, > > Could someone please review my code for updating the code in the `java.io`, > `java.math`, and `java.text` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase.

Re: RFR: 8262891: Compiler implementation for Pattern Matching for switch (Preview) [v7]

2021-05-31 Thread Jan Lahoda
> This is a preview of a patch implementing JEP 406: Pattern Matching for > switch (Preview): > https://bugs.openjdk.java.net/browse/JDK-8213076 > > The current draft of the specification is here: > http://cr.openjdk.java.net/~gbierman/jep406/jep406-20210430/specs/patterns-switch-jls.html > > A

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread David Holmes
On 31/05/2021 8:29 pm, Peter Levart wrote: On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: My use-case relates to [@JavaScriptBody](https://bits.netbeans.org/html+java/1.7.1/net/java/html/js/package-summary.html) annotation used for Java/JavaScript interop. Originally all existing

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: 8266310: deadlock while loading the JNI code [v6]

2021-05-31 Thread Chris Hegarty
On Thu, 27 May 2021 14:31:59 GMT, Aleksei Voitylov wrote: >> Please review this PR which fixes the deadlock in ClassLoader between the >> two lock objects - a lock object associated with the class being loaded, and >> the ClassLoader.loadedLibraryNames hash map, locked during the native >>

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Peter Levart
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

RFR: 8267969: Add vectorized implementation for VectorMask.eq()

2021-05-31 Thread Xiaohong Gong
Currently `"VectorMask.eq()" `is not vectorized: public VectorMask eq(VectorMask m) { // FIXME: Generate good code here. return bOp(m, (i, a, b) -> a == b); } This can be implemented by calling `"xor(m.not())"` directly. The performance improved about 1.4x ~ 1.9x for the

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread Peter Levart
On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: > My use-case relates to > [@JavaScriptBody](https://bits.netbeans.org/html+java/1.7.1/net/java/html/js/package-summary.html) > annotation used for Java/JavaScript interop. Originally all existing usages > (Post Processing Classes,

Re: RFR: 8266310: deadlock while loading the JNI code [v5]

2021-05-31 Thread Peter Levart
On Thu, 27 May 2021 14:28:09 GMT, Aleksei Voitylov wrote: >> src/java.base/share/classes/jdk/internal/loader/NativeLibraries.java line >> 481: >> >>> 479: throw new Error("Maximum lock count exceeded"); >>> 480: } >>> 481: >> >> Hi Aleksei, >> I know in practice this

Re: RFR: 8266310: deadlock while loading the JNI code [v6]

2021-05-31 Thread Peter Levart
On Thu, 27 May 2021 14:31:59 GMT, Aleksei Voitylov wrote: >> Please review this PR which fixes the deadlock in ClassLoader between the >> two lock objects - a lock object associated with the class being loaded, and >> the ClassLoader.loadedLibraryNames hash map, locked during the native >>

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Doug Simon
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Integrated: 8267587: Update java.util to use enhanced switch

2021-05-31 Thread Tagir F . Valeev
On Mon, 24 May 2021 04:20:23 GMT, Tagir F. Valeev wrote: > Inspired by PR#4088. Most of the changes are done automatically using > IntelliJ IDEA refactoring. Some manual adjustments are also performed, > including indentations, moving comments, extracting common cast out of switch >

RFR: 8267921: Remove redundant loop from sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()

2021-05-31 Thread Сергей Цыпанов
This a tiny follop-up of https://github.com/openjdk/jdk/pull/3571. The loop in `sun.reflect.misc.ReflectUtil.privateCheckPackageAccess()` is redundant since `Class.getPackageName()` will already return the package name of the innermost component type. - Commit messages: -

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v2]

2021-05-31 Thread Alan Bateman
On Sun, 30 May 2021 20:06:49 GMT, Jaroslav Tulach wrote: > Obvious suggestion is to change the `@JavaScriptBody` retention to `RUNTIME` > - however there are plenty of libraries already compiled with the existing > annotation and they would have to be all recompiled to new version. I'd >

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread David Holmes
On 31/05/2021 4:11 pm, Jaroslav Tulach wrote: On Sun, 30 May 2021 23:03:55 GMT, David Holmes wrote: But we should add in some tests. Right, I was surprised by missing tests as well. I've just created a _"standalone"_ commit 0f689ea that adds such test and also shows the way I am

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Jaroslav Tulach
On Mon, 31 May 2021 06:06:37 GMT, Jaroslav Tulach wrote: >> This PR exposes runtime invisible annotations via `Class.getAnnotation` when >> `-XX:+PreserveAllAnnotations` option is passed to the JVM. >> >> Existing `-XX:+PreserveAllAnnotations` option can be very useful for code >> that needs

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code

2021-05-31 Thread Jaroslav Tulach
On Sun, 30 May 2021 23:03:55 GMT, David Holmes wrote: > But we should add in some tests. Right, I was surprised by missing tests as well. I've just created a _"standalone"_ commit 0f689ea that adds such test and also shows the way I am currently using the `-XX:+PreserveAllAnnotations` flag.

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v4]

2021-05-31 Thread Jaroslav Tulach
> This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to access annotations with `RetentionPolicy.CLASS` without the

Re: RFR: JDK-8267936: PreserveAllAnnotations option doesn't expose the annotation to Java code [v3]

2021-05-31 Thread Jaroslav Tulach
> This PR exposes runtime invisible annotations via `Class.getAnnotation` when > `-XX:+PreserveAllAnnotations` option is passed to the JVM. > > Existing `-XX:+PreserveAllAnnotations` option can be very useful for code > that needs to access annotations with `RetentionPolicy.CLASS` without the