< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.hpp

Print this page
rev 8719 : 8004687: G1: Parallelize object self-forwarding and scanning during an evacuation failure
Summary: Use the regular task queue during evacuation failure and allow per-thread preserved header queues to remove the global lock during evacuation failure.
Reviewed-by:
Contributed-by: Walter Florian Gugenberger <walter.gugenberger@gmail.com>


 841 
 842   // The concurrent marker (and the thread it runs in.)
 843   ConcurrentMark* _cm;
 844   ConcurrentMarkThread* _cmThread;
 845 
 846   // The concurrent refiner.
 847   ConcurrentG1Refine* _cg1r;
 848 
 849   // The parallel task queues
 850   RefToScanQueueSet *_task_queues;
 851 
 852   // True iff a evacuation has failed in the current collection.
 853   bool _evacuation_failed;
 854 
 855   EvacuationFailedInfo* _evacuation_failed_info_array;
 856 
 857   // Failed evacuations cause some logical from-space objects to have
 858   // forwarding pointers to themselves.  Reset them.
 859   void remove_self_forwarding_pointers();
 860 
 861   // Together, these store an object with a preserved mark, and its mark value.
 862   Stack<oop, mtGC>     _objs_with_preserved_marks;
 863   Stack<markOop, mtGC> _preserved_marks_of_objs;
 864 
 865   // Preserve the mark of "obj", if necessary, in preparation for its mark
 866   // word being overwritten with a self-forwarding-pointer.
 867   void preserve_mark_if_necessary(oop obj, markOop m);
 868 
 869   // The stack of evac-failure objects left to be scanned.
 870   GrowableArray<oop>*    _evac_failure_scan_stack;
 871   // The closure to apply to evac-failure objects.
 872 
 873   OopsInHeapRegionClosure* _evac_failure_closure;
 874   // Set the field above.
 875   void
 876   set_evac_failure_closure(OopsInHeapRegionClosure* evac_failure_closure) {
 877     _evac_failure_closure = evac_failure_closure;
 878   }
 879 
 880   // Push "obj" on the scan stack.
 881   void push_on_evac_failure_scan_stack(oop obj);
 882   // Process scan stack entries until the stack is empty.
 883   void drain_evac_failure_scan_stack();
 884   // True iff an invocation of "drain_scan_stack" is in progress; to
 885   // prevent unnecessary recursion.
 886   bool _drain_in_progress;
 887 
 888   // Do any necessary initialization for evacuation-failure handling.
 889   // "cl" is the closure that will be used to process evac-failure
 890   // objects.
 891   void init_for_evac_failure(OopsInHeapRegionClosure* cl);
 892   // Do any necessary cleanup for evacuation-failure handling data
 893   // structures.
 894   void finalize_for_evac_failure();
 895 
 896   // An attempt to evacuate "obj" has failed; take necessary steps.
 897   oop handle_evacuation_failure_par(G1ParScanThreadState* _par_scan_state, oop obj);
 898   void handle_evacuation_failure_common(oop obj, markOop m);
 899 
 900 #ifndef PRODUCT
 901   // Support for forcing evacuation failures. Analogous to
 902   // PromotionFailureALot for the other collectors.
 903 
 904   // Records whether G1EvacuationFailureALot should be in effect
 905   // for the current GC
 906   bool _evacuation_failure_alot_for_current_gc;
 907 
 908   // Used to record the GC number for interval checking when
 909   // determining whether G1EvaucationFailureALot is in effect
 910   // for the current GC.
 911   size_t _evacuation_failure_alot_gc_number;
 912 
 913   // Count of the number of evacuations between failures.
 914   volatile size_t _evacuation_failure_alot_count;
 915 
 916   // Set whether G1EvacuationFailureALot should be in effect
 917   // for the current GC (based upon the type of GC and which
 918   // command line flags are set);




 841 
 842   // The concurrent marker (and the thread it runs in.)
 843   ConcurrentMark* _cm;
 844   ConcurrentMarkThread* _cmThread;
 845 
 846   // The concurrent refiner.
 847   ConcurrentG1Refine* _cg1r;
 848 
 849   // The parallel task queues
 850   RefToScanQueueSet *_task_queues;
 851 
 852   // True iff a evacuation has failed in the current collection.
 853   bool _evacuation_failed;
 854 
 855   EvacuationFailedInfo* _evacuation_failed_info_array;
 856 
 857   // Failed evacuations cause some logical from-space objects to have
 858   // forwarding pointers to themselves.  Reset them.
 859   void remove_self_forwarding_pointers();
 860 
 861   struct OopAndMarkOop {
 862    private:
 863     oop _o;
 864     markOop _m;
 865    public:
 866     OopAndMarkOop(oop obj, markOop m) : _o(obj), _m(m) {











 867     }
 868 
 869     void set_mark() {
 870       _o->set_mark(_m);
 871     }
 872   };



 873   
 874   typedef Stack<OopAndMarkOop,mtGC> OopAndMarkOopStack;
 875   // Stores marks with the corresponding oop that we need to preserve during evacuation
 876   // failure.
 877   OopAndMarkOopStack*  _preserved_objs;



 878 
 879   // Preserve the mark of "obj", if necessary, in preparation for its mark
 880   // word being overwritten with a self-forwarding-pointer.
 881   void preserve_mark_during_evac_failure(uint queue, oop obj, markOop m);
 882 
 883 #ifndef PRODUCT
 884   // Support for forcing evacuation failures. Analogous to
 885   // PromotionFailureALot for the other collectors.
 886 
 887   // Records whether G1EvacuationFailureALot should be in effect
 888   // for the current GC
 889   bool _evacuation_failure_alot_for_current_gc;
 890 
 891   // Used to record the GC number for interval checking when
 892   // determining whether G1EvaucationFailureALot is in effect
 893   // for the current GC.
 894   size_t _evacuation_failure_alot_gc_number;
 895 
 896   // Count of the number of evacuations between failures.
 897   volatile size_t _evacuation_failure_alot_count;
 898 
 899   // Set whether G1EvacuationFailureALot should be in effect
 900   // for the current GC (based upon the type of GC and which
 901   // command line flags are set);


< prev index next >