Re: RFR: 8254354: Add an asExact() VarHandle combinator [v2]

2020-10-23 Thread Rémi Forax
On Fri, 23 Oct 2020 18:04:11 GMT, Jorn Vernee wrote: >> Hi, >> >> This patch adds an asExact() combinator to VarHandle, that will return a new >> VarHandle that performs exact type checks, similar to >> MethodHandle::invokeExact, to help developers catch inexact VarHandle usage, >> which can

Re: RFR: 8255398: Add a dropReturn MethodHandle combinator [v3]

2020-10-26 Thread Rémi Forax
On Mon, 26 Oct 2020 18:01:04 GMT, John R Rose wrote: >> @rose00 My bad. You're right, I realized we could also use `asType` later on >> (I did call it out in the CSR), but It's still a bit more wordy than what >> I'm proposing. >> >> `dropReturn` seemed like a good choice since we already have

Re: RFR: 8254354: Add an asExact() VarHandle combinator [v2]

2020-10-26 Thread Rémi Forax
On Mon, 26 Oct 2020 16:34:10 GMT, Paul Sandoz wrote: >> The direct use of the enum ordinal is because HotSpot accessing it from the >> enum value is (or was) not optimal in C2. >> >> You can avoid the addition of the stable array by doing the following: >> >> public final MethodType acces

Re: RFR: 8254354: Add an asExact() VarHandle combinator

2020-10-26 Thread Rémi Forax
On Fri, 23 Oct 2020 17:47:36 GMT, Jorn Vernee wrote: > Hi, > > This patch adds an asExact() combinator to VarHandle, that will return a new > VarHandle that performs exact type checks, similar to > MethodHandle::invokeExact, to help developers catch inexact VarHandle usage, > which can lead t

Re: RFR: 8159746: (proxy) Support for default methods

2020-10-28 Thread Rémi Forax
On Wed, 28 Oct 2020 17:36:40 GMT, Mandy Chung wrote: >>> Hi Peter, >>> >>> > Question remains how do we distinguish proxies with old-fassioned >>> > InvocationHandlers from proxies with InvocationHandlers having access to >>> > super-default-handler. Both kinds of handlers look the same from P

Re: RFR: 8159746: (proxy) Support for default methods

2020-10-28 Thread Rémi Forax
On Wed, 28 Oct 2020 19:28:36 GMT, Mandy Chung wrote: >> Hi Mandy and Peter, >> reading your exchanges, i wonder if it's not better to stop trying to add >> more and more features to the already clunky java.lang.reflect.Proxy but >> instead to move to provide the same set of feature but using an

Re: RFR: 8186085: (opt) add filter(), flatMap(), and map() methods to OptionalDouble/Int/Long

2020-11-01 Thread Rémi Forax
On Sat, 31 Oct 2020 16:45:06 GMT, Kartik Ohri wrote: >> Hi all, >> This PR intends to add filter, map and flatMap methods to the Optional >> classes for primitives. The rationale is consistency with the Optional class >> for objects and user convenience. >> Thanks. >> Regards, >> Kartik > > Ki

Re: RFR: 8186085: (opt) add filter(), flatMap(), and map() methods to OptionalDouble/Int/Long

2020-11-01 Thread Rémi Forax
On Sun, 1 Nov 2020 13:20:20 GMT, Kartik Ohri wrote: >> Hi ! >> thanks for taking the time to craft that pull request but this is typically >> the kind of patch that should be discussed on the mailing list first before >> creating a pull request. >> >> There are several issues, one is that we

Re: RFR: 8159746: (proxy) Support for default methods

2020-11-20 Thread Rémi Forax
On Fri, 20 Nov 2020 19:51:57 GMT, Mandy Chung wrote: >> @plevart I'm okay with this slight performance improvement. > > I have a fresh look at the different options we have explored (lots of > challenges in finding the right API with security, usability and performance > issues to consider).

Re: RFR: 8180352: Add Stream.toList() method [v3]

2020-11-21 Thread Rémi Forax
On Thu, 5 Nov 2020 17:26:48 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 199: >> >>> 197: * safely reused as the List's internal storage, avoiding a >>> defensive copy. Declared >>> 198: * with Object... instead of E... as the parame

Re: RFR: 8180352: Add Stream.toList() method [v3]

2020-11-21 Thread Rémi Forax
On Wed, 18 Nov 2020 22:20:26 GMT, Stuart Marks wrote: >> This change introduces a new terminal operation on Stream. This looks like a >> convenience method for Stream.collect(Collectors.toList()) or >> Stream.collect(Collectors.toUnmodifiableList()), but it's not. Having this >> method directl

Re: RFR: 8180352: Add Stream.toList() method [v3]

2020-11-21 Thread Rémi Forax
On Wed, 4 Nov 2020 09:21:12 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/util/stream/Stream.java line 1192: >> >>> 1190: @SuppressWarnings("unchecked") >>> 1191: default List toList() { >>> 1192: return (List) Collections.unmodifiableList(new >>> ArrayList<>(A

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 13:09:03 GMT, Jim Laskey wrote: >> This PR is to introduce a new random number API for the JDK. The primary API >> is found in RandomGenerator and RandomGeneratorFactory. Further description >> can be found in the JEP https://openjdk.java.net/jeps/356 . >> >> javadoc can be

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 15:43:39 GMT, Jim Laskey wrote: >> will investigate > > Needed to use ThreadLocalRandomProxy.proxy otherwise a cast would be required. yes, right ! - PR: https://git.openjdk.java.net/jdk/pull/1292

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 15:59:01 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java >> line 88: >> >>> 86: * {@code >>> 87: * RandomGeneratorFactory best = >>> RandomGenerator.all() >>> 88: * .sorted((f, g) -> Integer.compare(g.stateBi

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 16:22:34 GMT, Jim Laskey wrote: >> src/java.base/share/classes/java/util/random/RandomGeneratorFactory.java >> line 151: >> >>> 149: if (fm == null) { >>> 150: synchronized (RandomGeneratorFactory.class) { >>> 151: if (RandomGeneratorFacto

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2020-11-25 Thread Rémi Forax
On Wed, 25 Nov 2020 19:48:32 GMT, Jim Laskey wrote: >> At least, it's more clear that it's reversed, i've initially miss the fact >> that f and g are swapped. >> And :: is able to do inference so, i believe it can be written >> >> `.sorted(Comparator.comparingInt(RandomGeneratorFactory::state

Re: RFR: 8255542: Attribute length of Module, ModulePackages and other attributes is ignored [v2]

2020-12-03 Thread Rémi Forax
On Thu, 3 Dec 2020 09:58:16 GMT, Alan Bateman wrote: >> The attribute_length of known Module attributes in the module-info.class >> is currently ignored. It should be checked and the class rejected if the >> attribute length doesn't exactly match the length of the info in the >> attribute.

Re: RFR: 8255542: Attribute length of Module, ModulePackages and other attributes is ignored [v2]

2020-12-03 Thread Rémi Forax
On Thu, 3 Dec 2020 15:52:35 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/jdk/internal/module/ModuleInfo.java line 1203: >> >>> 1201: @Override >>> 1202: public String readUTF() throws IOException { >>> 1203: return DataInputStream.readUTF(this); >> >> If i

Re: RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll [v2]

2020-12-17 Thread Rémi Forax
On Thu, 17 Dec 2020 10:33:05 GMT, Сергей Цыпанов wrote: >> Hello, I feel like this was previously discussed in >> https://mail.openjdk.java.net/pipermail/core-libs-dev/ but since I cannot >> find original mail I post this here. >> >> Currently `Collections.addAll()` is implemented and documen

Re: RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll

2020-12-17 Thread Rémi Forax
On Thu, 17 Dec 2020 10:15:23 GMT, Сергей Цыпанов wrote: >> Hello, I feel like this was previously discussed in >> https://mail.openjdk.java.net/pipermail/core-libs-dev/ but since I cannot >> find original mail I post this here. >> >> Currently `Collections.addAll()` is implemented and documen

Re: RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll [v2]

2020-12-17 Thread Rémi Forax
On Thu, 17 Dec 2020 10:45:17 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/util/Collections.java line 5589: >> >>> 5587: */ >>> 5588: @SafeVarargs >>> 5589: @SuppressWarnings("varargs") >> >> I don't think you need a SuppressWarnings here > > Hi, without this I ge

Re: RFR: 8193031: Collections.addAll is likely to perform worse than Collection.addAll [v2]

2020-12-17 Thread Rémi Forax
On Thu, 17 Dec 2020 11:03:45 GMT, Сергей Цыпанов wrote: >> ok, it means there is a bug in the compiler, the analysis done for unsafe >> varargs (with -Xlint:varargs) doesn't check that the called method (here >> Arrays.asList()) is tagged with @SafeVarargs. > > Should I then wait for the fix o

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v17]

2021-02-16 Thread Rémi Forax
On Tue, 16 Feb 2021 14:03:56 GMT, Jim Laskey wrote: >> src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java line >> 1548: >> >>> 1546: * @return a stream of (pseudo)randomly chosen {@code int} >>> values >>> 1547: */ >>> 1548: >> >> Is `@Override` intenti

Re: RFR: 8261880: Change nested classes in java.base to static nested classes where possible [v2]

2021-02-17 Thread Rémi Forax
On Wed, 17 Feb 2021 17:24:50 GMT, Claes Redestad wrote: >> For static methods, since in java language you cannot declare static method >> in instance inner classes, I'd say making them static makes more sense >> language-wise. Also making them static reduces compiler synthetic instance >> fiel

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators

2021-02-26 Thread Rémi Forax
On Fri, 26 Feb 2021 13:13:19 GMT, Jim Laskey wrote: >> Stayin' alive > > Looking for some final code reviews. I still don't like the fact that the factory uses reflection but i don't see how to do better - PR: https://git.openjdk.java.net/jdk/pull/1292

Re: RFR: 8263102: Expand documention of Method.isBridge [v3]

2021-03-08 Thread Rémi Forax
On Tue, 9 Mar 2021 03:27:29 GMT, Joe Darcy wrote: >> The existing documentation of Method.isBridge isn't terribly helpful to the >> reader. This RFE proposes to given a common example of how bridge methods >> are used. The JLS does *not* have a section discussing bridge methods in >> detail; b

Re: RFR: 8263102: Expand documention of Method.isBridge [v3]

2021-03-09 Thread Rémi Forax
On Tue, 9 Mar 2021 19:13:24 GMT, Joe Darcy wrote: >> src/java.base/share/classes/java/lang/reflect/Method.java line 589: >> >>> 587: * different return type, the virtual machine does not. >>> 588: * A >>> 589: * common case where covariant overrides are used is for a {@link >> >>

Re: RFR: 8248862: Implement Enhanced Pseudo-Random Number Generators [v3]

2021-03-15 Thread Rémi Forax
On Wed, 18 Nov 2020 13:45:46 GMT, Jim Laskey wrote: >> Need rebase > > Created new PR because of forced push: > https://github.com/openjdk/jdk/pull/1292 LGTM - PR: https://git.openjdk.java.net/jdk/pull/1273

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 09:21:22 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> package to make use of the `instanceof` pattern variable? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 10:18:26 GMT, Pavel Rappo wrote: >> src/java.base/share/classes/java/lang/constant/DynamicConstantDesc.java line >> 360: >> >>> 358: public final boolean equals(Object o) { >>> 359: if (this == o) return true; >>> 360: return (o instanceof DynamicConstant

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 11:01:48 GMT, Pavel Rappo wrote: >> The problem is that `desc` is a raw type and raw types doesn't play well >> with the rest of the language (in particular with inference). >> >> I think it's a bug in javac, it should not even raise a warning but an error. >> But the spec i

Re: RFR: 8263358: Update java.lang to use instanceof pattern variable [v5]

2021-03-15 Thread Rémi Forax
On Mon, 15 Mar 2021 11:39:20 GMT, Jan Lahoda wrote: >> We have considered generics, that why parameterized generics with another >> type arguments are forbidden, but i think we have forgotten raw types. > > I don't think that cast from `Object` to a raw type is unchecked, so as error > does not

Re: RFR: 8263668: Update java.time to use instanceof pattern variable

2021-03-24 Thread Rémi Forax
On Wed, 24 Mar 2021 09:56:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick src/java.base/share/classes/java/time/LocalDateTime.java l

Re: RFR: 8263668: Update java.time to use instanceof pattern variable

2021-03-24 Thread Rémi Forax
On Wed, 24 Mar 2021 09:56:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` > package to make use of the `instanceof` pattern variable? > > Kind regards, > Patrick src/java.base/share/classes/java/time/format/DateTimeForma

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-04-09 Thread Rémi Forax
On Fri, 9 Apr 2021 19:57:10 GMT, Jorn Vernee wrote: >>> yes, for all the switches, pattern-switch, enum-switch but not for the >>> string switch which requires a lookup switch. >> Can you outline how to use the tableswitch combinator in the case of a >> switch on strings ? >> >> Jan Lahoda has

Re: RFR: 8265137: java.util.Random suddenly has new public methods nowhere documented [v2]

2021-04-14 Thread Rémi Forax
On Wed, 14 Apr 2021 12:27:55 GMT, Jim Laskey wrote: >> Move makeXXXSpilterator from public (@hidden) to protected. No API ch > > Jim Laskey has updated the pull request incrementally with one additional > commit since the last revision: > > Make makeXXXSpliterator final I don't see the point

Re: RFR: 8265137: java.util.Random suddenly has new public methods nowhere documented [v6]

2021-04-22 Thread Rémi Forax
On Wed, 21 Apr 2021 13:13:16 GMT, Jim Laskey wrote: >> Move makeXXXSpilterator from public (@hidden) to protected. No API ch > > Jim Laskey 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

Re: RFR: 8264777: Overload optimized FileInputStream::readAllBytes [v2]

2021-05-05 Thread Rémi Forax
On Wed, 5 May 2021 06:50:17 GMT, Vladimir Sitnikov wrote: >> Brian Burkhalter has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8264777: Handle cases where length() returns zero > > src/java.base/share/classes/java/io/FileInputStream.java

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

2021-05-11 Thread Rémi Forax
On Tue, 4 May 2021 16:41:44 GMT, Jan Lahoda wrote: > 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/j

Re: RFR: 8263087: Add a MethodHandle combinator that switches over a set of MethodHandles

2021-05-12 Thread Rémi Forax
On Thu, 8 Apr 2021 18:51:21 GMT, Jorn Vernee wrote: > This patch adds a `tableSwitch` combinator that can be used to switch over a > set of method handles given an index, with a fallback in case the index is > out of bounds, much like the `tableswitch` bytecode. Here is a description of > how

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

2021-05-13 Thread Rémi Forax
On Tue, 4 May 2021 16:41:44 GMT, Jan Lahoda wrote: > 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/j

Re: RFR: 8266846: Add java.time.InstantSource

2021-05-17 Thread Rémi Forax
On Mon, 17 May 2021 07:31:45 GMT, Stephen Colebourne wrote: >> src/java.base/share/classes/java/time/InstantSource.java line 93: >> >>> 91: * @since 17 >>> 92: */ >>> 93: public interface InstantSource { >> >> Should not we add `@FunctionalInterface`? I can easily imagine this >> interface

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

2021-05-17 Thread Rémi Forax
On Mon, 17 May 2021 19:04:11 GMT, Jan Lahoda wrote: >> 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/j

Re: RFR: 8266846: Add java.time.InstantSource [v3]

2021-05-19 Thread Rémi Forax
On Tue, 18 May 2021 23:18:42 GMT, Stephen Colebourne wrote: >> 8266846: Add java.time.InstantSource > > Stephen Colebourne has updated the pull request incrementally with one > additional commit since the last revision: > > 8266846: Add java.time.InstantSource It's a side effect of JEP 403,

Re: RFR: 8266846: Add java.time.InstantSource [v3]

2021-05-19 Thread Rémi Forax
On Tue, 18 May 2021 23:18:42 GMT, Stephen Colebourne wrote: >> 8266846: Add java.time.InstantSource > > Stephen Colebourne has updated the pull request incrementally with one > additional commit since the last revision: > > 8266846: Add java.time.InstantSource my bad - PR: htt

Re: RFR: 8191441: (Process) add Readers and Writer access to java.lang.Process streams

2021-05-20 Thread Rémi Forax
On Thu, 20 May 2021 19:57:22 GMT, Roger Riggs wrote: > Methods are added to java.lang.Process to read and write characters and lines > from and to a spawned Process. > The Charset used to encode and decode characters to bytes can be specified or > use the > operating system native encoding as i

Re: RFR: 8191441: (Process) add Readers and Writer access to java.lang.Process streams

2021-05-21 Thread Rémi Forax
On Thu, 20 May 2021 20:37:57 GMT, Roger Riggs wrote: > OutputStreamWriter would be a better choice with that in mind. It does not > have the convenience methods for converting various types to strings but > would not hide the exceptions. Developers could wrap it in a PrintWriter to > get the c

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

2021-05-25 Thread Rémi Forax
On Tue, 25 May 2021 12:20:02 GMT, Jan Lahoda wrote: > Thanks Evgeny, I'll take a look. > > @forax, do you mean why there is "0" in: > 11: invokedynamic #13, 0 > ? Not this one, the one on the stack. 7: iconst_0 < this zero 8: istore_3 9: aload_2 10: iload_3 11: invokedynamic #13, 0 // In

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

2021-05-25 Thread Rémi Forax
On Tue, 25 May 2021 14:22:57 GMT, Jan Lahoda wrote: > The reason for this integer (which is not a constant in the case of this > switch) is to restart the matching in case guards fail to "match". > Considering the example here: > > ``` > class Example { > void example(Object o) { >

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

2021-05-26 Thread Rémi Forax
On Tue, 25 May 2021 16:14:56 GMT, Jan Lahoda wrote: > I'd like to note this is a preview feature - we can change the desugaring. At > the same time, I don't think this does not work with sub-patterns (those can > be easily desugared to guards, I think). Yes, but in that case the classcheck du

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

2021-05-27 Thread Rémi Forax
On Wed, 26 May 2021 17:52:36 GMT, Jan Lahoda wrote: >> 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/j

Re: RFR: 8199318: add idempotent copy operation for Map.Entry

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 00:39:25 GMT, Stuart Marks wrote: > I'm fixing this along with a couple intertwined issues. > > 1. Add Map.Entry::copyOf as an idempotent copy operation. > > 2. Clarify that AbstractMap.SimpleImmutableEntry is itself unmodifiable (not > really immutable) but that subclasses

Re: RFR: 8268124: Update java.lang to use switch expressions

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator

Re: RFR: 8268124: Update java.lang to use switch expressions

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/MemberName.java line 331

Re: RFR: 8268124: Update java.lang to use switch expressions

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java

Re: RFR: 8268124: Update java.lang to use switch expressions

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` > packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line

Re: RFR: 8199318: add idempotent copy operation for Map.Entry

2021-06-02 Thread Rémi Forax
On Wed, 2 Jun 2021 17:12:21 GMT, Stuart Marks wrote: > A quick search reveals that Guava has a public subclass of > SimpleImmutableEntry: > https://guava.dev/releases/30.1.1-jre/api/docs/com/google/common/cache/RemovalNotification.html >There are possibly others. It doesn't seem worth the incom

Re: RFR: 8268124: Update java.lang to use switch expressions [v3]

2021-06-03 Thread Rémi Forax
On Thu, 3 Jun 2021 10:57:16 GMT, Patrick Concannon wrote: > My mistake. I've replaced the colon now with the lambda operator. Drive by comment, in term of name, `->` is the arrow operator not the lambda operator. - lambda = parameters + arrow + code - arrow case = case + arrow + code The dif

Re: RFR: 8268124: Update java.lang to use switch expressions [v3]

2021-06-03 Thread Rémi Forax
On Thu, 3 Jun 2021 11:01:02 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` >> packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementall

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

2021-06-05 Thread Rémi Forax
On Fri, 4 Jun 2021 20:20:26 GMT, Jan Lahoda wrote: >> 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/je

Re: [jdk17] RFR: 8268766: Desugaring of pattern matching enum switch should be improved [v2]

2021-06-17 Thread Rémi Forax
On Thu, 17 Jun 2021 18:33:56 GMT, Jan Lahoda wrote: >> Currently, an enum switch with patterns is desugared in a very non-standard, >> and potentially slow, way. It would be better to use the standard >> `typeSwitch` bootstrap to classify the enum constants. The bootstrap needs >> to accept en

Re: [jdk17] RFR: 8268766: Desugaring of pattern matching enum switch should be improved [v2]

2021-06-18 Thread Rémi Forax
On Fri, 18 Jun 2021 09:08:04 GMT, Jan Lahoda wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 222: >> >>> 220: String invocationName, >>> 221: MethodType invocationType, >>> 222:

Re: RFR: 6506405: Math.abs(float) is slow

2021-07-07 Thread Rémi Forax
On Wed, 7 Jul 2021 20:28:37 GMT, Brian Burkhalter wrote: > Please consider this change to make the `float` and `double` versions of > `java.lang.Math.abs()` branch-free. Your patch change the semantics, actually `Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE` with your patch `Math.abs(In

Re: RFR: 6506405: Math.abs(float) is slow

2021-07-07 Thread Rémi Forax
On Wed, 7 Jul 2021 22:22:45 GMT, Joe Darcy wrote: > > > Your patch change the semantics, actually > > `Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE` > > with your patch > > `Math.abs(Integer.MIN_VALUE) == Integer.MAX_VALUE` > > Does it? The overriding of int arguments shouldn't be affected.

Re: RFR: 8270321: Startup regressions in 18-b5 caused by JDK-8266310

2021-07-23 Thread Rémi Forax
On Fri, 23 Jul 2021 18:03:31 GMT, Sergey Chernyshev wrote: > Dear colleagues, > > Please review the patch that replaces the lambdas with anonymous classes > which solves the startup time regression as shown below. > > I attached the Bytestacks flamegraphs for both original (regression) and >

Re: RFR: 8270321: Startup regressions in 18-b5 caused by JDK-8266310

2021-07-26 Thread Rémi Forax
On Fri, 23 Jul 2021 18:03:31 GMT, Sergey Chernyshev wrote: > Dear colleagues, > > Please review the patch that replaces the lambdas with anonymous classes > which solves the startup time regression as shown below. > > I attached the Bytestacks flamegraphs for both original (regression) and >

Re: RFR: 8272137: Make Iterable classes streamable

2021-08-14 Thread Rémi Forax
On Mon, 9 Aug 2021 12:28:23 GMT, CC007 wrote: > create Streamable and ParallelStreamable interface and use them in Collection > and Optional Hi Rick, I do not think that such interfaces are a good addition to the JDK, we do not want to promote the fact that you can create a Stream from an Ite

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Rémi Forax
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP 41

Re: RFR: 8274299: Make Method/Constructor/Field accessors @Stable [v4]

2021-10-04 Thread Rémi Forax
On Mon, 4 Oct 2021 15:49:43 GMT, Peter Levart wrote: >> This patch improves reflective access speed as shown by the included >> benchmarks: >> >> https://jmh.morethan.io/?gists=902f4b43519c4f96c7abcd14cdc2d27d,ac490481e3001c710d75d6071c10b23a >> >> ... and is also a prerequisite to make JEP 41

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

2021-10-13 Thread Rémi Forax
On Thu, 14 Oct 2021 00:54:57 GMT, Mandy Chung wrote: >> src/java.base/share/classes/jdk/internal/reflect/MethodHandleAccessorFactory.java >> line 151: >> >>> 149: var setter = isReadOnly ? null : >>> JLIA.unreflectField(field, true); >>> 150: Class type = field.getType(

Re: RFR: 8261847: performace of java.lang.Record::toString should be improved

2021-11-16 Thread Rémi Forax
On Tue, 16 Nov 2021 13:03:35 GMT, Jim Laskey wrote: >> (I'm not reviewer.) >> >> I think `.toArray(Class[]::new)` should be better here. `.toList` seems >> unnecessary. > > Class[] types = Stream.of(getters) > .map(g -> g.type().returnType()) > .toArray(Class[]::

Re: RFR: JDK-8280168: Add Objects.toIdentityString [v7]

2022-01-24 Thread Rémi Forax
On Mon, 24 Jan 2022 21:31:37 GMT, Joe Darcy wrote: >> While it is strongly recommend to not use the default toString for a class, >> at times it is the least-bad alternative. When that alternative needs to be >> used, it would be helpful to have the implementation already available, such >> as

Re: RFR: JDK-8281766: Update java.lang.reflect.Parameter to implement Member

2022-02-15 Thread Rémi Forax
On Tue, 15 Feb 2022 01:13:43 GMT, Joe Darcy wrote: > Retrofitting of Parameter to implement Member, an interface already > implemented by similar reflective modeling classes. > > Since Parameter is final, there is little compatibility impact from adding a > new method. > > Please also review

Re: RFR: 8283237: CallSite should be a sealed class

2022-03-16 Thread Rémi Forax
On Wed, 16 Mar 2022 13:09:30 GMT, liach wrote: > Change `CallSite` to a sealed class, as `CallSite` is an abstract class which > does not allow direct subclassing by users per its documentation. Since I > don't have a JBS account, I posted the content for the CSR in a GitHub Gist > at https://

Re: RFR: 8283237: CallSite should be a sealed class

2022-03-17 Thread Rémi Forax
On Thu, 17 Mar 2022 07:32:40 GMT, liach wrote: >> src/java.base/share/classes/java/lang/invoke/CallSite.java line 88: >> >>> 86: */ >>> 87: public >>> 88: abstract sealed class CallSite permits ConstantCallSite, >>> VolatileCallSite, MutableCallSite { >> >> Nitpicking with my JSR 292 hat, >>

Re: RFR: JDK-8282798 java.lang.runtime.Carrier [v10]

2022-03-20 Thread Rémi Forax
On Mon, 21 Mar 2022 05:17:31 GMT, ExE Boss wrote: >> Jim Laskey has updated the pull request incrementally with three additional >> commits since the last revision: >> >> - Typos >> - Update Carrier.java >> - Redo API to use list, bring Carrier.component back > > src/java.base/share/classes/

Re: RFR: JDK-8283416: Update java.lang.invoke.MethodHandle to use sealed classes

2022-03-21 Thread Rémi Forax
On Tue, 22 Mar 2022 04:38:15 GMT, ExE Boss wrote: > javac should be changed to allow fully qualified access to private inner > classes in the permits clause of an enclosing class. This is not how private works, private means accessible between the '{' and the '}' of the class. The permits clau

Re: RFR: 8282508: Updating ASM to 9.2 for JDK 19

2022-03-28 Thread Rémi Forax
On Mon, 28 Mar 2022 16:49:58 GMT, Vicente Romero wrote: > Please review this PR which is updating the ASM included in the JDK to ASM > 9.2. This version should be included in JDK19. There are basically two > commits here, one that was automatically generated and that mostly changes > file head

Re: RFR: 8277090 : jsr166 refresh for jdk19

2022-05-01 Thread Rémi Forax
On Sun, 1 May 2022 10:53:55 GMT, Doug Lea wrote: > This is the jsr166 refresh for jdk19. See > https://bugs.openjdk.java.net/browse/JDK-8285450 and > https://bugs.openjdk.java.net/browse/JDK-8277090 src/java.base/share/classes/java/util/concurrent/ExecutorService.java line 138: > 136: * @aut

Re: RFR: 8277090 : jsr166 refresh for jdk19

2022-05-02 Thread Rémi Forax
On Mon, 2 May 2022 10:23:01 GMT, Doug Lea wrote: >> src/java.base/share/classes/java/util/concurrent/ExecutorService.java line >> 138: >> >>> 136: * @author Doug Lea >>> 137: */ >>> 138: public interface ExecutorService extends Executor, AutoCloseable { >> >> The class documentation should b

Re: RFR: 8277090 : jsr166 refresh for jdk19 [v2]

2022-05-03 Thread Rémi Forax
On Mon, 2 May 2022 23:54:33 GMT, Doug Lea wrote: >> src/java.base/share/classes/java/util/concurrent/FutureTask.java line 222: >> >>> 220: throw new IllegalStateException("Task has not >>> completed"); >>> 221: } >>> 222: } >> >> I think the code will be more readab

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40:41 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But, there is one more commit which

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40:41 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But, there is one more commit which

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40:41 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But, there is one more commit which

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-16 Thread Rémi Forax
On Mon, 16 May 2022 17:40:41 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But, there is one more commit which

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Rémi Forax
On Tue, 17 May 2022 08:16:32 GMT, Maurizio Cimadamore wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/BindingSpecializer.java >> line 98: >> >>> 96: private static final String CLASS_DATA_DESC = >>> methodType(Object.class, MethodHandles.Lookup.class, String.class, >>> Cla

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v3]

2022-05-17 Thread Rémi Forax
On Tue, 17 May 2022 11:57:01 GMT, Jorn Vernee wrote: >> src/java.base/share/classes/jdk/internal/foreign/abi/SoftReferenceCache.java >> line 42: >> >>> 40: >>> 41: private class Node { >>> 42: private SoftReference ref; >> >> this code looks like a double check locking so ref shou

Re: RFR: 8286669: Replace MethodHandle specialization with ASM in mainline [v5]

2022-05-18 Thread Rémi Forax
On Wed, 18 May 2022 11:27:24 GMT, Jorn Vernee wrote: >> Hi, >> >> This PR brings over commits from the panama-foreign repo. These commits >> mostly pertain to the switch to ASM and away from MethodHandle combinators >> for the binding recipe specialization. But, there is one more commit which

Re: RFR: 8262889: Compiler implementation for Record Patterns [v7]

2022-05-25 Thread Rémi Forax
On Wed, 25 May 2022 04:20:35 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v20]

2022-05-31 Thread Rémi Forax
On Wed, 25 May 2022 00:35:24 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >> dis

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v4]

2022-05-31 Thread Rémi Forax
On Tue, 15 Feb 2022 21:05:08 GMT, Joe Darcy wrote: >> Note that the presence or absence of `ACC_SUPER` has no effect since **Java  >> 8**, which always treats it as set regardless of the actual contents of the  >> binary class file. > > For completeness, I think including SUPER is reasonable, eve

Re: RFR: JDK-8266670: Better modeling of access flags in core reflection [v20]

2022-05-31 Thread Rémi Forax
On Wed, 25 May 2022 00:35:24 GMT, Joe Darcy wrote: >> This is an early review of changes to better model JVM access flags, that is >> "modifiers" like public, protected, etc. but explicitly at a VM level. >> >> Language level modifiers and JVM level access flags are closely related, but >> dis

  1   2   3   4   5   >