< prev index next >

src/hotspot/share/gc/g1/g1ConcurrentMark.hpp

Print this page
rev 55208 : imported patch 8220089.webrev.0
rev 55212 : imported patch 8220089.webrev.4

*** 220,241 **** // Apply Fn to every oop on the mark stack. The mark stack must not // be modified while iterating. template<typename Fn> void iterate(Fn fn) const PRODUCT_RETURN; }; ! // Root Regions are regions that contain objects from nTAMS to top. These are roots // for marking, i.e. their referenced objects must be kept alive to maintain the // SATB invariant. // We could scan and mark them through during the initial-mark pause, but for // pause time reasons we move this work to the concurrent phase. // We need to complete this procedure before the next GC because it might determine // that some of these "root objects" are dead, potentially dropping some required // references. ! // Root regions comprise of the complete contents of survivor regions, and any // objects copied into old gen during GC. ! class G1CMRootRegions { ! HeapRegion** _root_regions; size_t const _max_regions; volatile size_t _num_root_regions; // Actual number of root regions. volatile size_t _claimed_root_regions; // Number of root regions currently claimed. --- 220,244 ---- // Apply Fn to every oop on the mark stack. The mark stack must not // be modified while iterating. template<typename Fn> void iterate(Fn fn) const PRODUCT_RETURN; }; ! // Root MemRegions are memory regions that contain objects from nTAMS to top. These are roots // for marking, i.e. their referenced objects must be kept alive to maintain the // SATB invariant. // We could scan and mark them through during the initial-mark pause, but for // pause time reasons we move this work to the concurrent phase. // We need to complete this procedure before the next GC because it might determine // that some of these "root objects" are dead, potentially dropping some required // references. ! // Root MemRegions comprise of the complete contents of survivor regions, and any // objects copied into old gen during GC. ! class G1CMRootMemRegions { ! // The set of root MemRegions. We store the corresponding nTAMS and top() pointer ! // for a given heap region into MemRegion to know the exact area to scan because ! // the top of a reused survivor region changes over time. ! MemRegion* _root_regions; size_t const _max_regions; volatile size_t _num_root_regions; // Actual number of root regions. volatile size_t _claimed_root_regions; // Number of root regions currently claimed.
*** 244,260 **** volatile bool _should_abort; void notify_scan_done(); public: ! G1CMRootRegions(uint const max_regions); ! ~G1CMRootRegions(); // Reset the data structure to allow addition of new root regions. void reset(); ! void add(HeapRegion* hr); // Reset the claiming / scanning of the root regions. void prepare_for_scan(); // Forces get_next() to return NULL so that the iteration aborts early. --- 247,263 ---- volatile bool _should_abort; void notify_scan_done(); public: ! G1CMRootMemRegions(uint const max_regions); ! ~G1CMRootMemRegions(); // Reset the data structure to allow addition of new root regions. void reset(); ! void add(HeapWord* start, HeapWord* end); // Reset the claiming / scanning of the root regions. void prepare_for_scan(); // Forces get_next() to return NULL so that the iteration aborts early.
*** 262,274 **** // Return true if the CM thread are actively scanning root regions, // false otherwise. bool scan_in_progress() { return _scan_in_progress; } ! // Claim the next root region to scan atomically, or return NULL if // all have been claimed. ! HeapRegion* claim_next(); // The number of root regions to scan. uint num_root_regions() const; void cancel_scan(); --- 265,277 ---- // Return true if the CM thread are actively scanning root regions, // false otherwise. bool scan_in_progress() { return _scan_in_progress; } ! // Claim the next root MemRegion to scan atomically, or return NULL if // all have been claimed. ! MemRegion* claim_next(); // The number of root regions to scan. uint num_root_regions() const; void cancel_scan();
*** 308,318 **** // Heap bounds MemRegion const _heap; // Root region tracking and claiming ! G1CMRootRegions _root_regions; // For grey objects G1CMMarkStack _global_mark_stack; // Grey objects behind global finger HeapWord* volatile _finger; // The global finger, region aligned, // always pointing to the end of the --- 311,321 ---- // Heap bounds MemRegion const _heap; // Root region tracking and claiming ! G1CMRootMemRegions _root_regions; // For grey objects G1CMMarkStack _global_mark_stack; // Grey objects behind global finger HeapWord* volatile _finger; // The global finger, region aligned, // always pointing to the end of the
*** 499,509 **** } size_t mark_stack_size() const { return _global_mark_stack.size(); } size_t partial_mark_stack_size_target() const { return _global_mark_stack.capacity() / 3; } bool mark_stack_empty() const { return _global_mark_stack.is_empty(); } ! G1CMRootRegions* root_regions() { return &_root_regions; } void concurrent_cycle_start(); // Abandon current marking iteration due to a Full GC. void concurrent_cycle_abort(); void concurrent_cycle_end(); --- 502,512 ---- } size_t mark_stack_size() const { return _global_mark_stack.size(); } size_t partial_mark_stack_size_target() const { return _global_mark_stack.capacity() / 3; } bool mark_stack_empty() const { return _global_mark_stack.is_empty(); } ! G1CMRootMemRegions* root_regions() { return &_root_regions; } void concurrent_cycle_start(); // Abandon current marking iteration due to a Full GC. void concurrent_cycle_abort(); void concurrent_cycle_end();
*** 552,563 **** // Scan all the root regions and mark everything reachable from // them. void scan_root_regions(); ! // Scan a single root region from nTAMS to top and mark everything reachable from it. ! void scan_root_region(HeapRegion* hr, uint worker_id); // Do concurrent phase of marking, to a tentative transitive closure. void mark_from_roots(); // Do concurrent preclean work. --- 555,566 ---- // Scan all the root regions and mark everything reachable from // them. void scan_root_regions(); ! // Scan a single root MemRegion which holds from nTAMS to top and mark everything reachable from it. ! void scan_root_region(MemRegion* region, uint worker_id); // Do concurrent phase of marking, to a tentative transitive closure. void mark_from_roots(); // Do concurrent preclean work.
< prev index next >