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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
27
28 #include "gc_implementation/parallelScavenge/psPromotionLAB.hpp"
29 #include "gc_implementation/shared/gcTrace.hpp"
30 #include "gc_implementation/shared/copyFailedInfo.hpp"
31 #include "memory/allocation.hpp"
32 #include "memory/padded.hpp"
33 #include "utilities/globalDefinitions.hpp"
34 #include "utilities/taskqueue.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 VALUE_OBJ_CLASS_SPEC {
53 friend class PSScavenge;
54 friend class PSRefProcTaskExecutor;
191
192 bool stacks_empty() {
193 return claimed_stack_depth()->is_empty();
194 }
195
196 inline void process_popped_location_depth(StarTask p);
197
198 static bool should_scavenge(oop* p, bool check_to_space = false);
199 static bool should_scavenge(narrowOop* p, bool check_to_space = false);
200
201 template <class T, bool promote_immediately>
202 void copy_and_push_safe_barrier(T* p);
203
204 template <class T> inline void claim_or_forward_depth(T* p);
205
206 TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);)
207
208 void push_contents(oop obj);
209 };
210
211 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_HPP
|
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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/taskqueue.hpp"
32 #include "memory/allocation.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 VALUE_OBJ_CLASS_SPEC {
53 friend class PSScavenge;
54 friend class PSRefProcTaskExecutor;
191
192 bool stacks_empty() {
193 return claimed_stack_depth()->is_empty();
194 }
195
196 inline void process_popped_location_depth(StarTask p);
197
198 static bool should_scavenge(oop* p, bool check_to_space = false);
199 static bool should_scavenge(narrowOop* p, bool check_to_space = false);
200
201 template <class T, bool promote_immediately>
202 void copy_and_push_safe_barrier(T* p);
203
204 template <class T> inline void claim_or_forward_depth(T* p);
205
206 TASKQUEUE_STATS_ONLY(inline void record_steal(StarTask& p);)
207
208 void push_contents(oop obj);
209 };
210
211 #endif // SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_HPP
|