24 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP 27 28 #include "gc_implementation/shared/collectorCounters.hpp" 29 #include "gc_implementation/shared/markSweep.inline.hpp" 30 #include "utilities/stack.hpp" 31 32 class PSAdaptiveSizePolicy; 33 class PSYoungGen; 34 class PSOldGen; 35 36 class PSMarkSweep : public MarkSweep { 37 private: 38 static elapsedTimer _accumulated_time; 39 static jlong _time_of_last_gc; // ms 40 static CollectorCounters* _counters; 41 42 // Closure accessors 43 static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; } 44 static KlassClosure* follow_klass_closure() { return &MarkSweep::follow_klass_closure; } 45 static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; } 46 static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; } 47 static KlassClosure* adjust_klass_closure() { return &MarkSweep::adjust_klass_closure; } 48 static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&MarkSweep::is_alive; } 49 50 debug_only(public:) // Used for PSParallelCompact debugging 51 // Mark live objects 52 static void mark_sweep_phase1(bool clear_all_softrefs); 53 // Calculate new addresses 54 static void mark_sweep_phase2(); 55 debug_only(private:) // End used for PSParallelCompact debugging 56 // Update pointers 57 static void mark_sweep_phase3(); 58 // Move objects to new positions 59 static void mark_sweep_phase4(); 60 61 debug_only(public:) // Used for PSParallelCompact debugging 62 // Temporary data structures for traversal and storing/restoring marks 63 static void allocate_stacks(); 64 static void deallocate_stacks(); 65 static void set_ref_processor(ReferenceProcessor* rp) { // delete this method 66 _ref_processor = rp; 67 } | 24 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP 27 28 #include "gc_implementation/shared/collectorCounters.hpp" 29 #include "gc_implementation/shared/markSweep.inline.hpp" 30 #include "utilities/stack.hpp" 31 32 class PSAdaptiveSizePolicy; 33 class PSYoungGen; 34 class PSOldGen; 35 36 class PSMarkSweep : public MarkSweep { 37 private: 38 static elapsedTimer _accumulated_time; 39 static jlong _time_of_last_gc; // ms 40 static CollectorCounters* _counters; 41 42 // Closure accessors 43 static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; } 44 static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; } 45 static CLDClosure* follow_cld_closure() { return &MarkSweep::follow_cld_closure; } 46 static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; } 47 static CLDClosure* adjust_cld_closure() { return &MarkSweep::adjust_cld_closure; } 48 static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&MarkSweep::is_alive; } 49 50 debug_only(public:) // Used for PSParallelCompact debugging 51 // Mark live objects 52 static void mark_sweep_phase1(bool clear_all_softrefs); 53 // Calculate new addresses 54 static void mark_sweep_phase2(); 55 debug_only(private:) // End used for PSParallelCompact debugging 56 // Update pointers 57 static void mark_sweep_phase3(); 58 // Move objects to new positions 59 static void mark_sweep_phase4(); 60 61 debug_only(public:) // Used for PSParallelCompact debugging 62 // Temporary data structures for traversal and storing/restoring marks 63 static void allocate_stacks(); 64 static void deallocate_stacks(); 65 static void set_ref_processor(ReferenceProcessor* rp) { // delete this method 66 _ref_processor = rp; 67 } |