Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-11 Thread ExE Boss
On Mon, 5 Feb 2024 16:59:51 GMT, Jim Laskey wrote: >> ok, `intern(e) == e` is sufficient. > > Created https://bugs.openjdk.org/browse/JDK-8325255 While `intern(e) == e` is (mostly) sufficient, it will return a false positive when `add(e)` is called and `e` is already present in the map, the cor

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-05 Thread Jim Laskey
On Mon, 5 Feb 2024 16:38:59 GMT, Roger Riggs wrote: >> Good catch. Your solution might be correct but I think `!contains(e)` is >> redundant since that is how intern starts out. >> >> >>static T intern(ReferencedKeyMap> setMap, T key, >> UnaryOperator interner) { >> T value = exi

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-05 Thread Roger Riggs
On Mon, 5 Feb 2024 12:34:02 GMT, Jim Laskey wrote: >> src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 151: >> >>> 149: @Override >>> 150: public boolean add(T e) { >>> 151: return intern(e) == null; >> >> This line is wrong, as `intern(…)` will never ret

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-05 Thread Jim Laskey
On Sat, 3 Feb 2024 07:20:14 GMT, ExE Boss wrote: >> Jim Laskey has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 17 commits: >> >> - Merge branch 'master' into 8310913 >> - Update implNote for intern >> - Merge branch 'master' in

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2024-02-02 Thread ExE Boss
On Mon, 31 Jul 2023 13:34:30 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v10]

2023-07-31 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v9]

2023-07-31 Thread Jim Laskey
On Wed, 19 Jul 2023 13:59:00 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 15 commits: >> >> - Merge branch 'master' into 8310913 >> - Requested changes. >> >>Added intern with Unar

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v9]

2023-07-19 Thread Roger Riggs
On Wed, 19 Jul 2023 14:04:59 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v9]

2023-07-19 Thread Chen Liang
On Wed, 19 Jul 2023 14:04:59 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v9]

2023-07-19 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v8]

2023-07-19 Thread Jim Laskey
On Tue, 18 Jul 2023 14:56:53 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update test to check for gc. > > src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 354: > >> 352:

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v8]

2023-07-19 Thread Jim Laskey
On Tue, 18 Jul 2023 14:53:09 GMT, Chen Liang wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update test to check for gc. > > src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 97: > >> 95:

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v5]

2023-07-18 Thread Mandy Chung
On Tue, 18 Jul 2023 15:01:11 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 132: >> >>> 130: */ >>> 131: public static ReferencedKeyMap >>> 132: create(boolean isSoft, boolean useNativeQueue, >>> Supplier, V>> supplier) { >> >>

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v5]

2023-07-18 Thread Chen Liang
On Thu, 6 Jul 2023 19:58:09 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add flag for reference queue type > > src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 132: > >> 1

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v8]

2023-07-18 Thread Chen Liang
On Thu, 13 Jul 2023 15:07:35 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v8]

2023-07-14 Thread Roger Riggs
On Thu, 13 Jul 2023 15:07:35 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v8]

2023-07-13 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v7]

2023-07-07 Thread Roger Riggs
On Fri, 7 Jul 2023 16:31:26 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v7]

2023-07-07 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v6]

2023-07-07 Thread Mandy Chung
On Fri, 7 Jul 2023 11:49:22 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v6]

2023-07-07 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v5]

2023-07-06 Thread Mandy Chung
On Thu, 6 Jul 2023 19:59:11 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v5]

2023-07-06 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v4]

2023-07-06 Thread Mandy Chung
On Thu, 6 Jul 2023 12:20:15 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-06 Thread Roger Riggs
On Thu, 6 Jul 2023 13:27:15 GMT, Roger Riggs wrote: >> `WeakReferenceKey::equals` and `SoftReferenceKey::equals`: >> >> Instead of `return Objects.equals(get(), obj);`, suggest to do: >> >> >> return refersTo(obj); > >> @mlchung Not sure I catch the nuance. `refersTo` doesn't work if the s

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v4]

2023-07-06 Thread Mandy Chung
On Thu, 6 Jul 2023 12:20:15 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-06 Thread Mandy Chung
On Thu, 6 Jul 2023 13:27:15 GMT, Roger Riggs wrote: >> `WeakReferenceKey::equals` and `SoftReferenceKey::equals`: >> >> Instead of `return Objects.equals(get(), obj);`, suggest to do: >> >> >> return refersTo(obj); > >> @mlchung Not sure I catch the nuance. `refersTo` doesn't work if the s

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-06 Thread Roger Riggs
On Wed, 5 Jul 2023 19:33:28 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update to use VirtualThread friendly stale queue. > > `WeakReferenceKey::equals` and `SoftReferenceKey::equals`: > > Inste

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v4]

2023-07-06 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-06 Thread Jim Laskey
On Wed, 5 Jul 2023 19:33:28 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update to use VirtualThread friendly stale queue. > > `WeakReferenceKey::equals` and `SoftReferenceKey::equals`: > > Inste

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-05 Thread Mandy Chung
On Tue, 4 Jul 2023 12:55:22 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-05 Thread Roger Riggs
On Tue, 4 Jul 2023 12:55:22 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts of

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-04 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v3]

2023-07-04 Thread Jim Laskey
On Fri, 30 Jun 2023 17:29:20 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update to use VirtualThread friendly stale queue. > > src/java.base/share/classes/java/lang/invoke/MethodType.java line 89

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-07-04 Thread Jim Laskey
On Fri, 30 Jun 2023 17:48:35 GMT, Mandy Chung wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove warning tied to String Templates > > MethodType's `ConcurrentWeakInternSet` uses `NativeReferenceQueue` which uses

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-30 Thread Mandy Chung
On Thu, 29 Jun 2023 18:24:33 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 20:54:31 GMT, Roger Riggs wrote: >> Jim Laskey has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove warning tied to String Templates > > src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 65: >

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Roger Riggs
On Thu, 29 Jun 2023 18:24:33 GMT, Jim Laskey wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]

2023-06-29 Thread Jim Laskey
> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of the jdk. The MethodType interning case is one example.

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Jim Laskey
On Thu, 29 Jun 2023 16:58:13 GMT, Naoto Sato wrote: >> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent >> caching scheme for Carrier objects. The technique used is generally useful >> for a variety of caching schemes and is being moved to be shared in other >> parts o

Re: RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Naoto Sato
On Tue, 27 Jun 2023 19:07:12 GMT, Jim Laskey wrote: > java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent > caching scheme for Carrier objects. The technique used is generally useful > for a variety of caching schemes and is being moved to be shared in other > parts of th

RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared

2023-06-29 Thread Jim Laskey
java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent caching scheme for Carrier objects. The technique used is generally useful for a variety of caching schemes and is being moved to be shared in other parts of the jdk. The MethodType interning case is one example.