Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread Ioi Lam
On Thu, 1 May 2025 02:01:36 GMT, ExE Boss wrote: >> Ioi Lam has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - @AlanBateman comments >> - @xmas92 comments > > src/java.base/share/classes/java/lang/ref/Reference.java line 314: > >> 312:

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread ExE Boss
On Wed, 30 Apr 2025 17:45:04 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread Ioi Lam
On Wed, 30 Apr 2025 17:45:04 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread Chen Liang
On Wed, 30 Apr 2025 17:45:04 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Ioi Lam
On Wed, 30 Apr 2025 15:40:35 GMT, Ioi Lam wrote: >> src/java.base/share/classes/java/lang/ref/Reference.java line 313: >> >>> 311: } >>> 312: >>> 313: private static void runtimeSetup() { >> >> I don't know if you are planning an annotation or something to mark these >> "runtimeSetup"

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Ioi Lam
On Wed, 30 Apr 2025 08:47:59 GMT, Axel Boldt-Christmas wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Renamed the internal field ReferenceQueue.NULL to NULL_QUEUE to avoid >> failing hotspot/jtreg/sources/TestNoNULL.

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v9]

2025-04-30 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Ioi Lam
On Wed, 30 Apr 2025 13:43:28 GMT, Alan Bateman wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Renamed the internal field ReferenceQueue.NULL to NULL_QUEUE to avoid >> failing hotspot/jtreg/sources/TestNoNULL.java > >

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Kim Barrett
On Wed, 30 Apr 2025 14:29:45 GMT, Chen Liang wrote: >> src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 353: >> >>> 351: for (ReferenceKey key : map.keySet()) { >>> 352: Object referent = key.get(); >>> 353: if (referent == null) { >> >> S

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Chen Liang
On Wed, 30 Apr 2025 14:16:27 GMT, Kim Barrett wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Renamed the internal field ReferenceQueue.NULL to NULL_QUEUE to avoid >> failing hotspot/jtreg/sources/TestNoNULL.java > > s

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Kim Barrett
On Wed, 30 Apr 2025 00:56:19 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Alan Bateman
On Wed, 30 Apr 2025 00:56:19 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-30 Thread Axel Boldt-Christmas
On Wed, 30 Apr 2025 00:56:19 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v7]

2025-04-29 Thread Zhengyu Gu
On Wed, 30 Apr 2025 00:57:51 GMT, Ioi Lam wrote: >> src/hotspot/share/cds/aotReferenceObjSupport.cpp line 122: >> >>> 120: ik->initialize(CHECK); >>> 121: >>> 122: TempNewSymbol field_name = SymbolTable::new_symbol("N""ULL"); >> >> Why "N""ULL", not "NULL"? > > That's because a stand-lone

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v7]

2025-04-29 Thread Ioi Lam
On Wed, 30 Apr 2025 00:28:40 GMT, Zhengyu Gu wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @fisk comment -- use proper HeapAccess to load referent; Also refactor >> AOTReferenceObjSupport::is_enabled() > > src/hotspo

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v8]

2025-04-29 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v7]

2025-04-29 Thread Zhengyu Gu
On Tue, 29 Apr 2025 22:22:05 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v7]

2025-04-29 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v6]

2025-04-29 Thread Chen Liang
On Tue, 29 Apr 2025 19:06:08 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v6]

2025-04-29 Thread Erik Österlund
On Tue, 29 Apr 2025 19:06:08 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v6]

2025-04-29 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-29 Thread Dan Heidinga
On Mon, 28 Apr 2025 21:08:10 GMT, Ioi Lam wrote: >> We're creating a set of hooks - right now, there is one in MT - that are >> called by the VM at the appropriate time during the assembly phase to >> massage the class's state before we write the AOTCache out. >> >> Conceptually any class coul

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-28 Thread Ioi Lam
On Mon, 28 Apr 2025 12:51:13 GMT, Dan Heidinga wrote: >> In my mind, `MethodType::prepareForAOTCache()` makes sure all data used by >> `MethodType` are ready to be cached. `ReferenceKeySet::prepareForAOTCache()` >> does the same for this particular `ReferenceKeySet` instance. >> >> Potentially

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-28 Thread Dan Heidinga
On Mon, 28 Apr 2025 05:28:58 GMT, Ioi Lam wrote: >> src/hotspot/share/cds/aotReferenceObjSupport.cpp line 106: >> >>> 104: assert(CDSConfig::allow_only_single_java_thread(), "Required"); >>> 105: >>> 106: TempNewSymbol method_name = >>> SymbolTable::new_symbol("prepareForAOTCache"); >>

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-27 Thread Ioi Lam
On Fri, 25 Apr 2025 19:39:01 GMT, Dan Heidinga wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @fisk comment > > src/hotspot/share/cds/aotReferenceObjSupport.cpp line 106: > >> 104: assert(CDSConfig::allow_only_sin

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-27 Thread Ioi Lam
On Fri, 25 Apr 2025 19:17:51 GMT, Dan Heidinga wrote: >> Ioi Lam has updated the pull request incrementally with one additional >> commit since the last revision: >> >> @fisk comment > > src/hotspot/share/cds/aotReferenceObjSupport.cpp line 76: > >> 74: // the use of Weak/Soft references use

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v5]

2025-04-27 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-25 Thread Dan Heidinga
On Fri, 25 Apr 2025 05:56:15 GMT, Ioi Lam wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceObjS

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v4]

2025-04-24 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v3]

2025-04-24 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache [v2]

2025-04-24 Thread Ioi Lam
> This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport` and new Java method > `ReferencedKeyMap::prepare

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Erik Österlund
On Fri, 18 Apr 2025 18:31:05 GMT, Ioi Lam wrote: > This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Ioi Lam
On Thu, 24 Apr 2025 21:01:11 GMT, Erik Österlund wrote: >> src/java.base/share/classes/jdk/internal/util/ReferencedKeyMap.java line 355: >> >>> 353: if (referent == null) { >>> 354: // We don't need this key anymore. Add to stale queue >>> 355: ((Refer

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Erik Österlund
On Thu, 24 Apr 2025 19:52:25 GMT, Chen Liang wrote: >> This PR contains 2 parts >> >> - Upstream of Soft/Weak Reference support authored by @macarte from [the >> Leyden >> repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) >> - New C++ class `AOTReferenceO

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Chen Liang
On Thu, 24 Apr 2025 21:09:10 GMT, Ioi Lam wrote: >> I'm not sure what you are proposing. But enqueue is used to ensure that >> inactive references are pruned from the data structure so that dumping only >> includes active references. This way, the JVM that loads these objects >> create these r

Re: RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Chen Liang
On Fri, 18 Apr 2025 18:31:05 GMT, Ioi Lam wrote: > This PR contains 2 parts > > - Upstream of Soft/Weak Reference support authored by @macarte from [the > Leyden > repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) > - New C++ class `AOTReferenceObjSupport

RFR: 8354897: Support Soft/Weak Reference in AOT cache

2025-04-24 Thread Ioi Lam
This PR contains 2 parts - Upstream of Soft/Weak Reference support authored by @macarte from [the Leyden repo](https://github.com/openjdk/leyden/commit/4ca75d156519596e23abc8a312496b7c2f0e0ca5) - New C++ class `AOTReferenceObjSupport` and new Java method `ReferencedKeyMap::prepareForAOTCache()`