RFR: Replace risky SBS::need_update_refs_barrier with straightforward check

Roman Kennke rkennke at redhat.com
Mon Jun 18 16:45:46 UTC 2018


Am 18.06.2018 um 18:41 schrieb Aleksey Shipilev:
> On 06/18/2018 06:38 PM, Roman Kennke wrote:
>> Am 18.06.2018 um 18:34 schrieb Aleksey Shipilev:
>>> http://cr.openjdk.java.net/~shade/shenandoah/sbs-risky-check/webrev.01/
>>>
>>> Heuristics has the automatic switch between separate-UR and CM-with-UR modes. Current check relies
>>> on heuristics()->update_refs() to figure out if we should check ur-in-progress or mark-in-progress
>>> when updating the references. This is risky, because heuristics may have stale idea about which mode
>>> to operate in. It is safer to check all potential GC states at once.
>>>
>>
>> Good idea!
>>
>> Seems like some of it can be collapsed into a single mask check:
>>
>> +         _heap->is_update_refs_in_progress() ||
>> +         _heap->is_concurrent_traversal_in_progress() ||
>> +         (_heap->is_concurrent_mark_in_progress() &&
>> _heap->has_forwarded_objects());
>>
>> Probably not worth though. Your call.
> 
> I thought so too, but it requires two things: checking that has_forwarded bit set, and *either* of
> other three bits set. We can compare with "> has_forwarded", which implies this, but it brings in
> endianness that I don't want to deal with.
> 

Ah right. Well, good then, go!

Cheers,
Roman




More information about the shenandoah-dev mailing list