13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_CMSHEAP_HPP
26 #define SHARE_VM_GC_CMS_CMSHEAP_HPP
27
28 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
29 #include "gc/cms/parNewGeneration.hpp"
30 #include "gc/shared/collectedHeap.hpp"
31 #include "gc/shared/gcCause.hpp"
32 #include "gc/shared/genCollectedHeap.hpp"
33 #include "utilities/growableArray.hpp"
34
35 class CLDClosure;
36 class GenCollectorPolicy;
37 class GCMemoryManager;
38 class MemoryPool;
39 class OopsInGenClosure;
40 class outputStream;
41 class StrongRootsScope;
42 class ThreadClosure;
43 class WorkGang;
44
45 class CMSHeap : public GenCollectedHeap {
46 public:
47 CMSHeap(GenCollectorPolicy *policy);
48
49 // Returns JNI_OK on success
50 virtual jint initialize();
51 virtual CardTableRS* create_rem_set(const MemRegion& reserved_region);
52
73 // supports. Caller does not hold the Heap_lock on entry.
74 void collect(GCCause::Cause cause);
75
76 void stop();
77 void safepoint_synchronize_begin();
78 void safepoint_synchronize_end();
79
80 virtual GrowableArray<GCMemoryManager*> memory_managers();
81 virtual GrowableArray<MemoryPool*> memory_pools();
82
83 // If "young_gen_as_roots" is false, younger generations are
84 // not scanned as roots; in this case, the caller must be arranging to
85 // scan the younger generations itself. (For example, a generation might
86 // explicitly mark reachable objects in younger generations, to avoid
87 // excess storage retention.)
88 void cms_process_roots(StrongRootsScope* scope,
89 bool young_gen_as_roots,
90 ScanningOption so,
91 bool only_strong_roots,
92 OopsInGenClosure* root_closure,
93 CLDClosure* cld_closure);
94
95 GCMemoryManager* old_manager() const { return _old_manager; }
96
97 ParNewGeneration* young_gen() const {
98 assert(_young_gen->kind() == Generation::ParNew, "Wrong generation type");
99 return static_cast<ParNewGeneration*>(_young_gen);
100 }
101
102 ConcurrentMarkSweepGeneration* old_gen() const {
103 assert(_old_gen->kind() == Generation::ConcurrentMarkSweep, "Wrong generation kind");
104 return static_cast<ConcurrentMarkSweepGeneration*>(_old_gen);
105 }
106
107 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
108 // allocated since the last call to save_marks in the young generation.
109 // The "cur" closure is applied to references in the younger generation
110 // at "level", and the "older" closure to older generations.
111 template <typename OopClosureType1, typename OopClosureType2>
112 void oop_since_save_marks_iterate(OopClosureType1* cur,
113 OopClosureType2* older);
|
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_CMS_CMSHEAP_HPP
26 #define SHARE_VM_GC_CMS_CMSHEAP_HPP
27
28 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
29 #include "gc/cms/parNewGeneration.hpp"
30 #include "gc/shared/collectedHeap.hpp"
31 #include "gc/shared/gcCause.hpp"
32 #include "gc/shared/genCollectedHeap.hpp"
33 #include "gc/shared/oopStorageParState.hpp"
34 #include "utilities/growableArray.hpp"
35
36 class CLDClosure;
37 class GenCollectorPolicy;
38 class GCMemoryManager;
39 class MemoryPool;
40 class OopsInGenClosure;
41 class outputStream;
42 class StrongRootsScope;
43 class ThreadClosure;
44 class WorkGang;
45
46 class CMSHeap : public GenCollectedHeap {
47 public:
48 CMSHeap(GenCollectorPolicy *policy);
49
50 // Returns JNI_OK on success
51 virtual jint initialize();
52 virtual CardTableRS* create_rem_set(const MemRegion& reserved_region);
53
74 // supports. Caller does not hold the Heap_lock on entry.
75 void collect(GCCause::Cause cause);
76
77 void stop();
78 void safepoint_synchronize_begin();
79 void safepoint_synchronize_end();
80
81 virtual GrowableArray<GCMemoryManager*> memory_managers();
82 virtual GrowableArray<MemoryPool*> memory_pools();
83
84 // If "young_gen_as_roots" is false, younger generations are
85 // not scanned as roots; in this case, the caller must be arranging to
86 // scan the younger generations itself. (For example, a generation might
87 // explicitly mark reachable objects in younger generations, to avoid
88 // excess storage retention.)
89 void cms_process_roots(StrongRootsScope* scope,
90 bool young_gen_as_roots,
91 ScanningOption so,
92 bool only_strong_roots,
93 OopsInGenClosure* root_closure,
94 CLDClosure* cld_closure,
95 OopStorage::ParState<false, false>* par_state_string = NULL);
96
97 GCMemoryManager* old_manager() const { return _old_manager; }
98
99 ParNewGeneration* young_gen() const {
100 assert(_young_gen->kind() == Generation::ParNew, "Wrong generation type");
101 return static_cast<ParNewGeneration*>(_young_gen);
102 }
103
104 ConcurrentMarkSweepGeneration* old_gen() const {
105 assert(_old_gen->kind() == Generation::ConcurrentMarkSweep, "Wrong generation kind");
106 return static_cast<ConcurrentMarkSweepGeneration*>(_old_gen);
107 }
108
109 // Apply "cur->do_oop" or "older->do_oop" to all the oops in objects
110 // allocated since the last call to save_marks in the young generation.
111 // The "cur" closure is applied to references in the younger generation
112 // at "level", and the "older" closure to older generations.
113 template <typename OopClosureType1, typename OopClosureType2>
114 void oop_since_save_marks_iterate(OopClosureType1* cur,
115 OopClosureType2* older);
|