RFR: 8225631: Consider replacing muxAcquire/Release with PlatformMonitor
Kim Barrett
kim.barrett at oracle.com
Tue Nov 17 15:18:31 UTC 2020
> On Nov 16, 2020, at 8:30 PM, David Holmes <david.holmes at oracle.com> wrote:
>
> Okay I hadn't realized the static_assert was checked once at compile-time.
>
> But isn't this assertion also checking it is a power of 2?
>
> assert((NINFLATIONLOCKS & (NINFLATIONLOCKS-1)) == 0, "invariant");
>
> Should I just replace that with the is_power_of_2() static assert?
I managed to overlook that later ordinary assert. Yes, that's a
power-of-2 test, though not named so less obvious than it could be.
But it's too late, in the sense that the computation whose output is
affected has already executed. At the location of the that assert it's
not obvious what it's for.
The ordinary assert should be deleted and there should be an
is_power_of_2 static_assert before the introduction of the ix
variable.
More information about the hotspot-runtime-dev
mailing list