author | stefank |
Fri, 20 Feb 2015 13:54:42 +0100 | |
changeset 29208 | b570d043f295 |
parent 28177 | 318600b0d7db |
child 29792 | 8c6fa07f0869 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
22838
diff
changeset
|
2 |
* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3262
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3262
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3262
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP |
26 |
#define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP |
|
27 |
||
12226
590560cfc997
7154517: Build error in hotspot-gc without precompiled headers
nloodin
parents:
11753
diff
changeset
|
28 |
#include "gc_implementation/parallelScavenge/psOldGen.hpp" |
7397 | 29 |
#include "gc_implementation/parallelScavenge/psPromotionManager.hpp" |
25905
04a3d83cc752
8031323: Optionally align objects copied to survivor spaces
jmasa
parents:
24424
diff
changeset
|
30 |
#include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp" |
7397 | 31 |
#include "gc_implementation/parallelScavenge/psScavenge.hpp" |
22807 | 32 |
#include "oops/oop.psgc.inline.hpp" |
7397 | 33 |
|
1 | 34 |
inline PSPromotionManager* PSPromotionManager::manager_array(int index) { |
35 |
assert(_manager_array != NULL, "access of NULL manager_array"); |
|
36 |
assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); |
|
19285
0a3b3f115402
8022880: False sharing between PSPromotionManager instances
stefank
parents:
18025
diff
changeset
|
37 |
return &_manager_array[index]; |
1 | 38 |
} |
39 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
40 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
41 |
inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
42 |
if (p != NULL) { // XXX: error if p != NULL here |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
43 |
oop o = oopDesc::load_decode_heap_oop_not_null(p); |
1 | 44 |
if (o->is_forwarded()) { |
45 |
o = o->forwardee(); |
|
46 |
// Card mark |
|
17852
59b05e1db547
8015486: PSScavenge::is_obj_in_young is unnecessarily slow with UseCompressedOops
stefank
parents:
13925
diff
changeset
|
47 |
if (PSScavenge::is_obj_in_young(o)) { |
1 | 48 |
PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
49 |
} |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
50 |
oopDesc::encode_store_heap_oop_not_null(p, o); |
1 | 51 |
} else { |
52 |
push_depth(p); |
|
53 |
} |
|
54 |
} |
|
55 |
} |
|
56 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
57 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
58 |
inline void PSPromotionManager::claim_or_forward_depth(T* p) { |
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
59 |
assert(should_scavenge(p, true), "revisiting object?"); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
60 |
assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
61 |
"Sanity"); |
1 | 62 |
assert(Universe::heap()->is_in(p), "pointer outside heap"); |
63 |
||
64 |
claim_or_forward_internal_depth(p); |
|
65 |
} |
|
66 |
||
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
67 |
inline void PSPromotionManager::promotion_trace_event(oop new_obj, oop old_obj, |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
68 |
size_t obj_size, |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
69 |
uint age, bool tenured, |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
70 |
const PSPromotionLAB* lab) { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
71 |
// Skip if memory allocation failed |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
72 |
if (new_obj != NULL) { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
73 |
const ParallelScavengeTracer* gc_tracer = PSScavenge::gc_tracer(); |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
74 |
|
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
75 |
if (lab != NULL) { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
76 |
// Promotion of object through newly allocated PLAB |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
77 |
if (gc_tracer->should_report_promotion_in_new_plab_event()) { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
78 |
size_t obj_bytes = obj_size * HeapWordSize; |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
79 |
size_t lab_size = lab->capacity(); |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
80 |
gc_tracer->report_promotion_in_new_plab_event(old_obj->klass(), obj_bytes, |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
81 |
age, tenured, lab_size); |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
82 |
} |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
83 |
} else { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
84 |
// Promotion of object directly to heap |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
85 |
if (gc_tracer->should_report_promotion_outside_plab_event()) { |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
86 |
size_t obj_bytes = obj_size * HeapWordSize; |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
87 |
gc_tracer->report_promotion_outside_plab_event(old_obj->klass(), obj_bytes, |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
88 |
age, tenured); |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
89 |
} |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
90 |
} |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
91 |
} |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
92 |
} |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
93 |
|
11753 | 94 |
// |
95 |
// This method is pretty bulky. It would be nice to split it up |
|
96 |
// into smaller submethods, but we need to be careful not to hurt |
|
97 |
// performance. |
|
98 |
// |
|
99 |
template<bool promote_immediately> |
|
100 |
oop PSPromotionManager::copy_to_survivor_space(oop o) { |
|
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
101 |
assert(should_scavenge(&o), "Sanity"); |
11753 | 102 |
|
103 |
oop new_obj = NULL; |
|
104 |
||
105 |
// NOTE! We must be very careful with any methods that access the mark |
|
106 |
// in o. There may be multiple threads racing on it, and it may be forwarded |
|
107 |
// at any time. Do not use oop methods for accessing the mark! |
|
108 |
markOop test_mark = o->mark(); |
|
109 |
||
110 |
// The same test as "o->is_forwarded()" |
|
111 |
if (!test_mark->is_marked()) { |
|
112 |
bool new_obj_is_tenured = false; |
|
113 |
size_t new_obj_size = o->size(); |
|
114 |
||
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
115 |
// Find the objects age, MT safe. |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
116 |
uint age = (test_mark->has_displaced_mark_helper() /* o->has_displaced_mark() */) ? |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
117 |
test_mark->displaced_mark_helper()->age() : test_mark->age(); |
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
118 |
|
11753 | 119 |
if (!promote_immediately) { |
120 |
// Try allocating obj in to-space (unless too old) |
|
121 |
if (age < PSScavenge::tenuring_threshold()) { |
|
122 |
new_obj = (oop) _young_lab.allocate(new_obj_size); |
|
123 |
if (new_obj == NULL && !_young_gen_is_full) { |
|
124 |
// Do we allocate directly, or flush and refill? |
|
125 |
if (new_obj_size > (YoungPLABSize / 2)) { |
|
126 |
// Allocate this object directly |
|
127 |
new_obj = (oop)young_space()->cas_allocate(new_obj_size); |
|
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
128 |
promotion_trace_event(new_obj, o, new_obj_size, age, false, NULL); |
11753 | 129 |
} else { |
130 |
// Flush and fill |
|
131 |
_young_lab.flush(); |
|
132 |
||
133 |
HeapWord* lab_base = young_space()->cas_allocate(YoungPLABSize); |
|
134 |
if (lab_base != NULL) { |
|
135 |
_young_lab.initialize(MemRegion(lab_base, YoungPLABSize)); |
|
136 |
// Try the young lab allocation again. |
|
137 |
new_obj = (oop) _young_lab.allocate(new_obj_size); |
|
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
138 |
promotion_trace_event(new_obj, o, new_obj_size, age, false, &_young_lab); |
11753 | 139 |
} else { |
140 |
_young_gen_is_full = true; |
|
141 |
} |
|
142 |
} |
|
143 |
} |
|
144 |
} |
|
145 |
} |
|
146 |
||
147 |
// Otherwise try allocating obj tenured |
|
148 |
if (new_obj == NULL) { |
|
149 |
#ifndef PRODUCT |
|
150 |
if (Universe::heap()->promotion_should_fail()) { |
|
151 |
return oop_promotion_failed(o, test_mark); |
|
152 |
} |
|
153 |
#endif // #ifndef PRODUCT |
|
154 |
||
155 |
new_obj = (oop) _old_lab.allocate(new_obj_size); |
|
156 |
new_obj_is_tenured = true; |
|
157 |
||
158 |
if (new_obj == NULL) { |
|
159 |
if (!_old_gen_is_full) { |
|
160 |
// Do we allocate directly, or flush and refill? |
|
161 |
if (new_obj_size > (OldPLABSize / 2)) { |
|
162 |
// Allocate this object directly |
|
163 |
new_obj = (oop)old_gen()->cas_allocate(new_obj_size); |
|
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
164 |
promotion_trace_event(new_obj, o, new_obj_size, age, true, NULL); |
11753 | 165 |
} else { |
166 |
// Flush and fill |
|
167 |
_old_lab.flush(); |
|
168 |
||
169 |
HeapWord* lab_base = old_gen()->cas_allocate(OldPLABSize); |
|
170 |
if(lab_base != NULL) { |
|
13924 | 171 |
#ifdef ASSERT |
172 |
// Delay the initialization of the promotion lab (plab). |
|
173 |
// This exposes uninitialized plabs to card table processing. |
|
174 |
if (GCWorkerDelayMillis > 0) { |
|
175 |
os::sleep(Thread::current(), GCWorkerDelayMillis, false); |
|
176 |
} |
|
177 |
#endif |
|
11753 | 178 |
_old_lab.initialize(MemRegion(lab_base, OldPLABSize)); |
179 |
// Try the old lab allocation again. |
|
180 |
new_obj = (oop) _old_lab.allocate(new_obj_size); |
|
28177
318600b0d7db
8066442: Add PS and ParOld support for promotion event
sfriberg
parents:
25905
diff
changeset
|
181 |
promotion_trace_event(new_obj, o, new_obj_size, age, true, &_old_lab); |
11753 | 182 |
} |
183 |
} |
|
184 |
} |
|
185 |
||
186 |
// This is the promotion failed test, and code handling. |
|
187 |
// The code belongs here for two reasons. It is slightly |
|
18025 | 188 |
// different than the code below, and cannot share the |
11753 | 189 |
// CAS testing code. Keeping the code here also minimizes |
190 |
// the impact on the common case fast path code. |
|
191 |
||
192 |
if (new_obj == NULL) { |
|
193 |
_old_gen_is_full = true; |
|
194 |
return oop_promotion_failed(o, test_mark); |
|
195 |
} |
|
196 |
} |
|
197 |
} |
|
198 |
||
199 |
assert(new_obj != NULL, "allocation should have succeeded"); |
|
200 |
||
201 |
// Copy obj |
|
202 |
Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); |
|
203 |
||
204 |
// Now we have to CAS in the header. |
|
205 |
if (o->cas_forward_to(new_obj, test_mark)) { |
|
206 |
// We won any races, we "own" this object. |
|
207 |
assert(new_obj == o->forwardee(), "Sanity"); |
|
208 |
||
209 |
// Increment age if obj still in new generation. Now that |
|
210 |
// we're dealing with a markOop that cannot change, it is |
|
211 |
// okay to use the non mt safe oop methods. |
|
212 |
if (!new_obj_is_tenured) { |
|
213 |
new_obj->incr_age(); |
|
214 |
assert(young_space()->contains(new_obj), "Attempt to push non-promoted obj"); |
|
215 |
} |
|
216 |
||
217 |
// Do the size comparison first with new_obj_size, which we |
|
218 |
// already have. Hopefully, only a few objects are larger than |
|
219 |
// _min_array_size_for_chunking, and most of them will be arrays. |
|
220 |
// So, the is->objArray() test would be very infrequent. |
|
221 |
if (new_obj_size > _min_array_size_for_chunking && |
|
222 |
new_obj->is_objArray() && |
|
223 |
PSChunkLargeArrays) { |
|
224 |
// we'll chunk it |
|
225 |
oop* const masked_o = mask_chunked_array_oop(o); |
|
226 |
push_depth(masked_o); |
|
227 |
TASKQUEUE_STATS_ONLY(++_arrays_chunked; ++_masked_pushes); |
|
228 |
} else { |
|
229 |
// we'll just push its contents |
|
230 |
new_obj->push_contents(this); |
|
231 |
} |
|
232 |
} else { |
|
233 |
// We lost, someone else "owns" this object |
|
234 |
guarantee(o->is_forwarded(), "Object must be forwarded if the cas failed."); |
|
235 |
||
236 |
// Try to deallocate the space. If it was directly allocated we cannot |
|
237 |
// deallocate it, so we have to test. If the deallocation fails, |
|
238 |
// overwrite with a filler object. |
|
239 |
if (new_obj_is_tenured) { |
|
240 |
if (!_old_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { |
|
241 |
CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); |
|
242 |
} |
|
243 |
} else if (!_young_lab.unallocate_object((HeapWord*) new_obj, new_obj_size)) { |
|
244 |
CollectedHeap::fill_with_object((HeapWord*) new_obj, new_obj_size); |
|
245 |
} |
|
246 |
||
247 |
// don't update this before the unallocation! |
|
248 |
new_obj = o->forwardee(); |
|
249 |
} |
|
250 |
} else { |
|
251 |
assert(o->is_forwarded(), "Sanity"); |
|
252 |
new_obj = o->forwardee(); |
|
253 |
} |
|
254 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12226
diff
changeset
|
255 |
#ifndef PRODUCT |
11753 | 256 |
// This code must come after the CAS test, or it will print incorrect |
257 |
// information. |
|
258 |
if (TraceScavenge) { |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12226
diff
changeset
|
259 |
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", |
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
260 |
should_scavenge(&new_obj) ? "copying" : "tenuring", |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
22838
diff
changeset
|
261 |
new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); |
11753 | 262 |
} |
263 |
#endif |
|
264 |
||
265 |
return new_obj; |
|
266 |
} |
|
267 |
||
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
268 |
// Attempt to "claim" oop at p via CAS, push the new obj if successful |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
269 |
// This version tests the oop* to make sure it is within the heap before |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
270 |
// attempting marking. |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
271 |
template <class T, bool promote_immediately> |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
272 |
inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
273 |
assert(should_scavenge(p, true), "revisiting object?"); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
274 |
|
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
275 |
oop o = oopDesc::load_decode_heap_oop_not_null(p); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
276 |
oop new_obj = o->is_forwarded() |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
277 |
? o->forwardee() |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
278 |
: copy_to_survivor_space<promote_immediately>(o); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
279 |
|
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
280 |
#ifndef PRODUCT |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
281 |
// This code must come after the CAS test, or it will print incorrect |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
282 |
// information. |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
283 |
if (TraceScavenge && o->is_forwarded()) { |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
284 |
gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
285 |
"forwarding", |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
286 |
new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
287 |
} |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
288 |
#endif |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
289 |
|
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
290 |
oopDesc::encode_store_heap_oop_not_null(p, new_obj); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
291 |
|
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
292 |
// We cannot mark without test, as some code passes us pointers |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
293 |
// that are outside the heap. These pointers are either from roots |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
294 |
// or from metadata. |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
295 |
if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) && |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
296 |
Universe::heap()->is_in_reserved(p)) { |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
297 |
if (PSScavenge::is_obj_in_young(new_obj)) { |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
298 |
PSScavenge::card_table()->inline_write_ref_field_gc(p, new_obj); |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
299 |
} |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
300 |
} |
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
301 |
} |
11753 | 302 |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
303 |
inline void PSPromotionManager::process_popped_location_depth(StarTask p) { |
1 | 304 |
if (is_oop_masked(p)) { |
305 |
assert(PSChunkLargeArrays, "invariant"); |
|
306 |
oop const old = unmask_chunked_array_oop(p); |
|
307 |
process_array_chunk(old); |
|
308 |
} else { |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
309 |
if (p.is_narrow()) { |
3262
30d1c247fc25
6700789: G1: Enable use of compressed oops with G1 heaps
ysr
parents:
670
diff
changeset
|
310 |
assert(UseCompressedOops, "Error"); |
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
311 |
copy_and_push_safe_barrier<narrowOop, /*promote_immediately=*/false>(p); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
312 |
} else { |
29208
b570d043f295
8073543: Circular include dependency between psScavenge.inline.hpp and psPromotionManager.inline.hpp
stefank
parents:
28177
diff
changeset
|
313 |
copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
314 |
} |
1 | 315 |
} |
316 |
} |
|
6067 | 317 |
|
318 |
#if TASKQUEUE_STATS |
|
319 |
void PSPromotionManager::record_steal(StarTask& p) { |
|
320 |
if (is_oop_masked(p)) { |
|
321 |
++_masked_steals; |
|
322 |
} |
|
323 |
} |
|
324 |
#endif // TASKQUEUE_STATS |
|
7397 | 325 |
|
326 |
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP |