Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v6]

2020-12-04 Thread Mandy Chung
On Fri, 4 Dec 2020 16:22:28 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v6]

2020-12-04 Thread Chris Hegarty
On Fri, 4 Dec 2020 16:22:28 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v5]

2020-12-04 Thread Jan Lahoda
On Fri, 4 Dec 2020 13:25:04 GMT, Alan Bateman wrote: >> Jan Lahoda has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. > > src/java.base/share/classes/java/lang/Cla

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v6]

2020-12-04 Thread Jan Lahoda
> This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference conversion to allow for stricter >> checking of cast c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v5]

2020-12-04 Thread Maurizio Cimadamore
On Fri, 4 Dec 2020 13:12:27 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v5]

2020-12-04 Thread Alan Bateman
On Fri, 4 Dec 2020 13:12:27 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v5]

2020-12-04 Thread Jan Lahoda
> This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference conversion to allow for stricter >> checking of cast c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v3]

2020-12-03 Thread Mandy Chung
On Wed, 2 Dec 2020 14:40:15 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v3]

2020-12-03 Thread Mandy Chung
On Thu, 3 Dec 2020 16:07:28 GMT, Lois Foltan wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Improving Class.getPermittedSubclasses to filter out permitted classes >> that are not a subtype of the current class, and

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v3]

2020-12-03 Thread Lois Foltan
On Wed, 2 Dec 2020 14:40:15 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing refe

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-03 Thread Jan Lahoda
On Thu, 3 Dec 2020 14:08:48 GMT, Jan Lahoda wrote: >>> I suggest `Class::getPermittedSubclasses` to return a `non-null` array if >>> this `Class` is sealed, i.e. this class is derived from a `class` file with >>> the presence of `PermittedSubclasses` attribute regardless of its content >>> (th

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-03 Thread Jan Lahoda
On Wed, 2 Dec 2020 19:31:59 GMT, Dan Smith wrote: >>> Additional changes may be needed to Class.permittedSubclasses() and/or >>> Class.isSealed() as part of fixing bug JDK-8256867. The JVM is being >>> changed to treat classes with empty PermittedSubclasses attributes as >>> sealed classes tha

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v4]

2020-12-03 Thread Jan Lahoda
> This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference conversion to allow for stricter >> checking of cast c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-02 Thread Dan Smith
On Wed, 2 Dec 2020 17:57:22 GMT, Mandy Chung wrote: > I suggest `Class::getPermittedSubclasses` to return a `non-null` array if > this `Class` is sealed, i.e. this class is derived from a `class` file with > the presence of `PermittedSubclasses` attribute regardless of its content > (the attri

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-02 Thread Mandy Chung
On Wed, 2 Dec 2020 17:39:59 GMT, Jan Lahoda wrote: > Additional changes may be needed to Class.permittedSubclasses() and/or > Class.isSealed() as part of fixing bug JDK-8256867. The JVM is being changed > to treat classes with empty PermittedSubclasses attributes as sealed classes > that canno

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-02 Thread Chris Hegarty
On Wed, 2 Dec 2020 17:39:59 GMT, Jan Lahoda wrote: > ... > Uh, I just realized it may be necessary to implement `Class.isSealed()` > differently. Consider: > > ``` > sealed class Sealed permits Unknown {} > ``` > > Where `Unknown` does not exist at runtime. So getPermittedSubclasses0() > retu

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-02 Thread Jan Lahoda
On Wed, 2 Dec 2020 14:28:00 GMT, Harold Seigel wrote: > Additional changes may be needed to Class.permittedSubclasses() and/or > Class.isSealed() as part of fixing bug JDK-8256867. The JVM is being changed > to treat classes with empty PermittedSubclasses attributes as sealed classes > that ca

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v3]

2020-12-02 Thread Jan Lahoda
> This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference conversion to allow for stricter >> checking of cast c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-02 Thread Harold Seigel
On Tue, 1 Dec 2020 23:16:45 GMT, Mandy Chung wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-12-02 Thread Chris Hegarty
On Wed, 2 Dec 2020 12:11:16 GMT, Jan Lahoda wrote: >> Yes, would be a surprise if getPermittedSubclasses returned Class objects >> for classes that are not subclasses. I think it should be okay to separate >> that out to a separate issue so that it can be further re-examined after JEP >> 397 g

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-12-02 Thread Jan Lahoda
On Wed, 2 Dec 2020 12:08:09 GMT, Alan Bateman wrote: >> @lahodaj It is okay with me if `getPermittedSubclasses` returns the >> permitted subtypes matching the runtime view (that matches the current >> specification to me) and revisit this API as a follow up. > > Yes, would be a surprise if get

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-12-02 Thread Alan Bateman
On Tue, 1 Dec 2020 23:19:41 GMT, Mandy Chung wrote: >> I was investigating a little today. One thing to note is that there is a >> difference between the JLS and JVMS[1] restrictions - the JVMS restrictions >> only require the classes to be in the same module, but they can be in any >> package

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-12-01 Thread Mandy Chung
On Fri, 27 Nov 2020 16:57:54 GMT, Jan Lahoda wrote: > This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-12-01 Thread Mandy Chung
On Tue, 1 Dec 2020 16:49:03 GMT, Jan Lahoda wrote: >> So it could also return a class listed in `PermittedSubclasses` attribute >> but not a subclass of this sealed class, right? >> >> The specification of `Class::getPermittedSubclasses` says: >> >>> Returns an array containing {@code Class} o

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-12-01 Thread Jan Lahoda
On Tue, 1 Dec 2020 00:36:54 GMT, Mandy Chung wrote: >> The JVM method that returns the permitted subclasses (and interfaces) does >> not weed out permitted subclasses based on the above module requirements. >> It returns all the classes listed in the PermittedSubclasses attribute that >> it i

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread David Holmes
On 1/12/2020 10:39 am, Mandy Chung wrote: On Mon, 30 Nov 2020 20:57:32 GMT, Harold Seigel wrote: src/java.base/share/classes/java/lang/Class.java line 4480: 4478: } 4479: 4480: private native Class[] getPermittedSubclasses0(); Does this JVM method return the permitted subclasses or

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Mandy Chung
On Mon, 30 Nov 2020 15:59:07 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Mandy Chung
On Mon, 30 Nov 2020 20:57:32 GMT, Harold Seigel wrote: >> src/java.base/share/classes/java/lang/Class.java line 4480: >> >>> 4478: } >>> 4479: >>> 4480: private native Class[] getPermittedSubclasses0(); >> >> Does this JVM method return the permitted subclasses or subinterfaces with >

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Harold Seigel
On Mon, 30 Nov 2020 19:44:52 GMT, Mandy Chung wrote: >> Jan Lahoda has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 12 commits: >> >> - Improving getPermittedSubclasses javadoc. >> - Merge branch 'master' into JDK-8246778 >> - M

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Mandy Chung
On Mon, 30 Nov 2020 15:59:07 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Mandy Chung
On Mon, 30 Nov 2020 15:59:07 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Mandy Chung
On Mon, 30 Nov 2020 15:59:07 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Alan Bateman
On Mon, 30 Nov 2020 15:59:07 GMT, Jan Lahoda wrote: >> This pull request replaces https://github.com/openjdk/jdk/pull/1227. >> >> From the original PR: >> >>> Please review the code for the second iteration of sealed classes. In this >>> iteration we are: >>> >>> * Enhancing narrowing ref

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Jan Lahoda
> This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference conversion to allow for stricter >> checking of cast c

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) [v2]

2020-11-30 Thread Jan Lahoda
On Mon, 30 Nov 2020 09:55:56 GMT, Alan Bateman wrote: >> Jan Lahoda has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 12 commits: >> >> - Improving getPermittedSubclasses javadoc. >> - Merge branch 'master' into JDK-8246778 >> -

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-30 Thread Alan Bateman
On Fri, 27 Nov 2020 16:57:54 GMT, Jan Lahoda wrote: > This pull request replaces https://github.com/openjdk/jdk/pull/1227. > > From the original PR: > >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> * Enhancing narrowing reference c

RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-27 Thread Jan Lahoda
This pull request replaces https://github.com/openjdk/jdk/pull/1227. >From the original PR: > Please review the code for the second iteration of sealed classes. In this > iteration we are: > > * Enhancing narrowing reference conversion to allow for stricter checking > of cast conversions w

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-25 Thread Jan Lahoda
On Tue, 24 Nov 2020 23:00:05 GMT, Mandy Chung wrote: >> I agree. This @apiNote needs more clarification to help the readers to >> understand the context here.One thing we could do in the Package class >> description to add a "Package Sealing" section that can also explain that it >> has n

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Mandy Chung
On 11/24/20 3:18 PM, Remi Forax wrote: Hi Mandy, given that almost nobody knows about sealed packages, i'm not sure that adding a reference to Package::isSealed in Class::isSealed actually helps, it might be confusing. It's even better if the API note in `Class::isSealed` from PR is remo

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Remi Forax
- Mail original - > De: "Mandy Chung" > À: "compiler-dev" , "core-libs-dev" > , "hotspot-dev" > > Envoyé: Mercredi 25 Novembre 2020 00:02:53 > Objet: Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second > Pre

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Mandy Chung
On Tue, 17 Nov 2020 00:25:51 GMT, Mandy Chung wrote: >> src/java.base/share/classes/java/lang/Package.java line 227: >> >>> 225: * This method reports on a distinct concept of sealing from >>> 226: * {@link Class#isSealed() Class::isSealed}. >>> 227: * >> >> This API note will be

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread David Holmes
t;compiler-dev" , "core-libs-dev" , "hotspot-dev" Envoyé: Mardi 24 Novembre 2020 02:04:55 Objet: Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview) Hi Harold, On 24/11/2020 6:27 am, Harold Seigel wrote: Hi David, Thanks for looking at this. The i

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread forax
- Mail original - > De: "David Holmes" > À: "Remi Forax" > Cc: "Harold David Seigel" , "Vicente Romero" > , "compiler-dev" > , "core-libs-dev" > , "hotspot-dev" > > Envoyé: Mardi 24 Novemb

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread David Holmes
Hi Remi, On 24/11/2020 7:45 pm, Remi Forax wrote: - Mail original - De: "David Holmes" À: "Harold David Seigel" , "Vicente Romero" , "compiler-dev" , "core-libs-dev" , "hotspot-dev" Envoyé: Mardi 24 Novembre 2020 02:04:55

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-24 Thread Remi Forax
- Mail original - > De: "David Holmes" > À: "Harold David Seigel" , "Vicente Romero" > , "compiler-dev" > , "core-libs-dev" > , "hotspot-dev" > > Envoyé: Mardi 24 Novembre 2020 02:04:55 > Objet: Re

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-23 Thread David Holmes
Hi Harold, On 24/11/2020 6:27 am, Harold Seigel wrote: Hi David, Thanks for looking at this. The intent was for method Class.permittedSubclasses() to be implemented similarly to Class.getNestMembers().  Are you suggesting that a security manager check be added to permittedSubclasses() simila

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-23 Thread Harold Seigel
Hi David, Thanks for looking at this. The intent was for method Class.permittedSubclasses() to be implemented similarly to Class.getNestMembers().  Are you suggesting that a security manager check be added to permittedSubclasses() similar to the security manager check in getNestMembers()? T

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-17 Thread David Holmes
Hi Vincente, On 16/11/2020 11:36 pm, Vicente Romero wrote: Please review the code for the second iteration of sealed classes. In this iteration we are: - Enhancing narrowing reference conversion to allow for stricter checking of cast conversions with respect to sealed type hierarchies. - Also

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-16 Thread Mandy Chung
On Mon, 16 Nov 2020 13:30:06 GMT, Vicente Romero wrote: > Please review the code for the second iteration of sealed classes. In this > iteration we are: > > - Enhancing narrowing reference conversion to allow for stricter checking of > cast conversions with respect to sealed type hierarchies >

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-16 Thread Mandy Chung
On Mon, 16 Nov 2020 13:49:26 GMT, Alan Bateman wrote: >> Please review the code for the second iteration of sealed classes. In this >> iteration we are: >> >> - Enhancing narrowing reference conversion to allow for stricter checking of >> cast conversions with respect to sealed type hierarchie

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-16 Thread Maurizio Cimadamore
On Mon, 16 Nov 2020 13:30:06 GMT, Vicente Romero wrote: > Please review the code for the second iteration of sealed classes. In this > iteration we are: > > - Enhancing narrowing reference conversion to allow for stricter checking of > cast conversions with respect to sealed type hierarchies >

Re: RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-16 Thread Alan Bateman
On Mon, 16 Nov 2020 13:30:06 GMT, Vicente Romero wrote: > Please review the code for the second iteration of sealed classes. In this > iteration we are: > > - Enhancing narrowing reference conversion to allow for stricter checking of > cast conversions with respect to sealed type hierarchies >

RFR: 8246778: Compiler implementation for Sealed Classes (Second Preview)

2020-11-16 Thread Vicente Romero
Please review the code for the second iteration of sealed classes. In this iteration we are: - Enhancing narrowing reference conversion to allow for stricter checking of cast conversions with respect to sealed type hierarchies. - Also local classes are not considered when determining implicitly