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_INLINE_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
27
28 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
29 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
30 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
31 #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
32 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "utilities/taskqueue.inline.hpp"
35
36 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
37 assert(_manager_array != NULL, "access of NULL manager_array");
38 assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
39 return &_manager_array[index];
40 }
41
42 template <class T>
43 inline void PSPromotionManager::push_depth(T* p) {
44 claimed_stack_depth()->push(p);
45 }
46
47 template <class T>
48 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
49 if (p != NULL) { // XXX: error if p != NULL here
50 oop o = oopDesc::load_decode_heap_oop_not_null(p);
51 if (o->is_forwarded()) {
52 o = o->forwardee();
53 // Card mark
54 if (PSScavenge::is_obj_in_young(o)) {
318 assert(UseCompressedOops, "Error");
319 copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(p);
320 } else {
321 copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p);
322 }
323 }
324 }
325
326 inline bool PSPromotionManager::steal_depth(int queue_num, int* seed, StarTask& t) {
327 return stack_array_depth()->steal(queue_num, seed, t);
328 }
329
330 #if TASKQUEUE_STATS
331 void PSPromotionManager::record_steal(StarTask& p) {
332 if (is_oop_masked(p)) {
333 ++_masked_steals;
334 }
335 }
336 #endif // TASKQUEUE_STATS
337
338 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_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_INLINE_HPP
26 #define SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_INLINE_HPP
27
28 #include "gc/parallel/parallelScavengeHeap.hpp"
29 #include "gc/parallel/psOldGen.hpp"
30 #include "gc/parallel/psPromotionLAB.inline.hpp"
31 #include "gc/parallel/psPromotionManager.hpp"
32 #include "gc/parallel/psScavenge.hpp"
33 #include "gc/shared/taskqueue.inline.hpp"
34 #include "oops/oop.inline.hpp"
35
36 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
37 assert(_manager_array != NULL, "access of NULL manager_array");
38 assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
39 return &_manager_array[index];
40 }
41
42 template <class T>
43 inline void PSPromotionManager::push_depth(T* p) {
44 claimed_stack_depth()->push(p);
45 }
46
47 template <class T>
48 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
49 if (p != NULL) { // XXX: error if p != NULL here
50 oop o = oopDesc::load_decode_heap_oop_not_null(p);
51 if (o->is_forwarded()) {
52 o = o->forwardee();
53 // Card mark
54 if (PSScavenge::is_obj_in_young(o)) {
318 assert(UseCompressedOops, "Error");
319 copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(p);
320 } else {
321 copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p);
322 }
323 }
324 }
325
326 inline bool PSPromotionManager::steal_depth(int queue_num, int* seed, StarTask& t) {
327 return stack_array_depth()->steal(queue_num, seed, t);
328 }
329
330 #if TASKQUEUE_STATS
331 void PSPromotionManager::record_steal(StarTask& p) {
332 if (is_oop_masked(p)) {
333 ++_masked_steals;
334 }
335 }
336 #endif // TASKQUEUE_STATS
337
338 #endif // SHARE_VM_GC_PARALLEL_PSPROMOTIONMANAGER_INLINE_HPP
|