53 #include "utilities/workgroup.hpp"
54 #include "utilities/macros.hpp"
55 #if INCLUDE_ALL_GCS
56 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
57 #include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
58 #endif // INCLUDE_ALL_GCS
59
60 GenCollectedHeap* GenCollectedHeap::_gch;
61 NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;)
62
63 // The set of potentially parallel tasks in root scanning.
64 enum GCH_strong_roots_tasks {
65 // We probably want to parallelize both of these internally, but for now...
66 GCH_PS_younger_gens,
67 // Leave this one last.
68 GCH_PS_NumElements
69 };
70
71 GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
72 SharedHeap(policy),
73 _gen_policy(policy),
74 _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
75 _full_collections_completed(0)
76 {
77 if (_gen_process_roots_tasks == NULL ||
78 !_gen_process_roots_tasks->valid()) {
79 vm_exit_during_initialization("Failed necessary allocation.");
80 }
81 assert(policy != NULL, "Sanity check");
82 }
83
84 jint GenCollectedHeap::initialize() {
85 CollectedHeap::pre_initialize();
86
87 int i;
88 _n_gens = gen_policy()->number_of_generations();
89
90 // While there are no constraints in the GC code that HeapWordSize
91 // be any particular value, there are multiple other areas in the
92 // system which believe this to be true (e.g. oop->object_size in some
|
53 #include "utilities/workgroup.hpp"
54 #include "utilities/macros.hpp"
55 #if INCLUDE_ALL_GCS
56 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
57 #include "gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp"
58 #endif // INCLUDE_ALL_GCS
59
60 GenCollectedHeap* GenCollectedHeap::_gch;
61 NOT_PRODUCT(size_t GenCollectedHeap::_skip_header_HeapWords = 0;)
62
63 // The set of potentially parallel tasks in root scanning.
64 enum GCH_strong_roots_tasks {
65 // We probably want to parallelize both of these internally, but for now...
66 GCH_PS_younger_gens,
67 // Leave this one last.
68 GCH_PS_NumElements
69 };
70
71 GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
72 SharedHeap(policy),
73 _rem_set(NULL),
74 _gen_policy(policy),
75 _gen_process_roots_tasks(new SubTasksDone(GCH_PS_NumElements)),
76 _full_collections_completed(0)
77 {
78 if (_gen_process_roots_tasks == NULL ||
79 !_gen_process_roots_tasks->valid()) {
80 vm_exit_during_initialization("Failed necessary allocation.");
81 }
82 assert(policy != NULL, "Sanity check");
83 }
84
85 jint GenCollectedHeap::initialize() {
86 CollectedHeap::pre_initialize();
87
88 int i;
89 _n_gens = gen_policy()->number_of_generations();
90
91 // While there are no constraints in the GC code that HeapWordSize
92 // be any particular value, there are multiple other areas in the
93 // system which believe this to be true (e.g. oop->object_size in some
|