RFR(T) 8221643: Tighten up assert(_keep_alive >= 0) in CLD::inc_keep_alive
coleen.phillimore at oracle.com
coleen.phillimore at oracle.com
Fri Mar 29 13:50:59 UTC 2019
Looks good and trivial.
Thanks!
Coleen
On 3/29/19 8:38 AM, Zhengyu Gu wrote:
> I would like to restore the assertion to its original form, cause the
> current form suggests the possibility of resurrection not kept alive CLD.
>
> The current form was a workaround introduced by JDK-8162553, when null
> class loader data had keep_alive value of 0. Now, the value is
> initialized to 1 by CLD constructor, so the workaround is not needed.
>
>
> diff -r f0fec71d2fff -r d023b009df71
> src/hotspot/share/classfile/classLoaderData.cpp
> --- a/src/hotspot/share/classfile/classLoaderData.cpp Thu Mar 28
> 19:43:59 2019 +0100
> +++ b/src/hotspot/share/classfile/classLoaderData.cpp Thu Mar 28
> 16:11:59 2019 -0400
> @@ -288,7 +288,7 @@
> // it is being defined, therefore _keep_alive is not volatile or atomic.
> void ClassLoaderData::inc_keep_alive() {
> if (is_unsafe_anonymous()) {
> - assert(_keep_alive >= 0, "Invalid keep alive increment count");
> + assert(_keep_alive > 0, "Invalid keep alive increment count");
> _keep_alive++;
> }
> }
>
>
> Test:
> hotspot_runtime on Linux x86 fastdebug
> Sumbit tests.
>
>
> Thanks,
>
> -Zhengyu
More information about the hotspot-runtime-dev
mailing list