The G1ParScanThreadState code in g1CollectedHeap.* contains some replicated asserts in push_on_queue(), pop_from_queue(), trim_queue(), etc., that should be factored out and made consistent. In addition, the changes for 6966222 enable trim_queue() to be significantly simplified.
Coalesce the asserts and verification code from push_on_queue(), pop_from_queue(), pop_from_overflow_queue() and trim_queue() into debug-only methods verify_ref() and verify_task().
Simplify trim_queue() by adding a method deal_with_reference(StarTask ref) and using methods from OverflowTaskQueue.
Clean up termination timing in G1ParEvacuateFollowersClosure::do_void().
Remove refs_to_scan() and overflowed_refs_to_scan(); use OverflowTaskQueue::is_empty() instead.