Re: RFR: 8328874: Class::forName0 should validate the class name length early [v14]

2025-09-07 Thread ExE Boss
On Sun, 7 Sep 2025 09:03:56 GMT, Guanqiang Han wrote: >> Validate class name length immediately after GetStringUTFLength() in >> Class.forName0. This prevents potential issues caused by overly long class >> names before they reach later code that would reject them, throwing >> ClassNotFoundExc

Re: RFR: 8328874: Class::forName0 should validate the class name length early [v9]

2025-08-27 Thread ExE Boss
On Thu, 28 Aug 2025 02:13:52 GMT, Jason Mehrens wrote: >> Guanqiang Han has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update Class.java >> >> Use ModifiedUtf.utfLen instead of static import for readability > > src/java.base/share/

Re: RFR: 8366028: MethodType::fromMethodDescriptorString should not throw UnsupportedOperationException for invalid descriptors [v2]

2025-08-25 Thread ExE Boss
On Mon, 25 Aug 2025 14:54:14 GMT, Chen Liang wrote: >> A previous cleanup #14642 accidentally omitted the fact that an >> `Array.newInstance` call in `BytecodeDescriptor::parseSig` is intended to >> propagate `IllegalArgumentException` to >> `MethodType::fromMethodDescriptorString`. This bug i

Re: RFR: 8328874: Class::forName0 should validate the class name length early [v5]

2025-08-23 Thread ExE Boss
meLengthIsValid(String name) { >>> 4160: Objects.requireNonNull(name); >> >> This is not needed as the `name.length()` call already performs an implicit >> `null` check. > > hi @ExE-Boss ,thanks for your comment regarding the > Objects.requireNonNull(nam

Re: RFR: 8328874: Class::forName0 should validate the class name length early [v5]

2025-08-20 Thread ExE Boss
On Wed, 20 Aug 2025 01:30:27 GMT, Guanqiang Han wrote: >> Validate class name length immediately after GetStringUTFLength() in >> Class.forName0. This prevents potential issues caused by overly long class >> names before they reach later code that would reject them, throwing >> ClassNotFoundEx

Re: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs [v2]

2025-08-19 Thread ExE Boss
On Tue, 19 Aug 2025 13:18:49 GMT, Darragh Clarke wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on >> the work that was previously shared in >> https://github.com/openjdk/jdk/pull/22307 , The main change since then is >> that this branch takes advantage of the

Re: RFR: 8328874: Class::forName0 should validate the class name length early [v2]

2025-08-19 Thread ExE Boss
On Tue, 19 Aug 2025 12:54:22 GMT, Guanqiang Han wrote: >> Validate class name length immediately after GetStringUTFLength() in >> Class.forName0. This prevents potential issues caused by overly long class >> names before they reach later code that would reject them, throwing >> ClassNotFoundEx

Re: RFR: 8365620: Using enhanced switch in MethodHandleDesc

2025-08-15 Thread ExE Boss
On Fri, 15 Aug 2025 06:57:14 GMT, Shaojin Wen wrote: >> src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java line >> 123: >> >>> 121: case VIRTUAL, SPECIAL, INTERFACE_VIRTUAL, >>> INTERFACE_SPECIAL, INTERFACE_STATIC, STATIC, CONSTRUCTOR >>> 122:

Re: RFR: 8365533: Remove outdated jdk.internal.javac package export to several modules from java.base

2025-08-14 Thread ExE Boss
On Thu, 14 Aug 2025 10:34:59 GMT, Jaikiran Pai wrote: > Can I please get a review of these change which removes the outdated use of > `jdk.internal.javac.ParticipatesInPreview` and the qualified export of > `jdk.internal.javac` package? This addresses > https://bugs.openjdk.org/browse/JDK-8365

Re: RFR: 8359936: StableValues can release the underlying function after complete computation [v4]

2025-08-11 Thread ExE Boss
On Mon, 11 Aug 2025 15:55:02 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add a new method to StableValueImpl for improved speed > > src/java.base/share/classes/jdk/internal/lang/stable/StableVa

Re: RFR: 8364752: Class java.time.Instant cannot parse all ISO 8601 date formats

2025-08-09 Thread ExE Boss
On Fri, 8 Aug 2025 22:37:36 GMT, Naoto Sato wrote: > `Instant.parse()` is expected to use the offset zone pattern `+HH:mm:ss` (as > defined by `DateTimeFormatterBuilder.appendOffsetId()`), but it fails to > parse hour-only offsets such as `+02`. This is because the actual > implementation uses

Re: RFR: 8351996: Behavioral updates for ClassValue::remove [v12]

2025-08-07 Thread ExE Boss
On Thu, 8 May 2025 16:06:27 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/ClassValue.java line 241: >> >>> 239: } else { >>> 240: throw ex instanceof Error err ? err : new >>> Error(ex); >>> 241: } >> >> Hello Chen, i think

Re: RFR: 8364588: Export the NPE backtracking functionality to general null-checking APIs [v4]

2025-08-06 Thread ExE Boss
On Wed, 6 Aug 2025 06:55:54 GMT, David Holmes wrote: >> https://openjdk.org/jeps/492 > > And now final - https://openjdk.org/jeps/513 > > Thanks It’s necessary to do this before the `this()`/`super()` call, as the  `Throwable(…)` constructors call `this.fillInStackTrace()`: https://github.com/o

Re: RFR: 8361730: The CodeBuilder.trying(BlockCodeBuilder,CatchBuilder) method generates corrupted bytecode in certain cases

2025-08-03 Thread ExE Boss
On Fri, 1 Aug 2025 18:05:54 GMT, Chen Liang wrote: > Explicitly document that BlockCodeBuilder expects control flow to continue > after it merges back to the parent block, so failure to do that by the users > can lead to malformed code. This is better than introducing complex and > costly anal

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v7]

2025-08-02 Thread ExE Boss
On Fri, 1 Aug 2025 20:13:45 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1108: >> >>> 1106: if (result < 0) { >>> 1107: String type = switch ((int) result) { >>> 1108: case -2 -> "a static field"; >> >> Suggestion:

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v7]

2025-08-01 Thread ExE Boss
On Fri, 1 Aug 2025 16:16:01 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8364187: Make getClassAccessFlagsRaw non-native [v2]

2025-08-01 Thread ExE Boss
On Wed, 30 Jul 2025 10:57:33 GMT, Coleen Phillimore wrote: >> I mean the existing private fields of `SharedSecrets`[^1] so that the JIT is  >> able to constant fold calls to `SharedSecrets​::getJava*Access()` so that it  >> becomes equally as performant as using a `Holder` class. >> >> Modifiers

Re: RFR: 8364187: Make getClassAccessFlagsRaw non-native [v3]

2025-07-29 Thread ExE Boss
On Tue, 29 Jul 2025 19:58:10 GMT, Coleen Phillimore wrote: >> This change removes the intrinsic for getClassAccessFlagsRaw for reflection >> and initializes an rawAccessFlags field in java.lang.Class instead, that >> Java code can non-natively access. >> Tested with tier1-4. > > Coleen Phillimo

Re: RFR: 8364187: Make getClassAccessFlagsRaw non-native [v2]

2025-07-29 Thread ExE Boss
On Tue, 29 Jul 2025 19:46:06 GMT, Coleen Phillimore wrote: >> Arguably, the fields in `SharedSecrets` should be made `@Stable`. > > Okay, I'll remove the Holder class. I copied it from another method in the > file. yeah, sorry for the additional shared secret but I didn't want to make > the j

Re: RFR: 8364187: Make getClassAccessFlagsRaw non-native [v2]

2025-07-29 Thread ExE Boss
On Tue, 29 Jul 2025 14:52:53 GMT, Roger Riggs wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Rename getRawClassAccessFlags to getClassFileAccessFlags and fix the test >> to reflect what the JVM does. > > src

Re: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs

2025-07-26 Thread ExE Boss
On Fri, 30 May 2025 12:00:28 GMT, Darragh Clarke wrote: > This PR aims to Panamize the Java Kqueue implementation, This is based on the > work that was previously shared in https://github.com/openjdk/jdk/pull/22307 > , The main change since then is that this branch takes advantage of the > cha

Re: RFR: 8360025: (se) Convert kqueue Selector Implementation to use FFM APIs

2025-07-26 Thread ExE Boss
On Thu, 19 Jun 2025 08:08:10 GMT, Per Minborg wrote: >> This PR aims to Panamize the Java Kqueue implementation, This is based on >> the work that was previously shared in >> https://github.com/openjdk/jdk/pull/22307 , The main change since then is >> that this branch takes advantage of the ch

Re: RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation [v3]

2025-07-19 Thread ExE Boss
On Thu, 17 Jul 2025 21:40:13 GMT, Joe Darcy wrote: >> Add `@Stable` to the static final arrays used in the Java port of FDLIBM. > > Joe Darcy has updated the pull request incrementally with one additional > commit since the last revision: > > Implement review feedback. src/java.base/share/cl

Re: RFR: 8361842: Validate input in both Java and C++ for java.lang.StringCoding intrinsics

2025-07-10 Thread ExE Boss
On Fri, 27 Jun 2025 13:24:52 GMT, Chen Liang wrote: >> But the original code already checks for `len >= 0`, right? See >> `LibraryCallKit::inline_countPositives` -> `generate_string_range_check` -> >> `// Offset and count must not be negative` >> >> This PR is about moving the range checks fro

Re: RFR: 8361526: Synchronize ClassFile API verifier with hotspot

2025-07-08 Thread ExE Boss
On Mon, 7 Jul 2025 23:21:58 GMT, Chen Liang wrote: > The class file API verifier seems to be based off a version of hotspot > verifier before Mar 3 2021. We are thus missing a few patches in the hotspot > verifier: > [JDK-8350029](https://bugs.openjdk.org/browse/JDK-8350029) > [JDK-8340110](ht

Re: RFR: 8361300: Document exceptions for Unsafe offset methods [v4]

2025-07-06 Thread ExE Boss
On Thu, 3 Jul 2025 18:41:27 GMT, Chen Liang wrote: >> Unsafe throws IAE for misusing static vs instance fields, and it's revealed >> that AtomicXxxFieldUpdaters are using this mechanism to reject static >> fields. This is not a good practice, but we can at least document this so we >> don't ac

Re: RFR: 8361300: Document exceptions for Unsafe offset methods

2025-07-02 Thread ExE Boss
On Tue, 24 Jun 2025 00:04:54 GMT, Chen Liang wrote: > Unsafe throws IAE for misusing static vs instance fields, and it's revealed > that AtomicXxxFieldUpdaters are using this mechanism to reject static fields. > This is not a good practice, but we can at least document this so we don't > accid

Re: RFR: 8360884: Better scoped values [v4]

2025-07-01 Thread ExE Boss
On Tue, 1 Jul 2025 15:41:45 GMT, Alan Bateman wrote: >> Andrew Haley has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 8360884: Better scoped values >> - 8360884: Better scoped values > > src/java.base/share/classes/java/lang/ScopedValu

Re: RFR: 8360037: Refactor ImageReader in preparation for Valhalla support

2025-07-01 Thread ExE Boss
On Mon, 30 Jun 2025 23:27:49 GMT, David Beaumont wrote: > Refactoring `ImageReader` to make it easy to add preview mode functionality > for Valhalla. > > This PR is a large change to `ImageReader` (effectively a rewrite) but > reduces the surface area of the API significantly, reduces code com

Re: RFR: 8360884: Better scoped values [v3]

2025-07-01 Thread ExE Boss
On Tue, 1 Jul 2025 08:21:10 GMT, Andrew Haley wrote: >> src/java.base/share/classes/java/lang/ScopedValue.java line 802: >> >>> 800: return x; >>> 801: } >>> 802: }; >> >> There's something a bit uncomfortable about initializing hashGe

Re: RFR: 8361018: Eliminate unnecessary buffering and encoding conversion in BufferedWriter

2025-06-29 Thread ExE Boss
On Fri, 27 Jun 2025 16:48:40 GMT, Shaojin Wen wrote: > BufferedWriter -> OutputStreamWriter -> StreamEncoder > > In this call chain, BufferedWriter has a char[] buffer, and StreamEncoder has > a ByteBuffer. There are two layers of cache here, or the BufferedWriter layer > can be removed. And w

Re: RFR: 8360303: Remove two unused invoke files

2025-06-24 Thread ExE Boss
On Mon, 23 Jun 2025 22:48:52 GMT, Chen Liang wrote: > sun.invoke.empty.Empty and java.lang.invoke.InvokeDynamic are useless > remnants - Empty can be replaced by java.lang.Void, and InvokeDynamic was > previously used as a stub for javac to compile signature polymorphic methods. > They should

Re: RFR: 8360045: StringTokenizer.hasMoreTokens() throws NPE after nextToken(null)

2025-06-23 Thread ExE Boss
On Mon, 23 Jun 2025 20:14:36 GMT, Naoto Sato wrote: > Fixing the side-effect caused by calling `StringTokenizer.nextToken(null)`, > where the delimiter is set to `null` even if the method throws an NPE. Note that as mentioned in the bug discussion, the same also occurs when doing `new StringTo

Re: RFR: 8359936: StableValues can release the underlying function after complete computation [v3]

2025-06-19 Thread ExE Boss
On Thu, 19 Jun 2025 09:59:41 GMT, Per Minborg wrote: >> This PR proposes to release the underlying function if a stable function or >> collection has invoked its underlying supplier exhaustively so that it can >> be collected. >> >> This PR passes tier1, tier2, and tier3 testing on multiple pl

Re: RFR: 8359424: Eliminate table lookup in Integer/Long toHexString

2025-06-14 Thread ExE Boss
On Tue, 7 Jan 2025 10:39:18 GMT, Shaojin Wen wrote: > In PR #22928, UUID introduced long-based vectorized hexadecimal to string > conversion, which can also be used in Integer::toHexString and > Long::toHexString to eliminate table lookups. The benefit of eliminating > table lookups is that th

Re: RFR: 8358078: javap crashes with NPE on preview class file [v3]

2025-06-02 Thread ExE Boss
On Mon, 2 Jun 2025 20:06:34 GMT, Hannes Greule wrote: >> This change addresses a NPE in javap when trying to print a class with >> minorVersion != 0. With this change, we fall back to the methods that don't >> take a `ClassFileFormatVersion` in such case. > > Hannes Greule has updated the pull

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-05-30 Thread ExE Boss
On Wed, 28 May 2025 13:39:40 GMT, Shaojin Wen wrote: >> Some static final arrays of BigInteger and BigDecimal are stable and >> immutable. We should add `@Stable` to give the optimizer more information > > Shaojin Wen has updated the pull request incrementally with one additional > commit since

Re: RFR: 8357637: Native resources cached in thread locals not released when FJP common pool threads clears thread locals

2025-05-30 Thread ExE Boss
On Tue, 27 May 2025 12:14:16 GMT, Viktor Klang wrote: >> A ForkJoinPool can be created with worker threads that clear thread locals >> between tasks, thus avoiding a build up of thread locals left behind by >> tasks executed in the pool. The common pool does this. Erasing thread locals >> (by

Re: RFR: 8358015: Fix SequencedMap sequenced view method specifications

2025-05-29 Thread ExE Boss
On Thu, 29 May 2025 00:21:35 GMT, Stuart Marks wrote: > For a full explanation, see the bug report > [JDK-8358015](https://bugs.openjdk.org/browse/JDK-8358015). > > This PR includes three related changes: > * New overrides in SequencedMap view collection implementations, which > improve their

Re: RFR: 8282429: StringBuilder/StringBuffer.toString() skip compressing for UTF16 strings [v5]

2025-05-29 Thread ExE Boss
On Wed, 23 Mar 2022 00:35:14 GMT, Xin Liu wrote: >> If AbstractStringBuilder only grow, the inflated value which has been >> encoded in UTF16 can't be compressed. >> toString() can skip compression in this case. This can save an >> ArrayAllocation in StringUTF16::compress(). >> >> java.io.Buf

Re: RFR: 8357690: Add @Stable and final to java.lang.CharacterDataLatin1 and other CharacterData classes [v3]

2025-05-28 Thread ExE Boss
On Tue, 27 May 2025 19:32:33 GMT, Shaojin Wen wrote: >> Classes such as java.lang.CharacterDataXXX have multiple static final >> arrays, these are immutable, We should add `@Stable` and final to provide >> information to the optimizer. > > Shaojin Wen has updated the pull request incrementally

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread ExE Boss
On Sun, 25 May 2025 22:35:56 GMT, Shaojin Wen wrote: > Some static final arrays of BigInteger and BigDecimal are stable and > immutable. We should add `@Stable` to give the optimizer more information Note that `BigInteger.mag` should probably also be made `@Stable` once  `BigInteger​.largePrime

Re: RFR: 8357798: ReverseOrderListView allocates Boolean boxes

2025-05-27 Thread ExE Boss
On Mon, 26 May 2025 17:08:45 GMT, Aleksey Shipilev wrote: > SonarCloud complains that since > [JDK-8356080](https://bugs.openjdk.org/browse/JDK-8356080) we are allocating > and using `Boolean` boxes in `ReverseOrderListView`. This change `boolean` -> > `Boolean` was made in > [JDK-8356080](ht

Re: RFR: 8344332: (bf) Migrate DirectByteBuffer away from jdk.internal.ref.Cleaner [v2]

2025-05-19 Thread ExE Boss
On Sun, 18 May 2025 20:50:41 GMT, Kim Barrett wrote: >> src/java.base/share/classes/jdk/internal/nio/Cleaner.java line 26: >> >>> 24: */ >>> 25: >>> 26: package jdk.internal.nio; >> >> The implementation/internal classes for this area are in sun.nio (for >> historical reasons). Probably best

Re: RFR: 8344332: (bf) Migrate DirectByteBuffer away from jdk.internal.ref.Cleaner [v2]

2025-05-19 Thread ExE Boss
On Sun, 18 May 2025 20:55:48 GMT, Kim Barrett wrote: >> This change makes java.nio no longer use jdk.internal.ref.Cleaner to manage >> native memory for Direct-X-Buffers. Instead it uses bespoke PhantomReferences >> and a dedicated ReferenceQueue. This differs from PR 22165, which proposed to >>

Re: RFR: 8356632: Fix remaining {@link/@linkplain} tags with refer to private/protected types in java.base

2025-05-19 Thread ExE Boss
On Sun, 18 May 2025 02:17:46 GMT, Chen Liang wrote: >> Please review this patch to fix some `javadoc` bugs in `java.base`. >> Certain `@link` tags used to refer to private fields instead of public APIs. >> >> A couple of `@see` tags in the [serialization >> page](https://download.java.net/java/

Re: RFR: 8350607: Consolidate MethodHandles::zero into MethodHandles::constant [v2]

2025-05-17 Thread ExE Boss
On Mon, 24 Feb 2025 23:45:37 GMT, Chen Liang wrote: >> LF editor spins classes, this avoids the spinning overhead and should speed >> up non-capturing lambdas too. >> >> There may need to be additional intrinsic work for MH combinator lf bytecode >> generation. > > Chen Liang has updated the p

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

2025-05-15 Thread ExE Boss
On Wed, 19 Jun 2024 09:08:35 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: 8356993: ArrayDeque should use Arrays.fill() instead of for() loops [v2]

2025-05-15 Thread ExE Boss
On Thu, 15 May 2025 17:46:39 GMT, Archie Cobbs wrote: >> Please review this small performance tweak `ArrayDeque`. >> >> `ArrayDeque` has an invariant in which any unused elements in the array must >> be null. In a couple of places, the code is setting contiguous ranges of >> elements to null u

Re: RFR: 8143850: Add indexed get() and set() methods to ArrayDeque

2025-05-13 Thread ExE Boss
On Mon, 12 May 2025 18:24:27 GMT, Archie Cobbs wrote: > Because it is backed by an array, the `ArrayDeque` class has the ability to > get and replace any element in the list (accessed by index) in constant time. > However, this capability is not exposed in the API. > > Please review this PR wh

Re: RFR: 8356255: Add Stable Field Updaters to allow efficient lazy field evaluations [v7]

2025-05-07 Thread ExE Boss
On Wed, 7 May 2025 15:03:57 GMT, Per Minborg wrote: >> This sketch shows how "Stable Updaters" can be used to create stable >> computations of `@Stable` fields. Only one updater is needed per class, >> similar to `AtomicIntegerFieldUpdater`. > > Per Minborg has updated the pull request incremen

Re: RFR: 8356255: Add Stable Field Updaters to allow efficient lazy field evaluations [v6]

2025-05-07 Thread ExE Boss
On Wed, 7 May 2025 14:58:33 GMT, Per Minborg wrote: >> This sketch shows how "Stable Updaters" can be used to create stable >> computations of `@Stable` fields. Only one updater is needed per class, >> similar to `AtomicIntegerFieldUpdater`. > > Per Minborg has updated the pull request incremen

Re: RFR: 8356255: Add Stable Field Updaters to allow efficient lazy field evaluations

2025-05-06 Thread ExE Boss
On Mon, 5 May 2025 13:41:22 GMT, Per Minborg wrote: > This sketch shows how "Stable Updaters" can be used to create stable > computations of `@Stable` fields. Only one updater is needed per class, > similar to `AtomicIntegerFieldUpdater`. src/java.base/share/classes/jdk/internal/lang/stable/St

Re: RFR: 8356080: Address post-integration comments for Stable Values

2025-05-06 Thread ExE Boss
On Fri, 2 May 2025 13:56:19 GMT, Shaojin Wen wrote: >> This PR proposes to address comments in the initial PR for Stable Values, >> which were deferred until after integration. >> >> Unfortunately, this PR shows the total commit history for stable values. > > src/java.base/share/classes/jdk/int

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

2025-05-05 Thread ExE Boss
On Mon, 5 May 2025 17:13:02 GMT, Per Minborg wrote: >> As we advance, 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 >> neg

Re: RFR: 8356126: Revisit CaptureCallState [v4]

2025-05-04 Thread ExE Boss
On Mon, 5 May 2025 04:50:30 GMT, Chen Liang wrote: >> Credit to @lukellmann that the duplication arg handling in #24742 avoided >> throwing exceptions but produced a wrong option. This patch fixes that and >> removed stream usages in CaptureCallState to speed up bootstrap. >> >> Also, the prev

Re: RFR: 8355022: Implement JEP 506: Scoped Values [v3]

2025-05-02 Thread ExE Boss
On Tue, 29 Apr 2025 07:54:23 GMT, Andrew Haley wrote: >> Propose to finalize scoped values. >> The only functional change is that the orElse() method no longer accepts a >> null argument. > > Andrew Haley has updated the pull request incrementally with one additional > commit since the last rev

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread ExE Boss
On Wed, 30 Apr 2025 17:45:04 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8347471: Provide valid flags and mask in AccessFlag.Location [v8]

2025-04-29 Thread ExE Boss
On Sun, 27 Apr 2025 17:29:32 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/reflect/AccessFlag.java line 722: >> >>> 720: } >>> 721: >>> 722: private static final class AccessFlagSet extends >>> AbstractSet { >> >> This should probably also define the spliterator meth

Re: RFR: 8355720: Implement JEP 506: Scoped Values

2025-04-29 Thread ExE Boss
On Mon, 28 Apr 2025 14:32:04 GMT, Andrew Haley wrote: > Propose to finalize scoped values. > The only functional change is that the orElse() method no longer accepts a > null argument. src/java.base/share/classes/java/lang/ScopedValue.java line 614: > 612: */ > 613: public T orElse(T

Re: RFR: 8347471: Provide valid flags and mask in AccessFlag.Location [v8]

2025-04-27 Thread ExE Boss
On Sat, 26 Apr 2025 19:44:02 GMT, Chen Liang wrote: >> Some AccessFlag parsing methods throw IAE because a flag mask is not valid >> in a location. However, there is no easy way to check what flag mask bits or >> what flags are valid for a location. We need such APIs to check, specific to >> e

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

  1   2   3   4   >