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

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

2025-02-03 Thread Coleen Phillimore
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 no real need for the jdk code to call into the VM to get it. Th

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

2025-02-03 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 [v3]

2025-02-03 Thread Coleen Phillimore
On Mon, 3 Feb 2025 14:31:28 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 [v3]

2025-02-03 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 in

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

2025-01-31 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

2025-01-31 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. I was thinking of what happens if you use setA

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

2025-01-31 Thread Coleen Phillimore
On Fri, 31 Jan 2025 16:51:07 GMT, Chen Liang 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. > > src/java.base/share/classes/java/lang/System.java line 21

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

2025-01-31 Thread Coleen Phillimore
On Fri, 31 Jan 2025 17:06:13 GMT, Aleksey Shipilev wrote: > One thing to think about: does this mean protectionDomain is now discoverable > by reflection? Should it be? Should it be filtered? We hid it in the past so it wouldn't be discoverable, but with the removal of the security manager, th

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

2025-01-31 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. - Commit messages: - Fix the test. - 8349145: Make Class.getProtectionDomain() non-native Changes: https://

Re: RFR: 8348240: Remove SystemDictionaryShared::lookup_super_for_unregistered_class()

2025-01-22 Thread Coleen Phillimore
On Wed, 22 Jan 2025 03:28:00 GMT, Ioi Lam wrote: > I reimplemented > `SystemDictionaryShared::lookup_super_for_unregistered_class()` with Java > code. This removes hacks in > `SystemDictionary::resolve_with_circularity_detection()` to facilitate future > clean-ups there that are planned by @c

Integrated: 8341649: Regressions with large metaspace apps after 8338526

2024-12-03 Thread Coleen Phillimore
On Mon, 2 Dec 2024 17:41:30 GMT, Coleen Phillimore wrote: > Putting generated LambdaForm$MH and $DMH in non-class space seems to cause > excess dependency checking for c2 compiled code and shows a performance > regression in a new JMH performance test for MethodHandles (to be checked

Re: RFR: 8341649: Regressions with large metaspace apps after 8338526

2024-12-03 Thread Coleen Phillimore
On Mon, 2 Dec 2024 17:41:30 GMT, Coleen Phillimore wrote: > Putting generated LambdaForm$MH and $DMH in non-class space seems to cause > excess dependency checking for c2 compiled code and shows a performance > regression in a new JMH performance test for MethodHandles (to be checked

Re: RFR: 8341649: Regressions with large metaspace apps after 8338526

2024-12-03 Thread Coleen Phillimore
On Mon, 2 Dec 2024 17:41:30 GMT, Coleen Phillimore wrote: > Putting generated LambdaForm$MH and $DMH in non-class space seems to cause > excess dependency checking for c2 compiled code and shows a performance > regression in a new JMH performance test for MethodHandles (to be checked

Re: RFR: 8341649: Regressions with large metaspace apps after 8338526

2024-12-03 Thread Coleen Phillimore
On Mon, 2 Dec 2024 17:41:30 GMT, Coleen Phillimore wrote: > Putting generated LambdaForm$MH and $DMH in non-class space seems to cause > excess dependency checking for c2 compiled code and shows a performance > regression in a new JMH performance test for MethodHandles (to be checked

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21]

2024-12-03 Thread Coleen Phillimore
On Mon, 2 Dec 2024 15:11:54 GMT, Magnus Ihse Bursie wrote: >> src/hotspot/os/linux/os_linux.cpp line 590: >> >>> 588: >>> 589: // Found the full path to the binary. It is normally of this >>> structure: >>> 590: // /lib//libjvm.so >> >> You could change to server I believe, since t

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21]

2024-12-02 Thread Coleen Phillimore
On Tue, 26 Nov 2024 17:17:09 GMT, Magnus Ihse Bursie wrote: >> As a prerequisite for Hermetic Java, we need a statically linked `java` >> launcher. It should behave like the normal, dynamically linked `java` >> launcher, except that all JDK native libraries should be statically, not >> dynamic

RFR: 8341649: Regressions with large metaspace apps after 8338526

2024-12-02 Thread Coleen Phillimore
Putting generated LambdaForm$MH and $DMH in non-class space seems to cause excess dependency checking for c2 compiled code and shows a performance regression in a new JMH performance test for MethodHandles (to be checked in at a later time). When I made this abstract rather than final, I though

Re: RFR: 8344861: Disable CheckJNICalls in tests until JDK-8344802 is fixed

2024-11-22 Thread Coleen Phillimore
On Fri, 22 Nov 2024 14:19:57 GMT, Tobias Hartmann wrote: > Some tests specify `-XX:+EnableX86ECoreOpts` which does not work well with > `-Xcheck:jni` on Windows. Disable `CheckJNICalls` for now with these tests > until [JDK-8344802](https://bugs.openjdk.org/browse/JDK-8344802) is fixed. > > Th

Re: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v8]

2024-11-07 Thread Coleen Phillimore
On Thu, 7 Nov 2024 13:16:19 GMT, Coleen Phillimore wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @DanHeidinga comment -- exit VM when runtimeSetup() fails > > src/hotspot/share/cds/aotC

Re: RFR: 8331497: Implement JEP 483: Ahead-of-Time Class Loading & Linking [v8]

2024-11-07 Thread Coleen Phillimore
On Mon, 4 Nov 2024 23:57:48 GMT, Ioi Lam wrote: >> This is an implementation of [JEP 483: Ahead-of-Time Class Loading & >> Linking](https://openjdk.org/jeps/483). >> >> >> Note: this is a combined PR of the following individual PRs >> - https://github.com/openjdk/jdk/pull/20516 >> - https:

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Mon, 28 Oct 2024 00:38:39 GMT, David Holmes wrote: >> I thought locking_thread there may not be the current thread for enter_for() >> in deopt. It's the thread that should hold the lock but not the current >> thread. But it might be different now. > > The thread passed in need not be the c

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Fri, 25 Oct 2024 21:29:05 GMT, Patricio Chilano Mateo wrote: >> I see that in lightweightSynchronizer.cpp we already use the name >> `locking_thread` (although >> `LightweightSynchronizer::inflate_into_object_header` still uses >> `inflating_thread`). So how about using `locking_thread` in

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Wed, 23 Oct 2024 20:42:44 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/objectMonitor.hpp line 299: >> >>> 297: // Simply set _owner field to new_value; current value must match >>> old_value. >>> 298: void set_owner_from_raw(int64_t old_value, int64_t new_value);

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Fri, 25 Oct 2024 13:12:11 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/share/runtime/continuationFreezeThaw.cpp line 1275: >> >>> 1273: >>> 1274: if (caller.is_interpreted_frame()) { >>> 1275: _total_align_size += frame::align_wiggle; >> >> Please put a comment here about frame

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Mon, 28 Oct 2024 21:01:47 GMT, Patricio Chilano Mateo wrote: >> I tried to track down how interpreter_frame_num_oops() is used, and as far >> as I can tell, it is only used to compare against the bitmap in debug/verify >> code. So if this slot was added here, shouldn't there be a correspon

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Sat, 26 Oct 2024 01:51:12 GMT, Dean Long wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without >> Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for >> further details. >> >> In order to make the code review easier the changes have been sp

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Tue, 22 Oct 2024 15:49:32 GMT, Andrew Haley wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without >> Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for >> further details. >> >> In order to make the code review easier the changes have been

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Mon, 28 Oct 2024 22:04:23 GMT, Patricio Chilano Mateo wrote: >> It seems somewhat of an oxymoron that to force a slow path we push a >> fastpath. ??? > > Yes, I find the name confusing too. But since this is pre-existent and to > avoid the noise in the PR I would rather not change it here.

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Tue, 22 Oct 2024 02:09:33 GMT, Patricio Chilano Mateo wrote: >> src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp line 380: >> >>> 378: lea(t2_owner_addr, owner_address); >>> 379: >>> 380: // CAS owner (null => current thread id). >> >> I think we should be more careful when an

Re: RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning

2024-11-06 Thread Coleen Phillimore
On Wed, 23 Oct 2024 06:15:27 GMT, David Holmes wrote: > Why do we need to cache it? Is it the implicit barriers related to accessing > the threadObj oop each time? We cache threadObj.thread_id in JavaThread::_lock_id so that the fast path c2_MacroAssembler code has one less load and code to fi

  1   2   3   >