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

2024-05-26 Thread ExE Boss
On Thu, 23 May 2024 03:28:30 GMT, Chen Liang wrote: > Please review this change that convert dynamic proxies implementations to > hidden classes, intended to target JDK 24. > > Summary: > 1. Adds new implementation while preserving the old implementation behind > `-Djdk.reflect.useLegacyProxyI

Re: RFR: 8333377: Migrate Generic Signature parsing to ClassFile API

2024-05-31 Thread ExE Boss
On Fri, 17 May 2024 12:01:23 GMT, Chen Liang wrote: > Core reflection's generic signature parsing uses an ancient library with > outdated visitor pattern on a tree model and contains unnecessary > boilerplates. This is a duplication of ClassFile API's signature model. We > should just move to

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread ExE Boss
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v14]

2024-06-05 Thread ExE Boss
On Wed, 5 Jun 2024 17:32:14 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.com/openjdk/jdk/pull/12945 >> >> Any comm

Re: RFR: 8333265: De-duplicate method references in java.util.stream.FindOps

2024-06-06 Thread ExE Boss
On Thu, 30 May 2024 12:50:36 GMT, Claes Redestad wrote: > Extracting duplicate method references to static field reduce proxy class > spinning and loading. In this case 2 less classes loaded when using > `findAny()` on each type of stream. The intermediate `Predicate`s and `Supplier`s don’t ne

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v3]

2024-06-07 Thread ExE Boss
On Thu, 6 Jun 2024 21:44:59 GMT, Chen Liang wrote: >> In java.base, especially in bytecode generators, we have many different >> methods converting known valid Class and MethodType into ClassDesc and >> MethodTypeDesc. These conversions should be consolidated into the same >> utility method fo

Re: RFR: 8333749: Consolidate ConstantDesc conversion in java.base [v6]

2024-06-07 Thread ExE Boss
>> utility method for the ease of future maintenance. > > Chen Liang has updated the pull request incrementally with one additional > commit since the last revision: > > ExE-Boss review, go through validated path in Class `ClassDesc​::of​(String)`, `ClassDesc​

Re: RFR: 8333793: Improve BootstrapMethodInvoker for ConstantBootstraps and ProxyGenerator

2024-06-07 Thread ExE Boss
On Fri, 7 Jun 2024 13:45:42 GMT, Chen Liang wrote: >> This PR refactors type matching in BootstrapMethodInvoker and adds a few >> types, seeking to improve bootstrap overheads of some ConstantBootstraps and >> in particular the ProxyGenerator condys generated for e.g. annotation >> proxies sin

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v18]

2024-06-12 Thread ExE Boss
On Thu, 6 Jun 2024 13:24:06 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - reverted static initialization of ConstantPoolBuilder and CP entries >> - fixed naming conventions > > src/java.base/sha

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v21]

2024-06-18 Thread ExE Boss
On Tue, 18 Jun 2024 13:22:45 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.com/openjdk/jdk/pull/12945 >> >> Any com

Re: RFR: 8307818: Convert Indify tool to Classfile API [v11]

2024-06-19 Thread ExE Boss
On Wed, 19 Jun 2024 12:04:27 GMT, Oussama Louati wrote: >> An indify tool in j.l.i tests (also in vmTestBase) convert some source-code >> private static methods with MT_ MH_, and INDY_ prefixes into MethodHandle, >> MethodType, and CallSite constants. >> It currently uses ad-hoc code to process

Re: RFR: 8291966: SwitchBootstrap.typeSwitch could be faster [v3]

2024-06-22 Thread ExE Boss
On Mon, 29 May 2023 07:25:26 GMT, Jan Lahoda wrote: >> The pattern matching switches are using a bootstrap method >> `SwitchBootstrap.typeSwitch` to implement the jumps in the switch. >> Basically, for a switch like: >> >> switch (obj) { >> case String s when s.isEmpty() -> {} >> case

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v2]

2024-06-27 Thread ExE Boss
On Thu, 27 Jun 2024 15:25:36 GMT, Chen Liang wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflecting review feedback. > > src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 286: > >> 284:

Re: RFR: 8332522: SwitchBootstraps::mappedEnumLookup constructs unused array [v3]

2024-06-27 Thread ExE Boss
On Thu, 27 Jun 2024 15:32:38 GMT, Jan Lahoda wrote: >> For general pattern matching switches, the `SwitchBootstraps` class >> currently generates a cascade of `if`-like statements, computing the correct >> target case index for the given input. >> >> There is one special case which permits a r

Re: RFR: 8335366: Improve String.format performance with fastpath [v5]

2024-07-01 Thread ExE Boss
On Sat, 29 Jun 2024 19:10:51 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/StringFormat.java line 48: >> >>> 46: static String format(String format, Object... args) { >>> 47: if (args != null) { >>> 48: int off = format.indexOf('%'); >> >> nit: instead

Re: RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory

2024-07-05 Thread ExE Boss
On Thu, 13 Jun 2024 14:31:06 GMT, David M. Lloyd wrote: > Issue [JDK-8164908](https://bugs.openjdk.org/browse/JDK-8164908) added > support for functionality required to continue to support IIOP and custom > serializers in light of additional module-based restrictions on reflection. > It was ex

Re: RFR: 8334714: Class-File API leaves preview

2024-07-15 Thread ExE Boss
On Fri, 21 Jun 2024 11:56:37 GMT, Adam Sotona wrote: > Class-File API is leaving preview. > This is a removal of all `@PreviewFeature` annotations from Class-File API. > It also bumps all `@since` tags and removes > `jdk.internal.javac.PreviewFeature.Feature.CLASSFILE_API`. > > Please review. >

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v4]

2024-07-15 Thread ExE Boss
On Mon, 15 Jul 2024 22:56:23 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. On a strategic view, this index field should just become final >> so that `Name` becomes eligible for value class migration once valhalla >> comes. Thi

Re: RFR: 8336479: Provide Process.waitFor(Duration)

2024-07-17 Thread ExE Boss
On Wed, 17 Jul 2024 18:31:32 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/Process.java line 504: >> >>> 502: return false; >>> 503: >>> 504: return waitForNanos(TimeUnit.NANOSECONDS.convert(duration)); >> >> `waitFor` can be overridden by pre-24 subclas

Re: RFR: 8333812: ClassFile.verify() can throw exceptions instead of returning VerifyErrors [v3]

2024-07-19 Thread ExE Boss
On Fri, 19 Jul 2024 08:26:46 GMT, Adam Sotona wrote: >> `ClassFile.verify()` should always return list of verification errors and >> never throw an exception, even for corrupted classes. >> `BoundAttribute` initializations of `LocalVariableTable` and >> `LocalVariableTypeTable` attributes do no

Re: RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor() [v3]

2024-07-24 Thread ExE Boss
On Tue, 23 Jul 2024 20:58:01 GMT, Naoto Sato wrote: >> This is a simple doc-only change that follows up >> [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding >> CSR has also been drafted. > > Naoto Sato has updated the pull request incrementally with one additional > c

Re: RFR: 8307818: Convert Indify tool to Classfile API [v16]

2024-07-24 Thread ExE Boss
On Tue, 25 Jun 2024 13:54:07 GMT, Oussama Louati wrote: >> And what is the purpose of parsing a model from bytes and transforming it >> back to bytes without a change? > > This transformation is called only after the `classModel` is transformed: > - at line 472 and 380 when the `transformToByt

Re: RFR: 8307818: Convert Indify tool to Classfile API [v16]

2024-07-24 Thread ExE Boss
On Sat, 22 Jun 2024 15:55:28 GMT, Oussama Louati wrote: >> An indify tool in j.l.i tests (also in vmTestBase) convert some source-code >> private static methods with MT_ MH_, and INDY_ prefixes into MethodHandle, >> MethodType, and CallSite constants. >> ### Purpose of Indify >> >> - **Transf

Re: RFR: 8337225: Demote maxStack and maxLocals from CodeModel to CodeAttribute [v2]

2024-07-28 Thread ExE Boss
On Sun, 28 Jul 2024 02:39:23 GMT, Chen Liang wrote: >> As discussed in offline meeting, the max stack and locals information are >> part of the code attribute and not meaningful for buffered code elements. >> Computation would be costly and these see no real usage during >> transformations. Th

Re: RFR: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor

2024-08-18 Thread ExE Boss
On Fri, 16 Aug 2024 08:53:38 GMT, Shaojin Wen wrote: > The current implementation of ofDescriptor puts return type and parameter > types together in an ArrayList, and then splits them into return type and > array of parameter types. This ArrayList creation is unnecessary, considering > most de

Re: RFR: 8338700: AttributeMapper type parameter should be bounded by Attribute

2024-08-22 Thread ExE Boss
On Wed, 21 Aug 2024 23:20:38 GMT, Chen Liang wrote: > A minor oversight in AttributeMapper type parameter bounds, that it should be > bounded by Attribute. Only real impact is in BoundAttribute.readAttributes > where a cast is now omitted, as other sites of access like > Attribute::attributeMa

Re: RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread ExE Boss
On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs wrote: > Please review this PR which suggests to deprecate the unused class > `java.util.zip.ZipError` for removal. > > The class has been unsed by OpenJDK since the ZIP API was rewritten from > native to Java in JDK 9. > > I opted to not expl

Re: RFR: 8338906: Avoid passing EnumDescs and extra classes to type switch methods that don't use them

2024-08-24 Thread ExE Boss
On Fri, 23 Aug 2024 12:34:17 GMT, Claes Redestad wrote: > This PR refactors SwitchBootstraps so that extra EnumDescs and classes are > only passed into bootstraps when needed. Benchmarking shows that in many > cases these are not needed, and avoiding passing them (via binding in the > lists vi

Re: RFR: 8338930: StringConcatFactory static string concatenation strategy

2024-08-24 Thread ExE Boss
On Thu, 22 Aug 2024 11:50:02 GMT, Shaojin Wen wrote: > This is a follow-up to PR #20273, which improves performance when the number > of parameters exceeds 20. > > When the number of parameters is large, the possibility of reuse will be > lower, so we can use the static concat method and write

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v2]

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 12:12:42 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338930: StringConcatFactory hardCoded string concatenation strategy [v3]

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 14:29:16 GMT, Shaojin Wen wrote: >> This is a follow-up to PR #20273, which improves performance when the number >> of parameters exceeds 20. >> >> When the number of parameters is large, the possibility of reuse will be >> lower, so we can use the static concat method and

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 13:36:34 GMT, Shaojin Wen wrote: > Optimize ClassDesc related string concatenation, which will reduce object > allocation during startup. src/java.base/share/classes/java/lang/StringConcatHelper.java line 787: > 785: } > 786: > 787: static String concat(String pref

Re: RFR: 8338937: Optimize the string concatenation of ClassDesc

2024-08-25 Thread ExE Boss
On Sun, 25 Aug 2024 21:07:16 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/StringConcatHelper.java line 787: >> >>> 785: } >>> 786: >>> 787: static String concat(String prefix, String value, String suffix) { >> >> `Class​::descriptorString()` can probably also make u

Re: RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory [v2]

2024-08-27 Thread ExE Boss
On Tue, 27 Aug 2024 20:45:50 GMT, David M. Lloyd wrote: >> Issue [JDK-8164908](https://bugs.openjdk.org/browse/JDK-8164908) added >> support for functionality required to continue to support IIOP and custom >> serializers in light of additional module-based restrictions on reflection. >> It wa

Re: RFR: 8339320: Optimize ClassFile Utf8EntryImpl#inflate

2024-08-30 Thread ExE Boss
On Thu, 29 Aug 2024 11:44:50 GMT, Shaojin Wen wrote: > A very small optimization, split the large method inflate, split the > infrequently used paths into a method inflateCHAR Typo (`HCAR` → `CHAR`): src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java line 235: > 2

Re: RFR: 8304846: Provide a shared utility to dump generated classes defined via Lookup API [v8]

2024-08-31 Thread ExE Boss
On Mon, 3 Apr 2023 22:32:44 GMT, Mandy Chung wrote: >> This implements a shared utility to dump generated classes defined as >> normal/hidden classes via `Lookup` API. This replaces the implementation >> in `LambdaMetaFactory` and method handle implementation that dumps the >> hidden class b

Re: RFR: 8339214: Remove misleading CodeBuilder.loadConstant(Opcode, ConstantDesc) [v2]

2024-08-31 Thread ExE Boss
On Sat, 31 Aug 2024 09:42:41 GMT, Erik Gahlin wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Move bipush and sipush fix from Opcode cleanup to this patch > > src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumen

Re: RFR: 8339358: Optimize TypeKind#from

2024-09-01 Thread ExE Boss
On Thu, 29 Aug 2024 05:34:37 GMT, Shaojin Wen wrote: > TypeKind.from(Class) is a frequently called method, which provides a > specialized method to improve performance. > > The following Compiler log shows that the call stack level is reduced and two > reference accesses (descriptorString() ->

Re: RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v5]

2024-09-02 Thread ExE Boss
he incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains 21 additional > commits since the last revision: > > - Update src/java.base/share/classes/java/lang/StringCoding.java > >Co-authored-by: ExE Boss <

Re: RFR: 8338890: Add monitoring/management interface for the virtual thread scheduler

2024-09-03 Thread ExE Boss
On Mon, 2 Sep 2024 12:25:05 GMT, Alan Bateman wrote: > This PR proposes to add a JDK-specific monitoring and management interface > for the virtual thread scheduler. The interface is named > VirtualThreadSchedulerMXBean and allows JMX based tooling monitor/manage the > scheduler's target paral

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder()

2022-10-13 Thread ExE Boss
On Sat, 20 Aug 2022 19:17:18 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/util/TreeMap.java line 3318: >> >>> 3316: // Adapt or create a key-based comparator >>> 3317: Comparator treeComparator = tree.comparator; >>> 3318: return Map.Entry.co

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v2]

2022-10-14 Thread ExE Boss
t; P.S. I think the comment of `TreeMap.getEntryUsingComparator()` is outdated. >> Should we also change it? > > Сергей Цыпанов has updated the pull request incrementally with one additional > commit since the last revision: > > Update src/java.base/share/classes/java/util/TreeMap.ja

Re: RFR: 8294899: Process.waitFor() throws IllegalThreadStateException when a process on Windows returns an exit code of 259

2022-10-16 Thread ExE Boss
On Wed, 12 Oct 2022 16:30:07 GMT, Roger Riggs wrote: > Process.waitFor() throws IllegalThreadStateException when a process returns > an exit code of 259. > As described in the bug report, `waitFor()` should not be sensitive to the > exit value. > Previously, it erroneously threw IllegalStateExc

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-21 Thread ExE Boss
On Fri, 21 Oct 2022 11:56:57 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/util/TreeMap.java line 3329: >> >>> 3327: } >>> 3328: else { >>> 3329: return (Comparator> & Serializable) >>> (e1, e2) -> { >> >> I think this cast hints compile

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-21 Thread ExE Boss
On Fri, 21 Oct 2022 12:11:28 GMT, ExE Boss wrote: >> From one point this is obviously a change in behaviour, from another the >> spec of `Spliterator.getComparator()` says nothing about serializability of >> returned comparator and the actual value is hardly ever going to

Re: RFR: 8294241: Deprecate URL public constructors

2022-10-26 Thread ExE Boss
On Wed, 26 Oct 2022 16:41:29 GMT, Michael McMahon wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism de

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview)

2022-10-27 Thread ExE Boss
On Thu, 27 Oct 2022 20:16:14 GMT, Jim Laskey wrote: > Enhance the Java programming language with string templates, which are > similar to string literals but contain embedded expressions. A string > template is interpreted at run time by replacing each expression with the > result of evaluatin

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v3]

2022-10-28 Thread ExE Boss
On Fri, 28 Oct 2022 19:13:54 GMT, Rémi Forax wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update TemplateRuntime::combine > > src/java.base/share/classes/java/lang/template/StringTemplate.java line 323: > >> 321:

Re: RFR: 8294241: Deprecate URL public constructors [v3]

2022-11-03 Thread ExE Boss
On Tue, 1 Nov 2022 16:14:20 GMT, Daniel Fuchs wrote: >> Deprecate URL constructors. Developers are encouraged to use `java.net.URI` >> to parse or construct any URL. >> >> The `java.net.URL` class does not itself encode or decode any URL components >> according to the escaping mechanism define

Re: RFR: JDK-8285932 Implementation of JEP-430 String Templates (Preview) [v13]

2022-11-06 Thread ExE Boss
On Thu, 3 Nov 2022 17:23:53 GMT, Jim Laskey wrote: >> Enhance the Java programming language with string templates, which are >> similar to string literals but contain embedded expressions. A string >> template is interpreted at run time by replacing each expression with the >> result of evalua

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator)

2022-11-15 Thread ExE Boss
On Wed, 2 Nov 2022 16:23:34 GMT, Andrew Haley wrote: > JEP 429 implementation. src/java.base/share/classes/java/lang/Thread.java line 1610: > 1608: ensureMaterializedForStackWalk(bindings); > 1609: task.run(); > 1610: Reference.reachabilityFence(bindings); T

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v6]

2022-11-16 Thread ExE Boss
On Wed, 16 Nov 2022 12:11:45 GMT, Maurizio Cimadamore wrote: >> We expect isBound() will be used a lot and I think that is clearer (and >> cheaper) than find().isEmpty(). >> >> Time will tell on orElse/orElseThrow and whether they should be replaced >> with an Optional view. That is, I think

Re: RFR: 8295044: Implementation of Foreign Function and Memory API (Second Preview) [v27]

2022-11-17 Thread ExE Boss
On Tue, 15 Nov 2022 18:47:39 GMT, Maurizio Cimadamore wrote: >> This PR contains the API and implementation changes for JEP-434 [1]. A more >> detailed description of such changes, to avoid repetitions during the review >> process, is included as a separate comment. >> >> [1] - https://openjd

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v16]

2022-11-19 Thread ExE Boss
On Fri, 18 Nov 2022 18:38:53 GMT, Andrew Haley wrote: >> JEP 429 implementation. > > Andrew Haley has updated the pull request incrementally with one additional > commit since the last revision: > > Add ensureMaterializedForStackWalk kludge for AArch64 src/hotspot/cpu/aarch64/aarch64.ad line

Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v15]

2022-11-19 Thread ExE Boss
On Fri, 18 Nov 2022 17:27:28 GMT, Alan Bateman wrote: >> Andrew Haley has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Reviewer feedback >> - Reviewer feedback Javadoc fixes > > src/java.base/share/classes/java/lang/VirtualThread.java

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-21 Thread ExE Boss
On Mon, 21 Nov 2022 13:02:48 GMT, Per Minborg wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed by

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v4]

2022-11-21 Thread ExE Boss
ACCESS.acquireSessionAsAutoCloseable(bb)) { >> >> Suggestion: >> >> // try (var guard = NIO_ACCESS.acquireSession(bb)) { > > Are you happy with the proposed renaming now @ExE-Boss ? I think our > propositions crossed in time? This change

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v9]

2022-11-22 Thread ExE Boss
On Tue, 22 Nov 2022 09:11:44 GMT, Per Minborg wrote: >> This PR proposes the introduction of **guarding** of the use of >> `DirectBuffer::address` within the JDK. With the introduction of the Foreign >> Function and Memory access, it is possible to derive Buffer instances that >> are backed by

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v9]

2022-11-22 Thread ExE Boss
On Tue, 22 Nov 2022 13:49:45 GMT, Per Minborg wrote: >> src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java >> line 914: >> >>> 912: * If so, make a copy to put the dst data in. >>> 913: */ >>> 914: @SuppressWarnings("try") >> >> After looking a

Re: RFR: 8296024: Usage of DIrectBuffer::address should be guarded [v13]

2022-11-24 Thread ExE Boss
On Thu, 24 Nov 2022 14:56:07 GMT, Per Minborg wrote: >> src/java.base/share/classes/sun/nio/ch/IOUtil.java line 480: >> >>> 478: static MemorySessionImpl acquireScope(ByteBuffer bb, boolean >>> async) { >>> 479: if (async && NIO_ACCESS.isThreadConfined(bb)) { >>> 480: th

Re: RFR: 8015831: Add lint check for calling overridable methods from a constructor [v2]

2023-01-07 Thread ExE Boss
On Fri, 6 Jan 2023 23:13:09 GMT, Archie L. Cobbs wrote: >> This PR adds a new lint warning category `this-escape`. >> >> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to >> allow the JDK to continue to compile with `-Xlint:all`. >> >> A 'this' escape warning is gener

Re: RFR: 8299852: Modernize ConcurrentHashMap

2023-01-12 Thread ExE Boss
On Tue, 10 Jan 2023 10:32:34 GMT, Per Minborg wrote: > `java.util.concurrent.ConcurrentHashMap` is relatively old and has not been > updated to reflect the current state of Java and can be modernized: > > * Add `@Serial` annotations > * Seal classes and restrict subclassing for internal class

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

2023-02-05 Thread ExE Boss
On Sun, 5 Feb 2023 13:52:23 GMT, Tagir F. Valeev wrote: >> src/java.base/share/classes/java/lang/Math.java line 2297: >> >>> 2295: */ >>> 2296: public static float clamp(float value, float min, float max) { >>> 2297: if (!(min < max)) { >> >> Wouldn't it be more simple to repla

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

2023-02-05 Thread ExE Boss
On Sat, 4 Feb 2023 21:34:50 GMT, Tagir F. Valeev wrote: >> clamp() methods added to Math and StrictMath >> >> `int clamp(long, int, int)` is somewhat different, as it accepts a `long` >> value and safely clamps it to an `int` range. Other overloads work with a >> particular type (long, float a

Re: RFR: 8301220: Return value of toArray() of Сollection types from java.base should be trusted [v3]

2023-02-05 Thread ExE Boss
On Mon, 30 Jan 2023 03:13:01 GMT, Glavo wrote: > > > > Why not use set of classes? > > > > > > > > > Because some classes are not visible here (such as `Arrays.ArrayList`). > > > I'm not sure what the best choice is, so I'm trying to explore the > > > implementation plan. > > > > > > Only `A

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v3]

2023-02-05 Thread ExE Boss
On Wed, 1 Feb 2023 07:52:25 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/lang/Module.java line 281: >> >>> 279: >>> 280: private static boolean isNativeAccessEnabled(Module target) { >>> 281: if (target.enableNativeAccess) >> >> @minborg It'd seem a bit easier to imp

Re: RFR: 8301578: Perform output outside synchronization in Module.class [v3]

2023-02-05 Thread ExE Boss
On Wed, 1 Feb 2023 08:51:16 GMT, Per Minborg wrote: >> This PR proposed to reduce contention in synchronized methods mainly by >> doing I/O operations outside synch blocks. > > Per Minborg has updated the pull request incrementally with three additional > commits since the last revision: > >

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

2023-02-07 Thread ExE Boss
There should probably also be a pure `int` overload: >> >> public static int clamp(int value, int min, int max) > > @ExE-Boss which problem such an overload would solve? It looks like, `int > clamp(long, int, int)` can be used everywhere where proposed `int clamp(int, >

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread ExE Boss
On Thu, 16 Feb 2023 19:35:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread ExE Boss
On Thu, 16 Feb 2023 20:02:36 GMT, David M. Lloyd wrote: >> src/java.base/share/classes/java/lang/invoke/ProxyClassesDumper.java line >> 124: >> >>> 122: } >>> 123: } >>> 124: sb.append(counter.incrementAndGet()); >> >> Suggestion: >> >> sb.append('$').appen

Re: RFR: 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex)

2023-02-17 Thread ExE Boss
On Thu, 16 Feb 2023 17:16:35 GMT, Raffaello Giulietti wrote: > Add an `indexOf()` variant allowing to specify both a lower and an upper > bound on the search. Could we also get a similar overload for `String::lastIndexOf`? - PR: https://git.openjdk.org/jdk/pull/12600

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask [v2]

2023-02-17 Thread ExE Boss
On Fri, 17 Feb 2023 11:39:21 GMT, Viktor Klang wrote: >> I noticed when looking at the code that there was no real need to use a CHM >> to perform the tracking of activation in an ordered fashion on >> ForEachOrderedTask, but instead a VarHandle can be used, reducing >> allocations and indirec

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums

2023-02-20 Thread ExE Boss
On Thu, 9 Feb 2023 16:20:31 GMT, Tingjun Yuan wrote: > Currently, the two subclasses of `java.util.EnumSet` optimize bulk operations > when the argument is also a `EnumSet`, but there is no such optimization for > wrapper sets (returned by `Collections.unmodifiableSet`, > `Collections.synchron

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask [v4]

2023-02-28 Thread ExE Boss
On Mon, 27 Feb 2023 09:14:56 GMT, Viktor Klang wrote: >> I noticed when looking at the code that there was no real need to use a CHM >> to perform the tracking of activation in an ordered fashion on >> ForEachOrderedTask, but instead a VarHandle can be used, reducing >> allocations and indirec

Re: RFR: 8304031: Classfile API cannot encode Primitive Class as Condy

2023-03-13 Thread ExE Boss
On Mon, 13 Mar 2023 08:13:44 GMT, liach wrote: > Without this patch, the Classfile API tries to encode PrimitiveClassDesc as > CONSTANT_Class_info and error in `toInternalName`. Arguably, the `instanceof DynamicConstantDesc` check should go first, as there  can be only one superclass, but multi

Re: RFR: 8304031: Classfile API cannot encode Primitive Class as Condy

2023-03-14 Thread ExE Boss
On Mon, 13 Mar 2023 08:13:44 GMT, liach wrote: > Without this patch, the Classfile API tries to encode PrimitiveClassDesc as > CONSTANT_Class_info and error in `toInternalName`. I meant that `instanceof DynamicConstantDesc` would go after concrete classes (`Integer`, `Long`, `Float`, `Double`,

Re: RFR: 8304360: Test to ensure ConstantDescs fields work [v2]

2023-03-16 Thread ExE Boss
On Thu, 16 Mar 2023 18:40:12 GMT, Chen Liang wrote: >> https://github.com/openjdk/jdk/pull/13033#issuecomment-1470857327 >> >> Add a test to validate that all constants in ConstantDescs can be resolved >> with a minimally-trusted lookup, and select constants represent the objects >> they claim

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview)

2023-03-20 Thread ExE Boss
On Fri, 17 Mar 2023 15:42:56 GMT, Per Minborg wrote: > API changes for the FFM API (third preview) > > Specdiff: > https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html > > Javadoc: > https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.html src

Re: RFR: 8266571: Sequenced Collections

2023-03-20 Thread ExE Boss
On Sat, 5 Nov 2022 05:44:42 GMT, Stuart Marks wrote: >> Is there a particular reason we define poll (null on empty) in SequencedMap >> but remove (NSEE on empty) in SequencedCollection? >> >> I understand that SequencedCollection doesn't want to be null-ambiguous, and >> map entries are non-nu

Re: RFR: 8266571: Sequenced Collections

2023-03-20 Thread ExE Boss
On Tue, 8 Feb 2022 17:23:38 GMT, Stuart Marks wrote: > PR for Sequenced Collections implementation. Note that `SortedMap::firstKey` and `SortedMap::lastKey` can now both have a  default implementation that delegates to `SequencedMap::firstEntry` and  `SequencedMap::lastEntry` respectively. src/

Re: RFR: 8266571: Sequenced Collections

2023-03-20 Thread ExE Boss
On Thu, 3 Nov 2022 01:56:05 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 384: >> >>> 382: return this.put(k, v); >>> 383: } finally { >>> 384: putMode = PUT_NORM; >> >> @stuart-marks Would it be an alternative to have

Re: RFR: 8266571: Sequenced Collections

2023-03-20 Thread ExE Boss
On Tue, 12 Apr 2022 23:25:14 GMT, Stuart Marks wrote: >> src/java.base/share/classes/java/util/LinkedHashMap.java line 604: >> >>> 602: * @return a set view of the keys contained in this map >>> 603: */ >>> 604: public SequencedSet keySet() { >> >> Changing the return type means t

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v12]

2023-03-21 Thread ExE Boss
On Fri, 17 Mar 2023 17:01:43 GMT, Adam Sotona wrote: >> jdk.jlink internal plugins are heavily using ASM >> >> This patch converts ASM calls to Classfile API. >> >> Please review. >> Thanks, >> Adam > > Adam Sotona has updated the pull request with a new target base due to a > merge or a rebas

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v12]

2023-03-21 Thread ExE Boss
On Fri, 17 Mar 2023 17:30:41 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 220 commits: >> >> - Merge branch 'master' into JDK-8294972-jlink-plugins >> - SystemModulesPlugin::genClassByte

Re: RFR: 8302818: Optimize wrapper sets and immutable sets of Enums [v7]

2023-03-22 Thread ExE Boss
On Wed, 22 Mar 2023 01:22:37 GMT, Tingjun Yuan wrote: >> Currently, the two subclasses of `java.util.EnumSet` optimize bulk >> operations when the argument is also a `EnumSet`, but there is no such >> optimization for wrapper sets (returned by `Collections.unmodifiableSet`, >> `Collections.syn

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v8]

2023-03-24 Thread ExE Boss
On Wed, 22 Mar 2023 14:09:07 GMT, Per Minborg wrote: >> API changes for the FFM API (third preview) >> >> Specdiff: >> https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html >> >> Javadoc: >> https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.ht

Re: RFR: 8303524: Check FunctionDescriptor byte order when linking

2023-03-27 Thread ExE Boss
On Thu, 23 Mar 2023 16:47:08 GMT, Jorn Vernee wrote: > Linkers are strongly tied to a particular byte order, because they are tied > to a particular platform. So, the linker should reject layouts that have > another byte order. This patch implements that check. src/java.base/share/classes/jdk/

Re: RFR: JDK-8304028: Port fdlibm IEEEremainder to Java

2023-03-27 Thread ExE Boss
On Tue, 21 Mar 2023 06:11:57 GMT, Joe Darcy wrote: > Last but not least, a port of fdlibm IEEEremainder from C to Java. I plan to > write some more implementation-specific tests around decision points in the > FDLIBM algorithm, but I wanted to get the bulk of the changes out for review > first

Re: RFR: 8266571: Sequenced Collections [v2]

2023-03-28 Thread ExE Boss
On Tue, 28 Mar 2023 21:31:20 GMT, Rémi Forax wrote: > After all, there is no interface for non-null collections, read-only > collections, non structurally modifiable collections or sorted collections, > so why an interface for ordered collection ? There is `SortedMap`, and non‑null collection 

Re: RFR: 8284871: Use covariant overrides for the resolveConstantDesc(Lookup) method in sub‑interfaces of java.lang.constant.ConstantDesc

2023-03-31 Thread ExE Boss
On Sat, 11 Mar 2023 04:59:07 GMT, Chen Liang wrote: > Also remove redundant casts to avoid javac warnings. src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java line 197: > 195: * @apiNote {@linkplain MethodTypeDesc} can represent method type > descriptors > 196: * that

Re: RFR: 8304265: Implementation of Foreign Function and Memory API (Third Preview) [v16]

2023-04-03 Thread ExE Boss
On Thu, 30 Mar 2023 11:28:25 GMT, Per Minborg wrote: >> API changes for the FFM API (third preview) >> >> Specdiff: >> https://cr.openjdk.org/~pminborg/panama/21/v1/specdiff/overview-summary.html >> >> Javadoc: >> https://cr.openjdk.org/~pminborg/panama/21/v1/javadoc/java.base/module-summary.ht

Re: RFR: 8305425: Thread.isAlive0 doesn't need to call into the VM [v6]

2023-04-04 Thread ExE Boss
On Wed, 5 Apr 2023 02:30:15 GMT, David Holmes wrote: >> We have the strange situation where calling `t.isAlive()` on a >> `java.lang.Thread` `t`, will call into the VM (via `alive()` then >> `isAlive0()`) where the VM then examines the `eetop` field of `t` to extract >> its `JavaThread` pointe

Re: RFR: 8305425: Thread.isAlive0 doesn't need to call into the VM [v6]

2023-04-04 Thread ExE Boss
On Wed, 5 Apr 2023 02:30:15 GMT, David Holmes wrote: >> We have the strange situation where calling `t.isAlive()` on a >> `java.lang.Thread` `t`, will call into the VM (via `alive()` then >> `isAlive0()`) where the VM then examines the `eetop` field of `t` to extract >> its `JavaThread` pointe

Re: RFR: 8284871: Use covariant overrides for the resolveConstantDesc(Lookup) method in sub‑interfaces of java.lang.constant.ConstantDesc [v3]

2023-04-04 Thread ExE Boss
On Tue, 4 Apr 2023 17:22:11 GMT, Chen Liang wrote: >> Also remove redundant casts to avoid javac warnings. > > Chen Liang 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

Re: RFR: 8304911: Use OperatingSystem enum in some modules

2023-04-04 Thread ExE Boss
On Tue, 4 Apr 2023 19:22:48 GMT, Roger Riggs wrote: > With the addition of `jdk.internal.util.OperatingSystem` references to the > system property `os.name` can be replaced. > This PR exports jdk.internal.util to: > - java.prefs, > - java.security.jgss, > - java.smartcardio, > - jdk.charsets

Re: RFR: 8304911: Use OperatingSystem enum in some modules [v2]

2023-04-05 Thread ExE Boss
On Wed, 5 Apr 2023 14:32:03 GMT, Roger Riggs wrote: >> With the addition of `jdk.internal.util.OperatingSystem` references to the >> system property `os.name` can be replaced. >> This PR exports jdk.internal.util to: >> - java.prefs, >> - java.security.jgss, >> - java.smartcardio, >> - jdk.c

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v4]

2023-04-05 Thread ExE Boss
On Wed, 5 Apr 2023 19:20:08 GMT, Roger Riggs wrote: >> Define an internal jdk.internal.util.Architecture enumeration and static >> methods to replace uses of the system property `os.arch`. >> The enumeration values are defined to match those used in the build. >> The initial values are: `X64, X8

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v4]

2023-04-05 Thread ExE Boss
On Wed, 5 Apr 2023 21:36:57 GMT, Glavo wrote: >> src/java.base/share/classes/jdk/internal/util/Architecture.java line 77: >> >>> 75: */ >>> 76: @ForceInline >>> 77: public static boolean isARM() { >> >> It should define what’s the difference to aarch64 for example will aarch64 >>

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v4]

2023-04-06 Thread ExE Boss
On Thu, 6 Apr 2023 07:36:36 GMT, Per Minborg wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct spelling of isAARCH64 in WIndows AttachProviderImpl > > src/java.base/share/classes/jdk/internal/util/Architecture

Re: RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v4]

2023-04-06 Thread ExE Boss
On Thu, 6 Apr 2023 07:40:50 GMT, Per Minborg wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct spelling of isAARCH64 in WIndows AttachProviderImpl > > src/java.base/share/classes/jdk/internal/util/Architecture

  1   2   3   4   >