Re: RFR: 8287522: StringConcatFactory: Add in prependers and mixers in batches [v7]

2022-06-03 Thread Remi Forax
- Original Message - > From: "Claes Redestad" > To: "core-libs-dev" > Sent: Friday, June 3, 2022 2:19:34 PM > Subject: Re: RFR: 8287522: StringConcatFactory: Add in prependers and mixers > in batches [v7] > On Fri, 3 Jun 2022 11:19:04 GMT, ExE Boss wrote: > >>> You would think that,

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 >>

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,

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 >>

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: >>

Re: Stream.fromForEach(Consumer>)

2022-05-23 Thread forax
- Original Message - > From: "Tagir Valeev" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Monday, May 23, 2022 8:01:44 AM > Subject: Re: Stream.fromForEach(Consumer>) > Hello! > > There's a Stream.builder for this purpose:

Stream.fromForEach(Consumer>)

2022-05-21 Thread Remi Forax
Hi all, a stream is kind of push iterator so it can be created from any object that has a method like forEach(Consumer), but sadly there is no static method to create a Stream from a Consumer of Consumer so people usually miss that creating a Stream from events pushed to a consumer is easy. By

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: 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

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, >>>

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

2022-05-17 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 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 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

2022-05-12 Thread Remi Forax
Ok, let us know when it's out of draft, i've several minor modifications about the code. regards, Rémi - Original Message - > From: "Jorn Vernee" > To: "core-libs-dev" , "hotspot-dev" > > Sent: Thursday, May 12, 2022 11:25:52 PM > Subject: Re: RFR: 8286669: Replace MethodHandle

Re: HttpClient has no explicit way of releasing threads

2022-05-10 Thread Remi Forax
- Original Message - > From: "Rafael Winterhalter" > To: "core-libs-dev" > Sent: Monday, May 9, 2022 11:43:49 PM > Subject: HttpClient has no explicit way of releasing threads > Hello, Hello, > > looking at thread dumps, I realized that the HttpClient implementation does > not offer

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

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

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: *

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-19 Thread Remi Forax
- Original Message - > From: "liach" > To: "core-libs-dev" , "security-dev" > > Sent: Tuesday, April 19, 2022 3:31:24 AM > Subject: Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes > On Mon, 18 Apr 2022 20:42:48 G

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread Remi Forax
ince this change is somewhat large, should we keep the old >> proxy >> generator as well and have it toggled through a command-line flag (like the >> old >> v49 proxy generator or the old reflection implementation)? >> >> Please feel free to comment or review. Th

Re: RFR: JDK-8242888: Convert dynamic proxy to hidden classes

2022-04-18 Thread Remi Forax
possible - for example > spinning a record at runtime. > But this leads to the question - how can one migrate away from > serialized proxies in a compatible way? > > In the end - a lot of stuff in the JDK depends on Proxies, and their > limitations now begins to surface. > > A new API may not be a bad idea. :) Yes ! And we can leverage invokedynamic/method handles to avoid boxing/ bad perf. The idea is that first time an implementation of an abstract method is required, an object (implementing an interface similar to InvocationHandler) acting as a bootstrap method is called to provide a method handle that will be used as implementation. see https://github.com/forax/hidden_proxy for a prototype of that idea. > > - Johannes Rémi

Re: fast way to infer caller

2022-04-07 Thread forax
> From: "Kasper Nielsen" > To: "Remi Forax" > Cc: "Ceki Gülcü" , "core-libs-dev" > > Sent: Thursday, April 7, 2022 2:42:46 PM > Subject: Re: fast way to infer caller > On Thu, 7 Apr 2022 at 13:33, Remi Forax < [ mailto:fo...

Re: fast way to infer caller

2022-04-07 Thread Remi Forax
- Original Message - > From: "Kasper Nielsen" > To: "Ceki Gülcü" > Cc: "core-libs-dev" > Sent: Thursday, April 7, 2022 1:53:33 PM > Subject: Re: fast way to infer caller >> >> MethodHandles.lookup().lookupClass() looks very promising except that >> there is no way to specify the depth.

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
er() must be exceptionally good, assuming we >> wish to avoid having the user accidentally shooting herself on the foot, >> ergo the 100 nanosecond performance per call requirement. >> >> Noting that invoking MethodHandles.lookup().lookupClass() seems very >> fast (about 2 na

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
read (even when the logger is de-activated) which destroy performance in tight loop (you loose hoisting). I believe that if your users are fine with that, they are also fine with a call to LoggerFactory.getLogger() being a little slow. > > -- > Ceki Gülcü Rémi > > > On 4/6/2022 5:5

Re: fast way to infer caller

2022-04-06 Thread Remi Forax
- Original Message - > From: "Ceki Gülcü" > To: "core-libs-dev" > Sent: Wednesday, April 6, 2022 5:30:51 PM > Subject: fast way to infer caller > Hello, Hello, > > As you are probably aware, one of the important primitives used in > logging libraries is inferring the caller of a

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

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

2022-03-22 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

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

2022-03-21 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 > >

Re: When to initialize the method's class for MethodHandles.Lookup.findStatic()?

2022-03-17 Thread Remi Forax
- Original Message - > From: "Cheng Jin" > To: "core-libs-dev" > Sent: Thursday, March 17, 2022 5:42:57 PM > Subject: When to initialize the method's class for > MethodHandles.Lookup.findStatic()? > Hi there, > > The document of >

Re: Making enum hashcodes consistent across JVM's

2022-03-17 Thread Remi Forax
- Original Message - > From: "dfranken jdk" > To: "core-libs-dev" > Sent: Thursday, March 17, 2022 1:49:08 PM > Subject: Making enum hashcodes consistent across JVM's > Dear all, > > Currently enums do not have a well-defined hashCode() implementation so > they defer to

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: 8283237: CallSite should be a sealed class

2022-03-17 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

Re: Behavior change in the jar tool JDK11 vs JDK8.

2022-03-14 Thread Remi Forax
- Original Message - > From: "Pasam Soujanya1" > To: "core-libs-dev" > Sent: Monday, March 14, 2022 12:48:42 PM > Subject: Behavior change in the jar tool JDK11 vs JDK8. > There is a significant difference in the way the JAR tool (starting JDK11) > seems > to be responding to target

Re: Questions about enhancement and Correction to Java OpenJDK Floating Point?

2022-03-14 Thread Remi Forax
- Original Message - > From: "A Z" > To: "core-libs-dev" > Sent: Monday, March 14, 2022 7:49:04 AM > Subject: Questions about enhancement and Correction to Java OpenJDK Floating > Point? Hi Terry, if you want to have the same output as C, instead of println() use printf(). In your

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread forax
- Original Message - > From: "Brian Goetz" > To: "Remi Forax" > Cc: "Jim Laskey" , "core-libs-dev" > > Sent: Tuesday, March 8, 2022 4:37:41 PM > Subject: Re: RFR: JDK-8282798 java.lang.runtime.Carrier > You keep sayin

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
s`. > > I'm slightly surprised the MH factories are not factored through a metaobject > of > the form > > record CarrierBinding( >MethodType methodType, >MethodHandle constructor, >List> componentTypes, >List components) > { … } Yes, i've done something

Re: RFR: JDK-8282798 java.lang.runtime.Carrier

2022-03-08 Thread Remi Forax
Hi Jim, I believe that there is a mismatch about what is needed for the pattern matching and the API you propose. The Carrier API allows to map one tuple of types to one storage representation based on ints, longs and references. But what we need is to have several shapes for the same storage,

Re: Replace simple iterations of Map.entrySet with Map.forEach calls

2022-03-05 Thread Remi Forax
- Original Message - > From: "Stuart Marks" > To: "-" , "core-libs-dev" > > Sent: Saturday, March 5, 2022 1:58:30 AM > Subject: Re: Replace simple iterations of Map.entrySet with Map.forEach calls > Hi, I have to say I'm pretty skeptical of this change overall. > > It sounds like the

Re: RFR: 8282143: Objects.requireNonNull should be ForceInline

2022-02-28 Thread Remi Forax
- Original Message - > From: "Paul Sandoz" > To: "core-libs-dev" > Sent: Tuesday, March 1, 2022 1:48:02 AM > Subject: Re: RFR: 8282143: Objects.requireNonNull should be ForceInline > On Sat, 19 Feb 2022 05:51:52 GMT, Quan Anh Mai wrote: > >> Hi, >> >> `Objects.requireNonNull` may

Re: Should System.exit be controlled by a Scope Local?

2022-02-27 Thread Remi Forax
Hi Ethan, there is a far simpler solution, call org.apache.ivy.run(args, true) instead of org.apache.ivy.main(args) in your tool provider. regards, Rémi - Original Message - > From: "Ethan McCue" > To: "core-libs-dev" > Sent: Saturday, February 26, 2022 11:14:19 PM > Subject: Should

Re: [External] : Sequenced Collections

2022-02-18 Thread forax
- Original Message - > From: "Stuart Marks" > To: "Remi Forax" > Cc: "core-libs-dev" , "Tagir Valeev" > > Sent: Tuesday, February 15, 2022 6:06:54 AM > Subject: Re: [External] : Sequenced Collections >> Here is

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: [External] : Sequenced Collections

2022-02-13 Thread forax
> From: "Tagir Valeev" > To: "Stuart Marks" > Cc: "Remi Forax" , "core-libs-dev" > > Sent: Saturday, February 12, 2022 4:24:24 AM > Subject: Re: [External] : Sequenced Collections > Wow, I missed that the Sequenced Coll

Re: [External] : Sequenced Collections

2022-02-11 Thread forax
- Original Message - > From: "Stuart Marks" > To: "Remi Forax" > Cc: "core-libs-dev" > Sent: Friday, February 11, 2022 8:25:19 PM > Subject: Re: [External] : Sequenced Collections > Hi Rémi, > > I see that you're trying to re

Sequenced Collections

2022-02-10 Thread Remi Forax
I've read the draft of the JEP on sequenced collection, and i think the proposed design can be improved. https://bugs.openjdk.java.net/browse/JDK-8280836 I agree with the motivation, there is a need for an API to consider the element of a list, a sorted set and a linked hash set as an ordered

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 >>

Re: Thread.dispatchUncaughtException possible NPE?

2022-01-17 Thread Remi Forax
- Original Message - > From: "Andrey Turbanov" > To: "core-libs-dev" > Sent: Monday, January 17, 2022 10:37:04 AM > Subject: Thread.dispatchUncaughtException possible NPE? > Hello. Hello Andrey, > I see that Thread.dispatchUncaughtException calls > getUncaughtExceptionHandler() which

Re: LambdaMetafactory requires full privilege access, but doesn't seem to actually restrict functionality

2022-01-13 Thread Remi Forax
- Original Message - > From: "Steven Schlansker" > To: "core-libs-dev" > Sent: Wednesday, January 12, 2022 9:56:30 PM > Subject: LambdaMetafactory requires full privilege access, but doesn't seem > to actually restrict functionality > Hi core-libs-dev, > > I am maintaining a module

Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger [v3]

2021-11-18 Thread Remi Forax
- Original Message - > From: "Bernd Eckenfels" > To: "core-libs-dev" > Sent: Jeudi 18 Novembre 2021 12:07:19 > Subject: Re: RFR: JDK-8277175 : Add a parallel multiply method to BigInteger > [v3] > What about a new API multiply method which takes an forkjoinpool, and only if > that is

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()) >

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-16 Thread Remi Forax
- Original Message - > From: "Glavo" > To: "Tagir F.Valeev" > Cc: "core-libs-dev" > Sent: Samedi 16 Octobre 2021 06:25:40 > Subject: Re: RFR: 8274412: Add a method to Stream API to consume and close > the stream without using try-with-resources > I don't think it is a perfect

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

2021-10-14 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 =

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-11 Thread Remi Forax
I agree with the idea of a try() syntax, but i don't think we need more interfaces. Yes, John is right about the fact that the TWR Aucloseable does not work well with checked exceptions, but the issue is more that there is nothing that works well with checked exceptions because Java has no way

Re: RFR: 8274412: Add a method to Stream API to consume and close the stream without using try-with-resources

2021-10-09 Thread Remi Forax
- Original Message - > From: "Tagir F.Valeev" > To: "core-libs-dev" > Sent: Lundi 4 Octobre 2021 08:51:55 > Subject: RFR: 8274412: Add a method to Stream API to consume and close the > stream without using try-with-resources > Currently, when the stream holds a resource, it's

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

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

Re: Discussion: easier Stream closing

2021-10-02 Thread Remi Forax
At that point, the real question is why not call close() at the end of all terminal operations by wrapping each implementation in a try-with-resources ? Rémi - Original Message - > From: "Brian Goetz" > To: "Tagir Valeev" , "core-libs-dev" > > Sent: Lundi 27 Septembre 2021 22:41:00 >

Re: Discussion: easier Stream closing

2021-09-26 Thread Remi Forax
- Original Message - > From: "Tagir Valeev" > To: "core-libs-dev" > Sent: Dimanche 26 Septembre 2021 11:27:58 > Subject: Discussion: easier Stream closing > Hello! > > With current NIO file API, a very simple problem to get the list of > all files in the directory requires some

Re: StringBuilder OOMs earlier with JRE 11 compared to JRE 8

2021-08-27 Thread Remi Forax
- Original Message - > From: "David Holmes" > To: "S" , "core-libs-dev" > > Cc: "Andrey Loskutov" > Sent: Vendredi 27 Août 2021 15:25:25 > Subject: Re: StringBuilder OOMs earlier with JRE 11 compared to JRE 8 > Hi Simeon, > > Redirecting this to core-libs-dev as it is not a

Re: Implementing MethodHandleProxies#asInterfaceInstance with hidden classes

2021-08-25 Thread Remi Forax
- Original Message - > From: "-" > To: "Brian Goetz" , "core-libs-dev" > > Sent: Lundi 23 Août 2021 08:34:17 > Subject: Re: Implementing MethodHandleProxies#asInterfaceInstance with hidden > classes > Thanks for the quick reply! > > The main drawback, API wise, with LMF is that it

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

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: 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: 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

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

Re: [jdk17] RFR: 8269096: Add java.util.Objects.newIdentity method [v5]

2021-06-29 Thread Remi Forax
- Original Message - > From: "Roger Riggs" > To: "core-libs-dev" > Sent: Mardi 29 Juin 2021 18:44:04 > Subject: Re: [jdk17] RFR: 8269096: Add java.util.Objects.newIdentity method > [v5] > On Tue, 29 Jun 2021 05:47:03 GMT, Tagir F. Valeev wrote: > >>> Roger Riggs has updated the pull

Release of ASM 9.2

2021-06-26 Thread Remi Forax
Hi everybody, we are happy to announce the release of ASM 9.2 which support Java 18 (available via Maven Central). I still hope to find the time this summer to work of the support of Valhalla new bytecodes. Rémi

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: [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

Re: JEP 411: Deprecation with removal would break most existing Java libraries

2021-06-13 Thread Remi Forax
- Mail original - > De: "Rafael Winterhalter" > À: "core-libs-dev" > Envoyé: Dimanche 13 Juin 2021 22:28:33 > Objet: JEP 411: Deprecation with removal would break most existing Java > libraries > I am currently looking into how I should address JEP 411 in my library Byte > Buddy and I

Re: case null vs case dominance

2021-06-07 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" , "core-libs-dev" > > Cc: "amber-spec-experts" > Envoyé: Lundi 7 Juin 2021 17:06:20 > Objet: Re: case null vs case dominance > On 6/7/2021 5:51 AM, Remi Forax wrot

javac throws an AssertionError while compiling a switch on types

2021-06-07 Thread Remi Forax
Hi all, javac does like this code, there is a check missing because javac should not reach Gen with a code like this. Object o = null; var value = switch(o) { default -> 0; case String s -> 0; }; System.out.println(value); An exception has occurred in the

case null vs case dominance

2021-06-07 Thread Remi Forax
Hi all, the first part of the message is about javac error message that could be improved, the second part is about the current spec being not very logical. With this code Object o = null; var value = switch(o) { //case null -> 0; case Object __ -> 0; case

Pattern matching, not informative error message when the binding name is missing

2021-06-07 Thread Remi Forax
Hi all, with this code sealed interface Vehicle {} record Car(String owner, String color) implements Vehicle {} record Bus(String owner) implements Vehicle {} public static void example3() { var vehicles = List.of( new Car("Bob", "red"), new Bus("Ana") ); var

Pattern matching - exhaustiveness is botched

2021-06-07 Thread Remi Forax
I don't know if you know but using the latest version of the source, this code does not compile. sealed interface Vehicle {} record Car(String owner, String color) implements Vehicle {} record Bus(String owner) implements Vehicle {} public static void example2() { var vehicles =

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: >>

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

2021-06-03 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Peter Levart" , "Rémi Forax" > , "core-libs-dev" > Envoyé: Vendredi 4 Juin 2021 02:05:41 > Objet: Re: [External] : Re: RFR: 8199318: add idempotent copy operation for > Map.Entry

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

2021-06-03 Thread forax
> De: "John Rose" > À: "Remi Forax" < fo...@univ-mlv.fr > > Cc: "Peter Levart" < peter.lev...@gmail.com >, "Rémi Forax" < > fo...@openjdk.java.net >, "core-libs-dev" < core-libs-dev@openjdk.java.net > > En

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

2021-06-03 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Peter Levart" , "Rémi Forax" > , "core-libs-dev" > Envoyé: Jeudi 3 Juin 2021 22:51:28 > Objet: Re: RFR: 8199318: add idempotent copy operation for Map.Entry > On Jun 3, 2021, at

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

2021-06-03 Thread Remi Forax
- Mail original - > De: "Peter Levart" > À: "Rémi Forax" , "core-libs-dev" > > Envoyé: Jeudi 3 Juin 2021 20:49:05 > Objet: Re: RFR: 8199318: add idempotent copy operation for Map.Entry > On 02/06/2021 19:24, Rémi Forax wrote: >>

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

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

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

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

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

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

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

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: 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: >>

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) [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-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: iloa

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

2021-05-25 Thread Remi Forax
s own little twist >>> attached to it. It would be nice, I think (maybe in a separate cleanup?) if >>> the >>> code paths serving the different switch kinds could be made more separate, >>> so >>> that, when reading the code we can worry only about one po

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

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

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:

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

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: >>

  1   2   3   4   5   6   7   8   9   10   >