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_PARALLEL_PSPROMOTIONMANAGER_HPP
26 #define SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_HPP
27
28 #include "gc/parallel/psPromotionLAB.hpp"
29 #include "gc/shared/copyFailedInfo.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "gc/shared/preservedMarks.hpp"
32 #include "gc/shared/taskqueue.hpp"
33 #include "memory/allocation.hpp"
34 #include "memory/padded.hpp"
35 #include "utilities/globalDefinitions.hpp"
36
37 //
38 // psPromotionManager is used by a single thread to manage object survival
39 // during a scavenge. The promotion manager contains thread local data only.
40 //
41 // NOTE! Be careful when allocating the stacks on cheap. If you are going
42 // to use a promotion manager in more than one thread, the stacks MUST be
43 // on cheap. This can lead to memory leaks, though, as they are not auto
44 // deallocated.
45 //
46 // FIX ME FIX ME Add a destructor, and don't rely on the user to drain/flush/deallocate!
47 //
48
49 class MutableSpace;
50 class PSOldGen;
51 class ParCompactionManager;
52
53 class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
54 friend class PSScavenge;
55 friend class PSRefProcTaskExecutor;
56 private:
57 static PaddedEnd<PSPromotionManager>* _manager_array;
58 static OopStarTaskQueueSet* _stack_array_depth;
59 static PreservedMarksSet* _preserved_marks_set;
60 static PSOldGen* _old_gen;
61 static MutableSpace* _young_space;
62
63 #if TASKQUEUE_STATS
64 size_t _masked_pushes;
65 size_t _masked_steals;
66 size_t _arrays_chunked;
67 size_t _array_chunks_processed;
68
69 void print_local_stats(outputStream* const out, uint i) const;
70 static void print_taskqueue_stats();
71
72 void reset_stats();
73 #endif // TASKQUEUE_STATS
|
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_PARALLEL_PSPROMOTIONMANAGER_HPP
26 #define SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_HPP
27
28 #include "gc/parallel/psPromotionLAB.hpp"
29 #include "gc/shared/copyFailedInfo.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "gc/shared/preservedMarks.hpp"
32 #include "gc/shared/taskqueue.hpp"
33 #include "memory/padded.hpp"
34 #include "utilities/globalDefinitions.hpp"
35
36 //
37 // psPromotionManager is used by a single thread to manage object survival
38 // during a scavenge. The promotion manager contains thread local data only.
39 //
40 // NOTE! Be careful when allocating the stacks on cheap. If you are going
41 // to use a promotion manager in more than one thread, the stacks MUST be
42 // on cheap. This can lead to memory leaks, though, as they are not auto
43 // deallocated.
44 //
45 // FIX ME FIX ME Add a destructor, and don't rely on the user to drain/flush/deallocate!
46 //
47
48 class MutableSpace;
49 class PSOldGen;
50 class ParCompactionManager;
51
52 class PSPromotionManager {
53 friend class PSScavenge;
54 friend class PSRefProcTaskExecutor;
55 private:
56 static PaddedEnd<PSPromotionManager>* _manager_array;
57 static OopStarTaskQueueSet* _stack_array_depth;
58 static PreservedMarksSet* _preserved_marks_set;
59 static PSOldGen* _old_gen;
60 static MutableSpace* _young_space;
61
62 #if TASKQUEUE_STATS
63 size_t _masked_pushes;
64 size_t _masked_steals;
65 size_t _arrays_chunked;
66 size_t _array_chunks_processed;
67
68 void print_local_stats(outputStream* const out, uint i) const;
69 static void print_taskqueue_stats();
70
71 void reset_stats();
72 #endif // TASKQUEUE_STATS
|