Re: RFR: 8365858: FilteredJavaFieldStream is unnecessary

2025-09-15 Thread Coleen Phillimore
On Thu, 11 Sep 2025 08:35:05 GMT, Paul Hübner wrote: > Hi all, > > `FilteredJavaFieldStream` purely exists to hide the field `constantPoolOop` > in `jdk.internal.reflect.ConstantPool`. This PR: > 1) refactors `constantPoolOop` to be a hidden VM injected field `vmholder` > (name to be consisten

Re: RFR: 8365858: FilteredJavaFieldStream is unnecessary

2025-09-15 Thread Coleen Phillimore
On Thu, 11 Sep 2025 08:35:05 GMT, Paul Hübner wrote: > Hi all, > > `FilteredJavaFieldStream` purely exists to hide the field `constantPoolOop` > in `jdk.internal.reflect.ConstantPool`. This PR: > 1) refactors `constantPoolOop` to be a hidden VM injected field `vmholder` > (name to be consisten

Re: RFR: 8366255: Remove 'package_to_module' function from imageFile.cpp

2025-08-27 Thread Coleen Phillimore
On Wed, 27 Aug 2025 17:44:04 GMT, David Beaumont wrote: > Removing the 'package_to_module' function from imageFile.cpp and the > associated JNI export. > This code isn't used or referenced from anywhere, and removing it makes > adapting the package flags for use with preview mode simpler. > >

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

2025-08-05 Thread Coleen Phillimore
On Tue, 5 Aug 2025 15:14:06 GMT, Roger Riggs wrote: >> src/hotspot/share/prims/jvm.cpp line 1744: >> >>> 1742: JVM_END >>> 1743: >>> 1744: JVM_ENTRY(jint, JVM_GetClassAccessFlags(JNIEnv *env, jclass cls)) >> >> What about the declaration in `jvm.h`? >> https://github.com/openjdk/jdk/blob/6c52

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

2025-08-01 Thread Coleen Phillimore
On Tue, 29 Jul 2025 14:35:06 GMT, Chen Liang wrote: >> This is a good suggestion but I made it Raw to match getRawClassAnnotations >> this name. > > Thanks for the rename. I think `raw annotations` means the uninterpreted byte > data in the attribute is carried over raw; this concept is less ap

Integrated: 8364187: Make getClassAccessFlagsRaw non-native

2025-08-01 Thread Coleen Phillimore
On Mon, 28 Jul 2025 20:14:15 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. This pull

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

2025-08-01 Thread Coleen Phillimore
On Fri, 1 Aug 2025 15:10:02 GMT, Roger Riggs wrote: >> I don’t have a **JBS** account, and I don’t like going through >> , so could someone else file said **RFE**? > > Created https://bugs.openjdk.org/browse/JDK-8364540 Thanks Roger. - PR Review Comment

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

2025-08-01 Thread Coleen Phillimore
On Wed, 30 Jul 2025 19:25:34 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

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

2025-07-31 Thread Coleen Phillimore
On Wed, 30 Jul 2025 20:25:22 GMT, Roger Riggs wrote: >> For IDENTITY, I didn't have to inject that one because the Java code knew >> when to set it, not the JVM code reading the data out of the classfile. And >> the logic belongs in the Java code, not the JVM. This one comes from the >> class

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

2025-07-30 Thread Coleen Phillimore
> 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 Phillimore has updated the pull request incrementally with one

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

2025-07-30 Thread Coleen Phillimore
On Wed, 30 Jul 2025 12:21:14 GMT, Tobias Hartmann wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update src/java.base/share/classes/jdk/internal/reflect/Reflection.java >>

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

2025-07-30 Thread Coleen Phillimore
> 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 Phillimore has updated the pull request incrementally with one

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

2025-07-30 Thread Coleen Phillimore
On Tue, 29 Jul 2025 21:59:41 GMT, ExE Boss wrote: >> 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 java.lang.Class method public. >> >> I didn't add a field to SharedSecrets, a

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

2025-07-29 Thread Coleen Phillimore
On Tue, 29 Jul 2025 14:49:33 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 >>

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

2025-07-29 Thread Coleen Phillimore
> 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 Phillimore has updated the pull request incrementally with one

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

2025-07-29 Thread Coleen Phillimore
On Tue, 29 Jul 2025 16:40:22 GMT, ExE Boss wrote: >> src/java.base/share/classes/jdk/internal/reflect/Reflection.java line 87: >> >>> 85: class Holder { >>> 86: static final JavaLangAccess JLA = >>> SharedSecrets.getJavaLangAccess(); >>> 87: } >> >> Yuck, another cl

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

2025-07-29 Thread Coleen Phillimore
On Tue, 29 Jul 2025 15:22:53 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Class.java line 248: >> >>> 246: protectionDomain = pd; >>> 247: primitive = isPrim; >>> 248: classFileAccessFlags = flags; >> >> Its not that hard to add a field, why not have d

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

2025-07-29 Thread Coleen Phillimore
> 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 Phillimore has updated the pull request incrementally with one

Re: RFR: 8364187: Make getClassAccessFlagsRaw non-native

2025-07-29 Thread Coleen Phillimore
On Mon, 28 Jul 2025 21:56:16 GMT, Chen Liang 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. > > src/java.base/share/cl

RFR: 8364187: Make getClassAccessFlagsRaw non-native

2025-07-28 Thread Coleen Phillimore
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. - Commit messages: - The only caller for getRawClassAccessFlags in Class.java

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph [v2]

2025-07-22 Thread Coleen Phillimore
On Tue, 22 Jul 2025 16:27:18 GMT, Ioi Lam wrote: >> The CDS full module graph is supposed to contain a snapshot of the boot >> layer, which has 3 unnamed modules for the boot, platform and system class >> loaders. Each unnamed module is represented by a `java.lang.Module` Java >> object and a

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Coleen Phillimore
On Thu, 17 Jul 2025 22:41:34 GMT, Ioi Lam wrote: >> If you're storing the unnamed module oop in the archive should this method >> not be called? If it is, what are you saving by archiving the unnamed >> module? > > The callstack is: > > > jdk.internal.loader.BootLoader.setBootLoaderUnnamedMo

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Coleen Phillimore
On Wed, 2 Jul 2025 00:18:28 GMT, Ioi Lam wrote: > The CDS full module graph is supposed to contain a snapshot of the boot > layer, which has 3 unnamed modules for the boot, platform and system class > loaders. Each unnamed module is represented by a `java.lang.Module` Java > object and a `Modu

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-17 Thread Coleen Phillimore
On Thu, 17 Jul 2025 12:29:39 GMT, Coleen Phillimore wrote: >> The CDS full module graph is supposed to contain a snapshot of the boot >> layer, which has 3 unnamed modules for the boot, platform and system class >> loaders. Each unnamed module is represented by a `java

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-17 Thread Coleen Phillimore
On Wed, 2 Jul 2025 00:18:28 GMT, Ioi Lam wrote: > The CDS full module graph is supposed to contain a snapshot of the boot > layer, which has 3 unnamed modules for the boot, platform and system class > loaders. Each unnamed module is represented by a `java.lang.Module` Java > object and a `Modu

Re: RFR: 8359437: Make users and test suite not able to set LockingMode flag [v6]

2025-06-25 Thread Coleen Phillimore
On Wed, 25 Jun 2025 11:26:22 GMT, Anton Artemov wrote: >> This PR contains changes for the 1st phase of the `LockingMode` flag >> obsoletion. >> >> The work is done by @fbredber, I have taken it over and am finishing it >> while he's on vacation. >> >> In the 1st phase one keeps the `Lockin

Re: RFR: 8359437: Make users and test suite not able to set LockingMode flag [v5]

2025-06-25 Thread Coleen Phillimore
On Tue, 24 Jun 2025 09:12:00 GMT, Anton Artemov wrote: >> test/jtreg-ext/requires/VMProps.java line 424: >> >>> 422: * Note: Lightweight locking does not support RTM (for now). >>> 423: */ >>> 424: protected String vmRTMCompiler() { >> >> [JDK-8358542](https://bugs.openjdk.org/bro

Re: RFR: 8359437: Make users and test suite not able to set LockingMode flag

2025-06-23 Thread Coleen Phillimore
On Wed, 18 Jun 2025 07:52:02 GMT, David Holmes wrote: >> This PR contains changes for the 1st phase of the `LockingMode` flag >> obsoletion. >> >> The work is done by @fbredber, I have taken it over and am finishing it >> while he's on vacation. >> >> In the 1st phase one keeps the `Locking

Re: RFR: 8359437: Make users and test suite not able to set LockingMode flag

2025-06-23 Thread Coleen Phillimore
On Tue, 17 Jun 2025 08:39:49 GMT, Anton Artemov wrote: > This PR contains changes for the 1st phase of the `LockingMode` flag > obsoletion. > > The work is done by @fbredber, I have taken it over and am finishing it while > he's on vacation. > > In the 1st phase one keeps the `LockingMode`

Re: RFR: 8355746: Start of release updates for JDK 26 [v5]

2025-05-29 Thread Coleen Phillimore
On Thu, 29 May 2025 13:42:34 GMT, Nizar Benalla wrote: >> Get JDK 26 underway. > > Nizar Benalla has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 16 commits: > > - Merge branch 'master' into jdk.8355746 > - Merge branch 'master' i

Re: RFR: 8352088: Call of com.sun.jdi.ThreadReference.threadGroups() can lock up target VM [v4]

2025-03-27 Thread Coleen Phillimore
On Wed, 26 Mar 2025 20:50:36 GMT, Chris Plummer wrote: >> Calling ThreadGroupReference.groups() from an event handler can cause a >> deadlock. Details in first comment. Tested with :jdk_lang on all supported >> platforms and tier1, tier2, tier3, and tier5 svc testing. > > Chris Plummer has upda

Integrated: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-25 Thread Coleen Phillimore
On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore wrote: > Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes.

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v8]

2025-02-25 Thread Coleen Phillimore
On Mon, 24 Feb 2025 19:30:41 GMT, Coleen Phillimore wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JV

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v7]

2025-02-24 Thread Coleen Phillimore
On Mon, 24 Feb 2025 19:06:30 GMT, Roger Riggs wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use modifiers field directly in isInterface. > > src/java.base/share/classes

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v8]

2025-02-24 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v7]

2025-02-24 Thread Coleen Phillimore
On Sat, 22 Feb 2025 14:49:38 GMT, Coleen Phillimore wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JV

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v7]

2025-02-24 Thread Coleen Phillimore
On Thu, 20 Feb 2025 23:23:08 GMT, Coleen Phillimore wrote: >>> ... but not in the return since the caller likely will fetch the klass >>> pointer next. >> >> I notice that too. Callers are using is_primitive() to short-circuit calls >> to as_Klass(), which

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v7]

2025-02-24 Thread Coleen Phillimore
On Wed, 19 Feb 2025 05:12:38 GMT, David Holmes wrote: > Does the SA not need any updates in relation to this? No, the SA doesn't know about these compiler intrinsics. - PR Comment: https://git.openjdk.org/jdk/pull/23572#issuecomment-2678913119

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v7]

2025-02-22 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]

2025-02-22 Thread Coleen Phillimore
On Fri, 21 Feb 2025 21:08:33 GMT, Dean Long wrote: >> Indeed, even though this checks for the specific bit so widening has no >> effect, it is better to be cautious here. > >> I don't use the field directly because the field is a short and getModifiers >> makes it into Modifier. > > But getMod

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v6]

2025-02-21 Thread Coleen Phillimore
On Wed, 19 Feb 2025 14:21:47 GMT, Coleen Phillimore wrote: >> src/hotspot/share/prims/jvm.cpp line 1262: >> >>> 1260: JVM_END >>> 1261: >>> 1262: JVM_ENTRY(jboolean, JVM_IsArrayClass(JNIEnv *env, jclass cls)) >> >> Where are t

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]

2025-02-21 Thread Coleen Phillimore
On Thu, 20 Feb 2025 23:38:34 GMT, Chen Liang wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix whitespace > > You are right, using the field directly is indeed better.

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v6]

2025-02-21 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]

2025-02-20 Thread Coleen Phillimore
On Thu, 20 Feb 2025 20:19:15 GMT, Coleen Phillimore wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JV

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]

2025-02-20 Thread Coleen Phillimore
On Wed, 19 Feb 2025 21:16:51 GMT, Dean Long wrote: >> This is a good question. The heapwalker walks through dead mirrors so I >> can't assert that a null klass field matches our boolean setting but I don't >> know why this never asserts (can't find any instances in the bug database) >> but it

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v5]

2025-02-20 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v4]

2025-02-20 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v3]

2025-02-20 Thread Coleen Phillimore
On Thu, 20 Feb 2025 04:29:04 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Class.java line 1297: >> >>> 1295: // The componentType field's null value is the sole indication >>> that the class is an array, >>> 1296: // see isArray(). >>> 1297: private transient fina

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore wrote: > Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes.

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v3]

2025-02-19 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 05:01:53 GMT, David Holmes wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JVM code initializes. >> Tested wit

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v2]

2025-02-19 Thread Coleen Phillimore
> Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes. > Tested with tier1-4 and performance tests. Coleen Ph

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 15:42:54 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Class.java line 1009: >> >>> 1007: private transient Object classData; // Set by VM >>> 1008: private transient Object[] signers; // Read by VM, mutable >>> 1009: private final transient char

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v2]

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 17:10:09 GMT, Coleen Phillimore wrote: >> It was. Before the componentType field was reused for the class >> initialization monitor int array, and it caused problems with core >> reflection if a program reflectively accesses this field after a few hund

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native [v2]

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 15:07:57 GMT, Roger Riggs wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Code review comments. > > src/hotspot/share/prims/jvm.cpp line 2284: >

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 16:19:22 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/Class.java line 1287: >> >>> 1285: */ >>> 1286: public Class getComponentType() { >>> 1287: // Only return for array types. Storage may be reused for >>> Class for instance types. >> >

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 02:54:05 GMT, Dean Long wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JVM code initializes. >> Tested with t

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore wrote: > Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes.

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-19 Thread Coleen Phillimore
On Wed, 19 Feb 2025 02:54:36 GMT, Chen Liang wrote: >> I don't know if we have a style guide that covers this, but I believe the >> method and field could both be named `isPrimitive`. > > I would personally name such a boolean field `primitive`, but I don't have a > strong preference on the fie

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-18 Thread Coleen Phillimore
On Wed, 12 Feb 2025 00:05:13 GMT, Chen Liang wrote: >> Class.isInterface() can check modifier flags, Class.isArray() can check >> whether component mirror is non-null and Class.isPrimitive() needs a new >> final transient boolean in java.lang.Class that the JVM code initializes. >> Tested with

Re: RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-18 Thread Coleen Phillimore
On Tue, 11 Feb 2025 20:56:39 GMT, Coleen Phillimore wrote: > Class.isInterface() can check modifier flags, Class.isArray() can check > whether component mirror is non-null and Class.isPrimitive() needs a new > final transient boolean in java.lang.Class that the JVM code initializes.

RFR: 8349860: Make Class.isArray(), Class.isInterface() and Class.isPrimitive() non-native

2025-02-18 Thread Coleen Phillimore
Class.isInterface() can check modifier flags, Class.isArray() can check whether component mirror is non-null and Class.isPrimitive() needs a new final transient boolean in java.lang.Class that the JVM code initializes. Tested with tier1-4 and performance tests. - Commit messages: -

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v7]

2025-02-12 Thread Coleen Phillimore
On Mon, 10 Feb 2025 13:23:49 GMT, Coleen Phillimore wrote: >> This change removes the native call and injected field for ProtectionDomain >> in the java.lang.Class instance, and moves the field to be declared in Java. >> Tested with tier1-4. > > Coleen Phillimore has

Integrated: 8349145: Make Class.getProtectionDomain() non-native

2025-02-12 Thread Coleen Phillimore
On Fri, 31 Jan 2025 16:39:35 GMT, Coleen Phillimore wrote: > This change removes the native call and injected field for ProtectionDomain > in the java.lang.Class instance, and moves the field to be declared in Java. > Tested with tier1-4. This pull request has now been integrated.

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v7]

2025-02-10 Thread Coleen Phillimore
On Tue, 4 Feb 2025 16:56:53 GMT, Coleen Phillimore wrote: >> Aside from JVMTI (CFLH for example), is there anything left in the VM that >> needs this? The last param to JVM_DefineClassWithSource has the location >> from the code source if available. > > The VM doesn&#x

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-10 Thread Coleen Phillimore
On Mon, 10 Feb 2025 10:09:59 GMT, David Holmes wrote: >> Because the field is final, it has to be initialized in the constructor in >> Java code. My initial patch for modifiers chose to initialize to zero but >> that's not quite correct. The constructor cannot be called nor can it be >> made

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v7]

2025-02-10 Thread Coleen Phillimore
> This change removes the native call and injected field for ProtectionDomain > in the java.lang.Class instance, and moves the field to be declared in Java. > Tested with tier1-4. Coleen Phillimore has updated the pull request with a new target base due to a merge or a rebase. The pul

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

2025-02-10 Thread Coleen Phillimore
On Fri, 7 Feb 2025 12:34:40 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&#x

Integrated: 8346567: Make Class.getModifiers() non-native

2025-02-10 Thread Coleen Phillimore
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 nee

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

2025-02-07 Thread Coleen Phillimore
On Fri, 7 Feb 2025 19:58:12 GMT, Vladimir Ivanov wrote: > Good point. Moreover, it seems most of intrinsics on Class queries can be > replaced with a flag bit check on the mirror. (Do we have 16 unused bits in > Class::modifiers after this change?) Yes, I think so. isArray and isPrimitive def

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

2025-02-07 Thread Coleen Phillimore
On Fri, 7 Feb 2025 12:34:40 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&#x

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

2025-02-07 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-06 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-06 Thread Coleen Phillimore
On Thu, 6 Feb 2025 14:31:28 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&#x

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v6]

2025-02-06 Thread Coleen Phillimore
> This change removes the native call and injected field for ProtectionDomain > in the java.lang.Class instance, and moves the field to be declared in Java. > Tested with tier1-4. Coleen Phillimore has updated the pull request incrementally with one additional commit since the last

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v5]

2025-02-06 Thread Coleen Phillimore
On Thu, 6 Feb 2025 14:33:24 GMT, Alan Bateman wrote: >> Coleen Phillimore has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Update >> test/jdk/java/lang/reflect/AccessibleObject/TrySetAccessibleTest.ja

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

2025-02-06 Thread Coleen Phillimore
On Wed, 5 Feb 2025 21:26:29 GMT, Dean Long wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix copyright and param name > > src/hotspot/share/oops/instanceKlass.hpp line 11

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

2025-02-06 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-06 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-06 Thread Coleen Phillimore
On Wed, 5 Feb 2025 21:24:25 GMT, Dean Long wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix copyright and param name > > src/hotspot/share/compiler/compileLog.cpp line

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

2025-02-06 Thread Coleen Phillimore
On Thu, 6 Feb 2025 04:37:17 GMT, Chen Liang wrote: >> OK, if the extra load turns out to be a problem in the future, we could look >> into why the compilers are generating the load when the Class is >> known/constant. If the old intrinsic was able to pull the constant out of >> the Klass, the

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

2025-02-06 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-06 Thread Coleen Phillimore
On Tue, 4 Feb 2025 14:43:51 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&#x

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-06 Thread Coleen Phillimore
On Thu, 6 Feb 2025 07:29:26 GMT, David Holmes wrote: >> @DanHeidinga suggested this for my other PR as a convention that's used for >> the j.l.Class constructor. > > I am still missing what can actually set a PD here, sorry. ?? Because the field is final, it has to be initialized in the constru

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

2025-02-06 Thread Coleen Phillimore
On Wed, 5 Feb 2025 21:44:37 GMT, Dean Long wrote: >> @DanHeidinga Great explanation, thank you! > > If Class had other fields smaller than `int`, would be consider making this > something like `char` to save space (allowing all the sub-word fields to be > compacted)? I thought of doing this si

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

2025-02-05 Thread Coleen Phillimore
On Wed, 5 Feb 2025 01:10:39 GMT, Dean Long wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix copyright and param name > > test/micro/org/openjdk/bench/java/lang/reflec

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v5]

2025-02-05 Thread Coleen Phillimore
On Wed, 5 Feb 2025 17:57:29 GMT, Coleen Phillimore wrote: >> This change removes the native call and injected field for ProtectionDomain >> in the java.lang.Class instance, and moves the field to be declared in Java. >> Tested with tier1-4. > > Coleen Phillimore has

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v5]

2025-02-05 Thread Coleen Phillimore
> This change removes the native call and injected field for ProtectionDomain > in the java.lang.Class instance, and moves the field to be declared in Java. > Tested with tier1-4. Coleen Phillimore has updated the pull request incrementally with three additional commits since the last

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-05 Thread Coleen Phillimore
On Wed, 5 Feb 2025 05:35:58 GMT, David Holmes wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix test that knows which fields are hidden from reflection in jvmci. > > src/jav

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-04 Thread Coleen Phillimore
On Tue, 4 Feb 2025 16:37:10 GMT, Alan Bateman wrote: >> One of the reasons I wanted to move this out of Hotspot as a native call is >> that it might make further work with ProtectionDomain easier to do all in >> Java, except there's still a bit of coupling in the JVM with the name of the >> cl

Re: RFR: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-04 Thread Coleen Phillimore
On Tue, 4 Feb 2025 14:06:07 GMT, Alan Bateman wrote: >> Thanks for looking at this. I didn't want to change this with this change. > > There may need to be some follow-on cleanup, e.g. I'm wondering if > Lookup.cachedProtectionDomain is needed now. One of the reasons I wanted to move this out

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

2025-02-04 Thread Coleen Phillimore
On Tue, 4 Feb 2025 13:36:44 GMT, Alan Bateman wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix copyright and param name > > src/hotspot/share/oops/arrayKlass.hpp line 2: >

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

2025-02-04 Thread Coleen Phillimore
On Tue, 4 Feb 2025 14:40:47 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&#x

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

2025-02-04 Thread Coleen Phillimore
;s a couple of JMH benchmarks added with this change. One does show > that for array classes for non-bootstrap class loader, this results in one > extra load which in a long loop of just that, is observable. I don't think > this is real life code. The other benchmarks added show no re

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

2025-02-03 Thread Coleen Phillimore
On Wed, 11 Dec 2024 15:06:54 GMT, Viktor Klang wrote: >> I don't think this needs to be stable - finals in java.lang is trusted by >> the JIT compiler. > > Yeah, I was just thinking whether something set from inside the VM which is > marked @Stable is constant-folded :) I don't think @Stable w

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

2025-02-03 Thread Coleen Phillimore
On Tue, 17 Dec 2024 15:54:48 GMT, ExE Boss 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 there's

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

2025-02-03 Thread Coleen Phillimore
On Wed, 11 Dec 2024 18:15:57 GMT, Dan Heidinga 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 Coleen Phillimore
On Mon, 9 Dec 2024 21:35:42 GMT, ExE Boss wrote: >> yes. it is needed. > > This is **C++**, so yes. > Suggestion: > > macro(_modifiers_offset, k, vmSymbols::modifiers_name(), > int_signature,false); I see, there's a trailing semi somewhere in the expansion of this macro so it

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

2025-02-03 Thread Coleen Phillimore
On Mon, 9 Dec 2024 19:46:43 GMT, Chen Liang 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 there's

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

2025-02-03 Thread Coleen Phillimore
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 nee

  1   2   3   >