96 // The active_workers is not reset to 0 after a parallel phase. It's 97 // value may be used in later phases and in one instance at least 98 // (the parallel remark) it has to be used (the parallel remark depends 99 // on the partitioning done in the previous parallel scavenge). 100 101 class SharedHeap : public CollectedHeap { 102 friend class VMStructs; 103 104 friend class VM_GC_Operation; 105 friend class VM_CGC_Operation; 106 107 protected: 108 // If we're doing parallel GC, use this gang of threads. 109 FlexibleWorkGang* _workers; 110 111 // Full initialization is done in a concrete subtype's "initialize" 112 // function. 113 SharedHeap(); 114 115 public: 116 // Does operations required after initialization has been done. 117 virtual void post_initialize(); 118 119 // Initialization of ("weak") reference processing support 120 virtual void ref_processing_init(); 121 122 // Iteration functions. 123 void oop_iterate(ExtendedOopClosure* cl) = 0; 124 125 // Iterate over all spaces in use in the heap, in an undefined order. 126 virtual void space_iterate(SpaceClosure* cl) = 0; 127 128 // A SharedHeap will contain some number of spaces. This finds the 129 // space whose reserved area contains the given address, or else returns 130 // NULL. 131 virtual Space* space_containing(const void* addr) const = 0; 132 133 bool no_gc_in_progress() { return !is_gc_active(); } 134 135 // Note, the below comment needs to be updated to reflect the changes 136 // introduced by JDK-8076225. This should be done as part of JDK-8076289. 137 // 138 //Some collectors will perform "process_strong_roots" in parallel. 139 // Such a call will involve claiming some fine-grained tasks, such as 140 // scanning of threads. To make this process simpler, we provide the 141 // "strong_roots_parity()" method. Collectors that start parallel tasks | 96 // The active_workers is not reset to 0 after a parallel phase. It's 97 // value may be used in later phases and in one instance at least 98 // (the parallel remark) it has to be used (the parallel remark depends 99 // on the partitioning done in the previous parallel scavenge). 100 101 class SharedHeap : public CollectedHeap { 102 friend class VMStructs; 103 104 friend class VM_GC_Operation; 105 friend class VM_CGC_Operation; 106 107 protected: 108 // If we're doing parallel GC, use this gang of threads. 109 FlexibleWorkGang* _workers; 110 111 // Full initialization is done in a concrete subtype's "initialize" 112 // function. 113 SharedHeap(); 114 115 public: 116 // Iteration functions. 117 void oop_iterate(ExtendedOopClosure* cl) = 0; 118 119 // Iterate over all spaces in use in the heap, in an undefined order. 120 virtual void space_iterate(SpaceClosure* cl) = 0; 121 122 // A SharedHeap will contain some number of spaces. This finds the 123 // space whose reserved area contains the given address, or else returns 124 // NULL. 125 virtual Space* space_containing(const void* addr) const = 0; 126 127 bool no_gc_in_progress() { return !is_gc_active(); } 128 129 // Note, the below comment needs to be updated to reflect the changes 130 // introduced by JDK-8076225. This should be done as part of JDK-8076289. 131 // 132 //Some collectors will perform "process_strong_roots" in parallel. 133 // Such a call will involve claiming some fine-grained tasks, such as 134 // scanning of threads. To make this process simpler, we provide the 135 // "strong_roots_parity()" method. Collectors that start parallel tasks |