RFR: 8266845: Shenandoah: Simplify SBS::load_reference_barrier implementation [v2]

Zhengyu Gu zgu at openjdk.java.net
Tue May 11 12:22:10 UTC 2021


On Tue, 11 May 2021 06:31:30 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Aleksey's comments
>
> src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 105:
> 
>> 103:   if (obj == nullptr) {
>> 104:     return nullptr;
>> 105:   }
> 
> Let's use `NULL` consistently? Yes, it is an old style, but it is consistent with the code in the same file.

Okay.

> src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 131:
> 
>> 129:   oop fwd = load_reference_barrier(obj);
>> 130:   assert(fwd != nullptr, "Sanity");
>> 131:   if (ShenandoahSelfFixing && load_addr != NULL) {
> 
> I think dropping `fwd != obj` is not about the null-check. It is about not doing the CAS when evacuation fails. It is a minor performance optimization: do not try to perform obviously no-op update. Let's leave it as is.

Right, my mistake.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3956



More information about the hotspot-gc-dev mailing list