Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @ 3710:4e037604f6ee
use alignment for constants specified in DataPatch.alignment
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 05 Dec 2011 18:15:25 -0800 |
parents | f95d63e2154a |
children | 95f6641e38e0 |
rev | line source |
---|---|
0 | 1 /* |
1665 | 2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
845
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
845
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
845
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 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/psPromotionManager.hpp" | |
29 #include "gc_implementation/parallelScavenge/psScavenge.hpp" | |
30 | |
0 | 31 inline PSPromotionManager* PSPromotionManager::manager_array(int index) { |
32 assert(_manager_array != NULL, "access of NULL manager_array"); | |
33 assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); | |
34 return _manager_array[index]; | |
35 } | |
36 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
37 template <class T> |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
38 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
39 if (p != NULL) { // XXX: error if p != NULL here |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
40 oop o = oopDesc::load_decode_heap_oop_not_null(p); |
0 | 41 if (o->is_forwarded()) { |
42 o = o->forwardee(); | |
43 // Card mark | |
44 if (PSScavenge::is_obj_in_young((HeapWord*) o)) { | |
45 PSScavenge::card_table()->inline_write_ref_field_gc(p, o); | |
46 } | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
47 oopDesc::encode_store_heap_oop_not_null(p, o); |
0 | 48 } else { |
49 push_depth(p); | |
50 } | |
51 } | |
52 } | |
53 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
54 template <class T> |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
55 inline void PSPromotionManager::claim_or_forward_depth(T* p) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
56 assert(PSScavenge::should_scavenge(p, true), "revisiting object?"); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
57 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
58 "Sanity"); |
0 | 59 assert(Universe::heap()->is_in(p), "pointer outside heap"); |
60 | |
61 claim_or_forward_internal_depth(p); | |
62 } | |
63 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
64 inline void PSPromotionManager::process_popped_location_depth(StarTask p) { |
0 | 65 if (is_oop_masked(p)) { |
66 assert(PSChunkLargeArrays, "invariant"); | |
67 oop const old = unmask_chunked_array_oop(p); | |
68 process_array_chunk(old); | |
69 } else { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
70 if (p.is_narrow()) { |
845
df6caf649ff7
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
196
diff
changeset
|
71 assert(UseCompressedOops, "Error"); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
72 PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
73 } else { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
74 PSScavenge::copy_and_push_safe_barrier(this, (oop*)p); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
75 } |
0 | 76 } |
77 } | |
1665 | 78 |
79 #if TASKQUEUE_STATS | |
80 void PSPromotionManager::record_steal(StarTask& p) { | |
81 if (is_oop_masked(p)) { | |
82 ++_masked_steals; | |
83 } | |
84 } | |
85 #endif // TASKQUEUE_STATS | |
1972 | 86 |
87 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP |