1 /* |
1 /* |
2 * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
24 |
24 |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP |
27 |
27 |
28 #include "gc_implementation/parallelScavenge/psPromotionLAB.hpp" |
28 #include "gc_implementation/parallelScavenge/psPromotionLAB.hpp" |
|
29 #include "gc_implementation/shared/gcTrace.hpp" |
|
30 #include "gc_implementation/shared/copyFailedInfo.hpp" |
29 #include "memory/allocation.hpp" |
31 #include "memory/allocation.hpp" |
30 #include "utilities/taskqueue.hpp" |
32 #include "utilities/taskqueue.hpp" |
31 |
33 |
32 // |
34 // |
33 // psPromotionManager is used by a single thread to manage object survival |
35 // psPromotionManager is used by a single thread to manage object survival |
34 // during a scavenge. The promotion manager contains thread local data only. |
36 // during a scavenge. The promotion manager contains thread local data only. |
35 // |
37 // |
36 // NOTE! Be carefull when allocating the stacks on cheap. If you are going |
38 // NOTE! Be careful when allocating the stacks on cheap. If you are going |
37 // to use a promotion manager in more than one thread, the stacks MUST be |
39 // to use a promotion manager in more than one thread, the stacks MUST be |
38 // on cheap. This can lead to memory leaks, though, as they are not auto |
40 // on cheap. This can lead to memory leaks, though, as they are not auto |
39 // deallocated. |
41 // deallocated. |
40 // |
42 // |
41 // FIX ME FIX ME Add a destructor, and don't rely on the user to drain/flush/deallocate! |
43 // FIX ME FIX ME Add a destructor, and don't rely on the user to drain/flush/deallocate! |
82 bool _totally_drain; |
84 bool _totally_drain; |
83 uint _target_stack_size; |
85 uint _target_stack_size; |
84 |
86 |
85 uint _array_chunk_size; |
87 uint _array_chunk_size; |
86 uint _min_array_size_for_chunking; |
88 uint _min_array_size_for_chunking; |
|
89 |
|
90 PromotionFailedInfo _promotion_failed_info; |
87 |
91 |
88 // Accessors |
92 // Accessors |
89 static PSOldGen* old_gen() { return _old_gen; } |
93 static PSOldGen* old_gen() { return _old_gen; } |
90 static MutableSpace* young_space() { return _young_space; } |
94 static MutableSpace* young_space() { return _young_space; } |
91 |
95 |
147 public: |
151 public: |
148 // Static |
152 // Static |
149 static void initialize(); |
153 static void initialize(); |
150 |
154 |
151 static void pre_scavenge(); |
155 static void pre_scavenge(); |
152 static void post_scavenge(); |
156 static bool post_scavenge(YoungGCTracer& gc_tracer); |
153 |
157 |
154 static PSPromotionManager* gc_thread_promotion_manager(int index); |
158 static PSPromotionManager* gc_thread_promotion_manager(int index); |
155 static PSPromotionManager* vm_thread_promotion_manager(); |
159 static PSPromotionManager* vm_thread_promotion_manager(); |
156 |
160 |
157 static bool steal_depth(int queue_num, int* seed, StarTask& t) { |
161 static bool steal_depth(int queue_num, int* seed, StarTask& t) { |