Re: RFR: 8333377: Migrate Generic Signature parsing to ClassFile API [v6]

2025-04-23 Thread ExE Boss
On Wed, 9 Apr 2025 15:34:25 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

Re: RFR: 8355301: Simplify the code by using record [v2]

2025-04-22 Thread ExE Boss
On Wed, 23 Apr 2025 00:58:08 GMT, Shaojin Wen wrote: >> As the title says, this is a simple refactoring that simplifies the code by >> using record. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > from @liach, Use static pi

Re: RFR: 8297271: AccessFlag.maskToAccessFlags should be specific to class file version

2025-04-19 Thread ExE Boss
On Fri, 18 Apr 2025 20:33:27 GMT, Chen Liang wrote: > Take the class file version to reject flags not yet defined, redefined, or > obsoleted. The non-cffv version can return the preview flags when the current > runtime is in preview. With this, the **Class‑File API** needs to be updated to pas

Re: RFR: 8354300: Fields in String are not trusted

2025-04-18 Thread ExE Boss
On Mon, 14 Apr 2025 18:09:35 GMT, Chen Liang wrote: >> Hello Per, I'm not too familiar with runtime compiler optimizations. So >> consider this as a basic question. >> >>> This means the VM can trust these fields to never change which enables >>> constant folding optimizations. >> >> If I'm

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v41]

2025-04-04 Thread ExE Boss
On Fri, 4 Apr 2025 09:14:22 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Address comments on docs src/java.base/share/classes/jdk/inte

Re: RFR: 8346567: Make Class.getModifiers() non-native

2025-02-03 Thread ExE Boss
On Mon, 9 Dec 2024 19:26:53 GMT, Coleen Phillimore wrote: > The Class.getModifiers() method is implemented as a native method in > java.lang.Class to access a field that we've calculated when creating the > mirror. The field is final after that point. The VM doesn't need it anymore, > so ther

Re: RFR: 8346567: Make Class.getModifiers() non-native

2025-02-03 Thread ExE Boss
On Mon, 9 Dec 2024 20:27:52 GMT, Coleen Phillimore wrote: >> src/hotspot/share/classfile/javaClasses.cpp line 1504: >> >>> 1502: macro(_reflectionData_offset, k, "reflectionData", >>> java_lang_ref_SoftReference_signature, false); \ >>> 1503: macro(_signers_offset, k,

Re: RFR: 8347408: Create an internal method handle adapter for system calls with errno [v8]

2025-01-14 Thread ExE Boss
On Tue, 14 Jan 2025 15:59:42 GMT, Per Minborg wrote: >> Going forward, converting older JDK code to use the relatively new FFM API >> requires system calls that can provide `errno` and the likes to explicitly >> allocate a MemorySegment to capture potential error states. This can lead to >> ne

Re: RFR: 8347408: Create an internal method handle adapter for system calls with errno

2025-01-10 Thread ExE Boss
On Tue, 26 Nov 2024 15:04:51 GMT, Per Minborg wrote: > Going forward, converting older JDK code to use the relatively new FFM API > requires system calls that can provide `errno` and the likes to explicitly > allocate a MemorySegment to capture potential error states. This can lead to > negati

Re: RFR: 8334714: Implement JEP 484: Class-File API [v9]

2024-12-09 Thread ExE Boss
On Fri, 15 Nov 2024 11:53:00 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 rev

Re: RFR: 8334714: Implement JEP 484: Class-File API [v9]

2024-12-09 Thread ExE Boss
On Fri, 15 Nov 2024 14:35:26 GMT, Adam Sotona 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 12 commits: >> >> - Merge remote-tracking branch 'openjdk/master' into JDK-8334714-final >> >># Conflicts

Re: RFR: 8344882: (bf) Temporary direct buffers should not count against the upper limit on direct buffer memory

2024-11-22 Thread ExE Boss
On Fri, 22 Nov 2024 23:44:11 GMT, Brian Burkhalter wrote: > Make the memory used by internal temporary direct buffers not count towards > the upper limit on direct buffer memory. src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template line 77: > 75: static final boolean UNALIGNE

Re: RFR: 8344168: Change Unsafe base offset from int to long

2024-11-22 Thread ExE Boss
On Fri, 22 Nov 2024 04:23:26 GMT, Dean Long wrote: > Should the CSR FAQ be updated to remove references to `jdk.*,` or are there > some jdk.* packages that require a CSR? As far as I can tell, none are > exported. The `jdk.incubator.*` packages (such as `jdk.incubator.vector`) are exported. -

Re: RFR: 8344168: Change Unsafe base offset from int to long

2024-11-14 Thread ExE Boss
On Thu, 14 Nov 2024 23:20:23 GMT, Dean Long wrote: >> The type of the Unsafe base offset constant is int, which may cause overflow >> when adding int offsets, such as 8343925 (PR #22012). 8343984 (PR #22027) >> fixes most of the offset overflows in JDK, but ArraysSupport and CRC32C are >> stil

Re: RFR: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io [v7]

2024-11-14 Thread ExE Boss
On Thu, 14 Nov 2024 11:59:47 GMT, Alan Bateman wrote: >> Brian Burkhalter has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8343039: Remove failing getDeclaredField call from test >> java/lang/ProcessBuilder/Basic.java > > src/java.base/s

Re: RFR: 8343039: Remove jdk.internal.misc.InternalLock and usages from java.io

2024-11-12 Thread ExE Boss
On Tue, 12 Nov 2024 21:45:41 GMT, Brian Burkhalter wrote: > Uses of `InternalLock` are removed and `synchronized` is reinstated. src/java.base/share/classes/java/io/BufferedInputStream.java line 241: > 239: } > 240: initialSize = size; > 241: buf = new byte[size]; This 

Re: RFR: 8343394: Make MemorySessionImpl.state a stable field [v4]

2024-11-04 Thread ExE Boss
On Mon, 4 Nov 2024 19:08:49 GMT, Jorn Vernee wrote: >> `checkValidStateRaw` synchronizes with `justClose` using handshakes so an >> opaque or higher load is only needed in `sharedSessionAlreadyClosed`. A >> `getOpaque` would probably be adequate. But I believe there is no formal >> restriction

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v6]

2024-11-02 Thread ExE Boss
On Wed, 30 Oct 2024 19:28:32 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security >> Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The >> [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the >> main ch

Re: RFR: 8343188: Investigate ways to simplify MemorySegment::ofBuffer [v5]

2024-10-31 Thread ExE Boss
On Thu, 31 Oct 2024 17:20:11 GMT, Maurizio Cimadamore wrote: >> Per Minborg has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 12 additional >> co

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc [v3]

2024-10-22 Thread ExE Boss
On Tue, 22 Oct 2024 14:43:14 GMT, Chen Liang wrote: >> Currently, to efficiently check if a `ClassEntry`, such as one from an >> `InvokeInstruction`, is of a particular class, we use such a pattern (as >> seen in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): >> >> inst.owner().na

Re: RFR: 8334714: Implement JEP 484: Class-File API [v7]

2024-10-21 Thread ExE Boss
On Mon, 21 Oct 2024 06:34:03 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 rev

Re: RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API [v2]

2024-10-19 Thread ExE Boss
On Fri, 18 Oct 2024 23:13:27 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java >> line 141: >> >>> 139: case "MH" -> CD_MH; >>> 140: case "DMH" -> CD_DMH; >>> 141: case "BMH" -> CD_BMH; >> >> I don't see w

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-19 Thread ExE Boss
On Thu, 17 Oct 2024 22:44:05 GMT, Mandy Chung wrote: >> The old core reflection implementation generates dynamic classes that are >> special cases in the VM to bypass bytecode verification to workaround >> various issues [1] [2] [3]. >> >> The old core reflection implementation was [removed in

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-19 Thread ExE Boss
On Fri, 18 Oct 2024 17:18:05 GMT, Mandy Chung wrote: >>> // If the loader is not the boot loader then throw an exception if its >>> // superclass is in package jdk.internal.reflect >> >> This should not be needed. `jdk.internal.reflect` is a non-exported >> package in `java.base` module. If

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager

2024-10-16 Thread ExE Boss
On Wed, 16 Oct 2024 06:28:03 GMT, Alan Bateman wrote: >> Thanks, will fix. > > SecurityManager::getClassContext hasn't been needed since JDK 9 but we > decided to keep the implementation in case there are older versions of > logging libraries that extend SecurityManager so they can call this me

Re: RFR: 8342206: Convenience method to check if a ClassEntry matches a ClassDesc

2024-10-15 Thread ExE Boss
On Tue, 15 Oct 2024 17:34:53 GMT, Chen Liang wrote: > Currently, to efficiently check if a `ClassEntry`, such as one from an > `InvokeInstruction`, is of a particular class, we use such a pattern (as seen > in JEP 486 [Appendix](https://openjdk.org/jeps/486#Appendix)): > > inst.owner().name().

Re: RFR: 8317356: Test ClassFile API if it deals with nulls correctly across the whole API [v2]

2024-10-11 Thread ExE Boss
On Fri, 11 Oct 2024 16:21:30 GMT, Chen Liang wrote: >> Please review this patch that adds a test by @nizarbenalla to perform null >> checks across the ClassFile API. This is an updated version of #20556 that >> minimizes impact on our implementation code. >> >> Notes: >> 1. There's one change

Re: RFR: 8317356: Test ClassFile API if it deals with nulls correctly across the whole API

2024-10-11 Thread ExE Boss
On Fri, 11 Oct 2024 07:55:44 GMT, Adam Sotona wrote: >> Please review this patch that adds a test by @nizarbenalla to perform null >> checks across the ClassFile API. This is an updated version of #20556 that >> minimizes impact on our implementation code. >> >> Notes: >> 1. There's one change

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v2]

2024-10-08 Thread ExE Boss
On Tue, 1 Oct 2024 07:53:23 GMT, Ioi Lam wrote: >> src/hotspot/share/cds/aotConstantPoolResolver.cpp line 476: >> >>> 474: if (bsm_klass->equals("java/lang/invoke/StringConcatFactory") && >>> 475: bsm_name->equals("makeConcatWithConstants")) { >>> 476: return true; >> >> I think all

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v2]

2024-10-08 Thread ExE Boss
On Wed, 9 Oct 2024 00:43:25 GMT, Ioi Lam wrote: >> This is the 7th and final PR for [JEP 483: Ahead-of-Time Class Loading & >> Linking](https://bugs.openjdk.org/browse/JDK-8315737). >> >> This PR implements the AOT-linking of invokedynamic callsites: >> - We only link lambda expressions (`Lambd

Re: RFR: 8341566: Adding factory for non-synchronized CharSequence Reader [v3]

2024-10-06 Thread ExE Boss
On Sun, 6 Oct 2024 17:44:53 GMT, Markus KARG wrote: >> This Pull Requests proposes an implementation for >> [JDK-8341566](https://bugs.openjdk.org/browse/JDK-8341566): Adding the new >> method `public static Reader Reader.of(CharSequence)` will return an >> anonymous, non-synchronized implemen

Re: RFR: 8341548: More concise use of classfile API

2024-10-04 Thread ExE Boss
On Fri, 4 Oct 2024 12:05:02 GMT, Shaojin Wen wrote: > java.base should provide best practices for Class File API > > 1. Use fluent coding style > 2. Use aconst_null instead of oadConstant(null) > 3. use astore intead of 'storeLocal(REFERENCE' > 4. use aload instead of 'loadLocal(REFERENCE' > 5.

Re: RFR: 8341512: Optimize StackMapGenerator::processInvokeInstructions

2024-10-04 Thread ExE Boss
On Fri, 4 Oct 2024 02:15:51 GMT, Shaojin Wen wrote: > A small optimization for StackMapGenerator::processInvokeInstructions. > > 1. Use local currentFrame to avoid multiple getfields > 2. remove Util.methodTypeSymbol(NameAndTypeEntry) > 3. Use decStack instead of popStack to reduce array access

Re: RFR: 8339205: Optimize StackMapGenerator [v2]

2024-10-04 Thread ExE Boss
On Fri, 4 Oct 2024 14:03:20 GMT, Shaojin Wen wrote: >> Reduce code size by combining calls and defining local variables > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 13 commits: > > - reduce codeSize > - reduce

Re: RFR: 8341006: Optimize StackMapGenerator detect frames [v3]

2024-10-03 Thread ExE Boss
On Thu, 3 Oct 2024 13:15:10 GMT, Shaojin Wen wrote: >> 1. Construct Frames directly without BitSet >> 2. Use Frame[] instead of ArrayList >> 3. Use EMPTY_FRAME_ARRAY for initialization. No need to allocate objects >> when there is no frame. > > Shaojin Wen has updated the pull request incrementa

Re: RFR: 8341415: Optimize RawBytecodeHelper::next

2024-10-02 Thread ExE Boss
On Wed, 2 Oct 2024 13:29:22 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java >> line 449: >> >>> 447: } >>> 448: >>> 449: if ((nextBci += len) > end) { >> >> This change makes it that `nextBci` will no longer monotonical

Re: RFR: 8341415: Optimize RawBytecodeHelper::next

2024-10-02 Thread ExE Boss
On Wed, 2 Oct 2024 07:53:44 GMT, Shaojin Wen wrote: > A small optimization to the RawBytecodeHelper::next method > * Remove `len <= 0` once > * merge store opcode and isWide src/java.base/share/classes/jdk/internal/classfile/impl/RawBytecodeHelper.java line 350: > 348: */ > 349: publi

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

2024-10-01 Thread ExE Boss
On Wed, 28 Aug 2024 08:11:08 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 n

Re: RFR: 8334714: Implement JEP 484: Class-File API [v6]

2024-09-27 Thread ExE Boss
On Thu, 26 Sep 2024 08:16:50 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 rev

Re: RFR: 8338544: Dedicated Array class descriptor implementation

2024-09-25 Thread ExE Boss
On Wed, 21 Aug 2024 20:25:07 GMT, Chen Liang wrote: > @cl4es discovered that Stack Map generation in ClassFile API uses > `componentType` and `arrayType` for `aaload` `aastore` instructions, which > are currently quite slow. We can split out array class descriptors from class > or interfaces t

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

2024-09-24 Thread ExE Boss
On Tue, 24 Sep 2024 19:40:23 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: 8340710: Optimize DirectClassBuilder::build

2024-09-23 Thread ExE Boss
On Sun, 22 Sep 2024 05:30:43 GMT, Shaojin Wen wrote: > Do some refactoring so that the code can be inlined by the C1/C2 optimizer. > > 1. DirectClassBuilder::build codeSize 361 -> 315 > 2. DirectCodeBuilder::writeExceptionHandlers codeSize 183 -> 31 > 3. BufWriterImpl::writeIndex codeSize 62 ->

Re: RFR: 8340232: Optimize DataInputStream::readUTF

2024-09-16 Thread ExE Boss
On Sun, 8 Sep 2024 07:52:26 GMT, Shaojin Wen wrote: > Similar to ObjectInputStream, use JLA.countPositives and > JLA.inflateBytesToChars to speed up readUTF src/java.base/share/classes/java/io/DataInputStream.java line 602: > 600: int ascii = JLA.countPositives(bytearr, 0, utflen); > 6

Re: RFR: 8338546: Speed up ConstantPoolBuilder::classEntry(ClassDesc) [v3]

2024-09-16 Thread ExE Boss
On Tue, 17 Sep 2024 02:01:49 GMT, Chen Liang wrote: >> Speed up `ConstantPoolBuilder::classEntry(ClassDesc)` by going through >> `ClassDesc` comparison and reusing descriptor hash to calculate internal >> name hash if possible. No suitable device to run benchmarks so need to find >> something

Re: RFR: 8340131: Refactor internal makeHiddenClassDefiner to take ClassOption ... instead of Set [v5]

2024-09-15 Thread ExE Boss
On Sun, 15 Sep 2024 12:59:21 GMT, Claes Redestad wrote: >> Simple internal refactor to load a few classes less on startup. Arguably >> cleaner and avoids some iterator allocations. > > Claes Redestad has updated the pull request incrementally with one additional > commit since the last revision

Re: RFR: 8340131: Refactor internal makeHiddenClassDefiner to take ClassOption ... instead of Set [v4]

2024-09-14 Thread ExE Boss
On Fri, 13 Sep 2024 23:51:23 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 2223: >> >>> 2221: } >>> : >>> 2223: return makeHiddenClassDefiner(bytes.clone(), false, >>> options.clone()) >> >> Why do we need to clo

Re: RFR: 8340131: Refactor internal makeHiddenClassDefiner to take ClassOption ... instead of Set

2024-09-13 Thread ExE Boss
On Fri, 13 Sep 2024 15:40:46 GMT, Claes Redestad wrote: > Simple internal refactor to load a few classes less on startup. Arguably > cleaner. The private methods don’t need to be `ACC_VARARGS`, also remove excess  whitespace between `ClassOption` and `...` to match the code style of the rest o

Re: RFR: 8325949: Create an internal utility method for creating VarHandle instances [v2]

2024-09-13 Thread ExE Boss
On Thu, 12 Sep 2024 19:30:45 GMT, Chen Liang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rename and reformat > > src/java.base/share/classes/jdk/internal/reflect/MethodHandlesInternal.java > line 1: > >> 1: /*

Re: RFR: 8340082: Use inline return tag in java.base

2024-09-13 Thread ExE Boss
On Fri, 13 Sep 2024 02:47:18 GMT, Joe Darcy wrote: > Candidates for this refactoring were found programmatically; the program to > find candidates is in a comment on the bug. The old version of the doc comments had a `.` at the end of the first sentence: src/java.base/share/classes/java/io/Obj

Re: RFR: 8339876: Move constant symbol caches to Utf8EntryImpl

2024-09-12 Thread ExE Boss
On Wed, 11 Sep 2024 23:31:33 GMT, Chen Liang wrote: > Some type descriptors are validated against generic utf8 entries, such as > field or method types; we can cache a type descriptor wrapping the content of > the utf8 entry if this entry is ever used as a type descriptor. > > This patch is mo

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-10 Thread ExE Boss
On Tue, 10 Sep 2024 21:18:19 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

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

2024-09-07 Thread ExE Boss
On Fri, 6 Sep 2024 19:33:09 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 w

Re: RFR: 8339699: Optimize DataOutputStream writeUTF [v3]

2024-09-07 Thread ExE Boss
On Sat, 7 Sep 2024 08:51:25 GMT, Shaojin Wen wrote: >> PR #20772 introduced an optimization for writeUTF, which can also be used in >> DataOutputStream::writeUTF. > > Shaojin Wen has updated the pull request incrementally with one additional > commit since the last revision: > > reduce JDKUT

Re: RFR: 8339635: StringConcatFactory optimization for CompactStrings off

2024-09-05 Thread ExE Boss
On Tue, 27 Aug 2024 05:08:53 GMT, Shaojin Wen wrote: > A small optimization, when CompactStrings is turned off, the coder method is > not generated, which improves the startup performance The `JLA​.stringInitCoder() != 0` check should probably be the first thing in  this method, so that **C2** 

Re: RFR: 8339576: Speed up raw bytecode processing in ClassFile API

2024-09-04 Thread ExE Boss
On Wed, 4 Sep 2024 22:41:38 GMT, Chen Liang wrote: > Currently, raw bytecode access goes through multiple wrappers, include one > from ClassFile API and another ByteBuffer for merged big endian value reads. > We can merge the ByteBuffer =into the ClassFile API one (RawBytecodeHelper) > for saf

Re: RFR: 8317356: Test ClassFile API if it deals with nulls correctly across the whole API

2024-09-04 Thread ExE Boss
On Mon, 12 Aug 2024 17:23:15 GMT, Nizar Benalla wrote: > The test is inspired from [FFM API's > TestNulls](https://github.com/openjdk/jdk/blob/master/test/jdk/java/foreign/TestNulls.java), > I customized their Null checking framework it to work with ClassFile API. > > The framework for for tes

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 8331189: Implementation of Scoped Values (Third Preview)

2024-05-21 Thread ExE Boss
On Wed, 8 May 2024 09:40:38 GMT, Alan Bateman wrote: > JEP 481 proposes Scoped Values to continue to preview in JDK 23 with one > change. The type of the operation parameter of the callWhere method is > changed to a new functional interface to avoid having the API throw > Exception. With that

Re: RFR: 8307818: Convert Indify tool to Classfile API

2024-05-19 Thread ExE Boss
On Thu, 18 Apr 2024 13:53:34 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 cla

Re: RFR: 8331879: Clean up non-standard use of /// comments in `java.base`

2024-05-17 Thread ExE Boss
On Tue, 7 May 2024 22:23:48 GMT, Jonathan Gibbons wrote: > With the advent of JEP 467, `///` comments may be treated as documentation > comments, and may be subject to the recently new `javac` warning about > "dangling doc comments" in unexpected places. > > In keeping with the policy to keep

Re: RFR: 8330465: Stable Values and Collections (Internal) [v10]

2024-05-16 Thread ExE Boss
On Thu, 16 May 2024 09:01:22 GMT, Per Minborg wrote: >> # Stable Values & Collections (Internal) >> >> ## Summary >> This PR proposes to introduce an internal _Stable Values & Collections_ API, >> which provides immutable value holders where elements are initialized _at >> most once_. Stable V

  1   2   3   4   >