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 updated the pull request wit

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

2025-02-12 Thread Yudi Zheng
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 updated the pull request wit

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

2025-02-11 Thread Alan Bateman
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 updated the pull request wit

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

2025-02-11 Thread David Holmes
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 updated the pull request wit

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

2025-02-11 Thread Chen Liang
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 updated the pull request wit

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't need this but it carries i

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 pull request n

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

2025-02-10 Thread David Holmes
On Thu, 6 Feb 2025 12:12:59 GMT, Coleen Phillimore wrote: >> I am still missing what can actually set a PD here, sorry. ?? > > 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 qui

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 revision:

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.java >> >>Co-authored-by: D

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

2025-02-06 Thread Alan Bateman
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 updated the pull request incr

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: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-05 Thread David Holmes
On Wed, 5 Feb 2025 17:41:22 GMT, Coleen Phillimore wrote: >> src/java.base/share/classes/java/lang/Class.java line 239: >> >>> 237: * generated. >>> 238: */ >>> 239: private Class(ClassLoader loader, Class arrayComponentType, >>> ProtectionDomain pd) { >> >> If this constructor i

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 updated the pull request incr

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

2025-02-05 Thread Chen Liang
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 updated the pull request incr

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 revision:

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/java.base/share/classes/java/lang/Cla

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

2025-02-04 Thread David Holmes
On Mon, 3 Feb 2025 16:11:06 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 updated the pull request incr

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 Alan Bateman
On Tue, 4 Feb 2025 14:59:46 GMT, Coleen Phillimore wrote: >> 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 of Hotspot as a native call is > that it might make further work with

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: 8349145: Make Class.getProtectionDomain() non-native [v4]

2025-02-04 Thread Alan Bateman
On Fri, 31 Jan 2025 17:16:11 GMT, Coleen Phillimore wrote: >> src/java.base/share/classes/java/lang/System.java line 2150: >> >>> 2148: } >>> 2149: >>> 2150: public ProtectionDomain protectionDomain(Class c) { >> >> This accessor has become pointless since the functinoa

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

2025-02-03 Thread Chen Liang
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 updated the pull request with

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 revision:

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 updated the pull request with

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

2025-02-03 Thread Chen Liang
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 updated the pull request with

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 incremental we

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

2025-02-01 Thread Alan Bateman
On Fri, 31 Jan 2025 17:22:37 GMT, Aleksey Shipilev wrote: > I am thinking if anything new happens if we can reflect the field, > `setAccessible(true)` it, and overwrite it. I guess the normal protection > rules disallow the `setAccessible` part, but it does not hurt to think and > confirm this

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 revision:

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 setAccessible(

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

2025-01-31 Thread Alan Bateman
On Fri, 31 Jan 2025 17:14:39 GMT, Coleen Phillimore wrote: > One thing to think about: does this mean `protectionDomain` is now > discoverable by reflection? Should it be? Should it be filtered? Class::getProtectionDomain is a public API so anyone looking for it doesn't need reflection, but ma

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

2025-01-31 Thread Aleksey Shipilev
On Fri, 31 Jan 2025 17:17:04 GMT, Alan Bateman wrote: > > One thing to think about: does this mean `protectionDomain` is now > > discoverable by reflection? Should it be? Should it be filtered? > > Class::getProtectionDomain is a public API so anyone looking for it doesn't > need reflection, b

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

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

2025-01-31 Thread Chen Liang
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. Reflection filtering was mostly a legacy measure to avoi

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

2025-01-31 Thread Aleksey Shipilev
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. One thing to think about: does this mean `protectionDoma

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

2025-01-31 Thread Chen Liang
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. Marked as reviewed by liach (Reviewer). src/java.base/s

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://