RFR(s): 8234086: VM operation can be simplified
Kim Barrett
kim.barrett at oracle.com
Fri Nov 22 07:23:43 UTC 2019
> On Nov 22, 2019, at 1:13 AM, David Holmes <david.holmes at oracle.com> wrote:
>
> Hi Robbin,
>
> On 21/11/2019 9:50 pm, Robbin Ehn wrote:
>> Hi,
>> Here is v3:
>> Full:
>> http://cr.openjdk.java.net/~rehn/8234086/v3/full/webrev/
>
> src/hotspot/share/runtime/synchronizer.cpp
>
> Looking at the highly discussed:
>
> if (Atomic::load(&ForceMonitorScavenge) == 0 && Atomic::xchg (1, &ForceMonitorScavenge) == 0) {
>
> why isn't that just:
>
> if (Atomic::cmpxchg(1, &ForceMonitorScavenge,0) == 0) {
>
> ??
>
> Also while we are here can we clean this up further:
>
> static volatile int ForceMonitorScavenge = 0;
>
> becomes
>
> static int _forceMonitorScavenge = 0;
>
> so the variable doesn't look like it came from globals.hpp :)
I was going to ask some similar questions, but decided not to bother, e.g.
> On Nov 19, 2019, at 10:55 AM, Kim Barrett <kim.barrett at oracle.com> wrote:
> I was going to make a couple nit-pick comments here, but this seems to
> be soon to be dead code (only reached when deprecated MonitorBound has
> a non-default value).
More information about the hotspot-runtime-dev
mailing list