Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v3]

2021-09-08 Thread Vladimir Ivanov
On Thu, 2 Sep 2021 11:45:01 GMT, Vladimir Ivanov wrote: >> Get rid of WeakReference-based logic in >> DirectMethodHandle::checkInitialized() and reimplement it with >> `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. >> >> The key observation is that

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-02 Thread Vladimir Ivanov
On Thu, 2 Sep 2021 05:08:38 GMT, David Holmes wrote: >> src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1152: >> >>> 1150: * The call returns when either class {@code c} is fully >>> initialized or >>> 1151: * class {@code c} is being initialized and the call is

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v3]

2021-09-02 Thread Vladimir Ivanov
> Get rid of WeakReference-based logic in > DirectMethodHandle::checkInitialized() and reimplement it with > `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. > > The key observation is that `Unsafe::ensureClassInitialized()` does not block > the initializing thread. > > Also,

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-01 Thread David Holmes
On Wed, 1 Sep 2021 18:28:30 GMT, Paul Sandoz wrote: >> Vladimir Ivanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Improve comments > > src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 1152: > >> 1150: * The call

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-01 Thread Paul Sandoz
On Wed, 1 Sep 2021 16:16:38 GMT, Vladimir Ivanov wrote: >> Get rid of WeakReference-based logic in >> DirectMethodHandle::checkInitialized() and reimplement it with >> `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. >> >> The key observation is that

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-01 Thread Vladimir Ivanov
On Thu, 26 Aug 2021 23:49:07 GMT, David Holmes wrote: >> Vladimir Ivanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Improve comments > > src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 385: > >> 383:

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-01 Thread Vladimir Ivanov
On Tue, 31 Aug 2021 16:36:58 GMT, Mandy Chung wrote: > May i suggest that we add some JavaDoc to ensureClassInitialized Thanks, Paul. How does the latest version look? - PR: https://git.openjdk.java.net/jdk/pull/5258

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation [v2]

2021-09-01 Thread Vladimir Ivanov
> Get rid of WeakReference-based logic in > DirectMethodHandle::checkInitialized() and reimplement it with > `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. > > The key observation is that `Unsafe::ensureClassInitialized()` does not block > the initializing thread. > > Also,

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-31 Thread Mandy Chung
On Thu, 26 Aug 2021 15:35:44 GMT, Paul Sandoz wrote: > May i suggest that we add some JavaDoc to `ensureClassInitialized` describing > the two cases of the calling thread is the initialization thread or not. This is a good suggestion that also applies to `Lookup::ensureInitialized`. I

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-31 Thread Mandy Chung
On Wed, 25 Aug 2021 22:05:24 GMT, Vladimir Ivanov wrote: > Get rid of WeakReference-based logic in > DirectMethodHandle::checkInitialized() and reimplement it with > `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. > > The key observation is that `Unsafe::ensureClassInitialized()`

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-26 Thread David Holmes
On Wed, 25 Aug 2021 22:05:24 GMT, Vladimir Ivanov wrote: > Get rid of WeakReference-based logic in > DirectMethodHandle::checkInitialized() and reimplement it with > `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. > > The key observation is that `Unsafe::ensureClassInitialized()`

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-26 Thread Paul Sandoz
On Wed, 25 Aug 2021 22:05:24 GMT, Vladimir Ivanov wrote: > Get rid of WeakReference-based logic in > DirectMethodHandle::checkInitialized() and reimplement it with > `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. > > The key observation is that `Unsafe::ensureClassInitialized()`

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-26 Thread Vladimir Ivanov
On Thu, 26 Aug 2021 02:48:38 GMT, David Holmes wrote: > I'm unclear exactly what that statement is meant to indicate. `DirectMethodHandle::checkInitialized()` is dual-purpose: it implements class initialization barrier and reports whether the class is fully initialized, so the barrier can be

Re: RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-25 Thread David Holmes
On Wed, 25 Aug 2021 22:05:24 GMT, Vladimir Ivanov wrote: > The key observation is that `Unsafe::ensureClassInitialized()` does not block > the initializing thread. I'm unclear exactly what that statement is meant to indicate. The thread actually running "clinit" does not block due to the

RFR: 8273000: Remove WeakReference-based class initialisation barrier implementation

2021-08-25 Thread Vladimir Ivanov
Get rid of WeakReference-based logic in DirectMethodHandle::checkInitialized() and reimplement it with `Unsafe::ensureClassInitialized()`/`shouldBeInitialized()`. The key observation is that `Unsafe::ensureClassInitialized()` does not block the initializing thread. Also, removed