RFR: Remove unnecessary write-barrier

Aleksey Shipilev shade at redhat.com
Mon Mar 19 13:41:44 UTC 2018


On 03/19/2018 02:36 PM, Roman Kennke wrote:
> There's no need to do a WB before wrapping something in a handle. Quite
> the contrary: it misleads to assume it's safe to use when unwrapping
> (which is not the case). Barriers should always be done at the
> unwrapping site, or rather, when it's used. Which should generally be
> done by the accessors in oop.hpp.
> 
> diff --git a/src/hotspot/share/services/threadService.cpp
> b/src/hotspot/share/services/threadService.cpp
> --- a/src/hotspot/share/services/threadService.cpp
> +++ b/src/hotspot/share/services/threadService.cpp
> @@ -166,7 +166,6 @@
>      // If obj == NULL, then ObjectMonitor is raw which doesn't count.
>    }
> 
> -  obj = BarrierSet::barrier_set()->write_barrier(obj);
>    Handle h(Thread::current(), obj);
>    return h;
>  }
> 
> 
> The only user of this method in the same file doesn't seem to do
> anything that requires an extra WB.
> 
> Ok?

OK!

-Aleksey



More information about the shenandoah-dev mailing list