RFR: Refactor evac-in-progress flag to more general gc-phase flag

Roman Kennke rkennke at redhat.com
Thu Sep 14 17:09:01 UTC 2017


Here's another one in preparation of concurrent partial GC:

This patch refactors the Thread::evacuation_in_progress flag to a more 
general gc_phase_in_progress flag. Instead of checking for 0 or != 0, it 
must now be masked with an appropriate gc-phase-mask before checking. 
Each bit represents a GC phase. For now, I've only done EVACUATION on bit 0.

The idea here is that when storing an oop, we usually do:

- check satb-in-progress (and do satb-barrier if so)
- check evacuation-in-progress (and do write-barrier if so)

and with conc partial, we want to check for conc-partial-in-progress and 
do a special barrier too.

Putting all in one flag allows us to load the flag once, and test it 
repeatedly. The compiler may even common this flag-loading over multiple 
stores.

Test: hotspot_gc_shenandoah on x86 and aarch64

http://cr.openjdk.java.net/~rkennke/gc-phase-flag/webrev.00/ 
<http://cr.openjdk.java.net/%7Erkennke/gc-phase-flag/webrev.00/>




More information about the shenandoah-dev mailing list