author | coleenp |
Wed, 23 Aug 2017 14:52:55 -0400 | |
changeset 46968 | 9119841280f4 |
parent 38198 | 8144ec8f789e |
permissions | -rw-r--r-- |
5434 | 1 |
/* |
46968
9119841280f4
8160399: is_oop_or_null involves undefined behavior
coleenp
parents:
38198
diff
changeset
|
2 |
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. |
5434 | 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:
5541
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5541
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:
5541
diff
changeset
|
21 |
* questions. |
5434 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
30764 | 26 |
#include "gc/cms/compactibleFreeListSpace.hpp" |
27 |
#include "gc/cms/promotionInfo.hpp" |
|
28 |
#include "gc/shared/genOopClosures.hpp" |
|
7397 | 29 |
#include "oops/markOop.inline.hpp" |
30 |
#include "oops/oop.inline.hpp" |
|
5434 | 31 |
|
32 |
///////////////////////////////////////////////////////////////////////// |
|
33 |
//// PromotionInfo |
|
34 |
///////////////////////////////////////////////////////////////////////// |
|
35 |
||
36 |
||
35862
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
37 |
PromotedObject* PromotedObject::next() const { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
38 |
assert(!((FreeChunk*)this)->is_free(), "Error"); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
39 |
PromotedObject* res; |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
40 |
if (UseCompressedOops) { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
41 |
// The next pointer is a compressed oop stored in the top 32 bits |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
42 |
res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
43 |
} else { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
44 |
res = (PromotedObject*)(_next & next_mask); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
45 |
} |
46968
9119841280f4
8160399: is_oop_or_null involves undefined behavior
coleenp
parents:
38198
diff
changeset
|
46 |
assert(oopDesc::is_oop_or_null(oop(res), true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))); |
35862
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
47 |
return res; |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
48 |
} |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
49 |
|
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
50 |
inline void PromotedObject::setNext(PromotedObject* x) { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
51 |
assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, " |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
52 |
"or insufficient alignment of objects"); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
53 |
if (UseCompressedOops) { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
54 |
assert(_data._narrow_next == 0, "Overwrite?"); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
55 |
_data._narrow_next = oopDesc::encode_heap_oop(oop(x)); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
56 |
} else { |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
57 |
_next |= (intptr_t)x; |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
58 |
} |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
59 |
assert(!((FreeChunk*)this)->is_free(), "Error"); |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
60 |
} |
411842d0c882
8146395: Add inline qualifier in oop.hpp and fix inlining in gc files
goetz
parents:
34129
diff
changeset
|
61 |
|
5434 | 62 |
////////////////////////////////////////////////////////////////////////////// |
63 |
// We go over the list of promoted objects, removing each from the list, |
|
64 |
// and applying the closure (this may, in turn, add more elements to |
|
65 |
// the tail of the promoted list, and these newly added objects will |
|
66 |
// also be processed) until the list is empty. |
|
67 |
// To aid verification and debugging, in the non-product builds |
|
68 |
// we actually forward _promoHead each time we process a promoted oop. |
|
69 |
// Note that this is not necessary in general (i.e. when we don't need to |
|
70 |
// call PromotionInfo::verify()) because oop_iterate can only add to the |
|
71 |
// end of _promoTail, and never needs to look at _promoHead. |
|
72 |
||
73 |
#define PROMOTED_OOPS_ITERATE_DEFN(OopClosureType, nv_suffix) \ |
|
74 |
\ |
|
75 |
void PromotionInfo::promoted_oops_iterate##nv_suffix(OopClosureType* cl) { \ |
|
76 |
NOT_PRODUCT(verify()); \ |
|
77 |
PromotedObject *curObj, *nextObj; \ |
|
78 |
for (curObj = _promoHead; curObj != NULL; curObj = nextObj) { \ |
|
79 |
if ((nextObj = curObj->next()) == NULL) { \ |
|
80 |
/* protect ourselves against additions due to closure application \ |
|
81 |
below by resetting the list. */ \ |
|
82 |
assert(_promoTail == curObj, "Should have been the tail"); \ |
|
83 |
_promoHead = _promoTail = NULL; \ |
|
84 |
} \ |
|
85 |
if (curObj->hasDisplacedMark()) { \ |
|
86 |
/* restore displaced header */ \ |
|
87 |
oop(curObj)->set_mark(nextDisplacedHeader()); \ |
|
88 |
} else { \ |
|
89 |
/* restore prototypical header */ \ |
|
90 |
oop(curObj)->init_mark(); \ |
|
91 |
} \ |
|
92 |
/* The "promoted_mark" should now not be set */ \ |
|
93 |
assert(!curObj->hasPromotedMark(), \ |
|
94 |
"Should have been cleared by restoring displaced mark-word"); \ |
|
95 |
NOT_PRODUCT(_promoHead = nextObj); \ |
|
96 |
if (cl != NULL) oop(curObj)->oop_iterate(cl); \ |
|
97 |
if (nextObj == NULL) { /* start at head of list reset above */ \ |
|
98 |
nextObj = _promoHead; \ |
|
99 |
} \ |
|
100 |
} \ |
|
101 |
assert(noPromotions(), "post-condition violation"); \ |
|
102 |
assert(_promoHead == NULL && _promoTail == NULL, "emptied promoted list");\ |
|
103 |
assert(_spoolHead == _spoolTail, "emptied spooling buffers"); \ |
|
104 |
assert(_firstIndex == _nextIndex, "empty buffer"); \ |
|
105 |
} |
|
106 |
||
107 |
// This should have been ALL_SINCE_...() just like the others, |
|
108 |
// but, because the body of the method above is somehwat longer, |
|
109 |
// the MSVC compiler cannot cope; as a workaround, we split the |
|
110 |
// macro into its 3 constituent parts below (see original macro |
|
111 |
// definition in specializedOopClosures.hpp). |
|
112 |
SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(PROMOTED_OOPS_ITERATE_DEFN) |
|
113 |
PROMOTED_OOPS_ITERATE_DEFN(OopsInGenClosure,_v) |
|
114 |
||
115 |
||
116 |
// Return the next displaced header, incrementing the pointer and |
|
117 |
// recycling spool area as necessary. |
|
118 |
markOop PromotionInfo::nextDisplacedHeader() { |
|
119 |
assert(_spoolHead != NULL, "promotionInfo inconsistency"); |
|
120 |
assert(_spoolHead != _spoolTail || _firstIndex < _nextIndex, |
|
121 |
"Empty spool space: no displaced header can be fetched"); |
|
122 |
assert(_spoolHead->bufferSize > _firstIndex, "Off by one error at head?"); |
|
123 |
markOop hdr = _spoolHead->displacedHdr[_firstIndex]; |
|
124 |
// Spool forward |
|
125 |
if (++_firstIndex == _spoolHead->bufferSize) { // last location in this block |
|
126 |
// forward to next block, recycling this block into spare spool buffer |
|
127 |
SpoolBlock* tmp = _spoolHead->nextSpoolBlock; |
|
128 |
assert(_spoolHead != _spoolTail, "Spooling storage mix-up"); |
|
129 |
_spoolHead->nextSpoolBlock = _spareSpool; |
|
130 |
_spareSpool = _spoolHead; |
|
131 |
_spoolHead = tmp; |
|
132 |
_firstIndex = 1; |
|
133 |
NOT_PRODUCT( |
|
134 |
if (_spoolHead == NULL) { // all buffers fully consumed |
|
135 |
assert(_spoolTail == NULL && _nextIndex == 1, |
|
136 |
"spool buffers processing inconsistency"); |
|
137 |
} |
|
138 |
) |
|
139 |
} |
|
140 |
return hdr; |
|
141 |
} |
|
142 |
||
143 |
void PromotionInfo::track(PromotedObject* trackOop) { |
|
144 |
track(trackOop, oop(trackOop)->klass()); |
|
145 |
} |
|
146 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12509
diff
changeset
|
147 |
void PromotionInfo::track(PromotedObject* trackOop, Klass* klassOfOop) { |
5434 | 148 |
// make a copy of header as it may need to be spooled |
149 |
markOop mark = oop(trackOop)->mark(); |
|
12509
6228e2085074
7164144: Fix variable naming style in freeBlockDictionary.* and binaryTreeDictionary*
jmasa
parents:
7397
diff
changeset
|
150 |
trackOop->clear_next(); |
5434 | 151 |
if (mark->must_be_preserved_for_cms_scavenge(klassOfOop)) { |
152 |
// save non-prototypical header, and mark oop |
|
153 |
saveDisplacedHeader(mark); |
|
154 |
trackOop->setDisplacedMark(); |
|
155 |
} else { |
|
156 |
// we'd like to assert something like the following: |
|
157 |
// assert(mark == markOopDesc::prototype(), "consistency check"); |
|
158 |
// ... but the above won't work because the age bits have not (yet) been |
|
159 |
// cleared. The remainder of the check would be identical to the |
|
160 |
// condition checked in must_be_preserved() above, so we don't really |
|
161 |
// have anything useful to check here! |
|
162 |
} |
|
163 |
if (_promoTail != NULL) { |
|
164 |
assert(_promoHead != NULL, "List consistency"); |
|
165 |
_promoTail->setNext(trackOop); |
|
166 |
_promoTail = trackOop; |
|
167 |
} else { |
|
168 |
assert(_promoHead == NULL, "List consistency"); |
|
169 |
_promoHead = _promoTail = trackOop; |
|
170 |
} |
|
171 |
// Mask as newly promoted, so we can skip over such objects |
|
172 |
// when scanning dirty cards |
|
173 |
assert(!trackOop->hasPromotedMark(), "Should not have been marked"); |
|
174 |
trackOop->setPromotedMark(); |
|
175 |
} |
|
176 |
||
177 |
// Save the given displaced header, incrementing the pointer and |
|
178 |
// obtaining more spool area as necessary. |
|
179 |
void PromotionInfo::saveDisplacedHeader(markOop hdr) { |
|
180 |
assert(_spoolHead != NULL && _spoolTail != NULL, |
|
181 |
"promotionInfo inconsistency"); |
|
182 |
assert(_spoolTail->bufferSize > _nextIndex, "Off by one error at tail?"); |
|
183 |
_spoolTail->displacedHdr[_nextIndex] = hdr; |
|
184 |
// Spool forward |
|
185 |
if (++_nextIndex == _spoolTail->bufferSize) { // last location in this block |
|
186 |
// get a new spooling block |
|
187 |
assert(_spoolTail->nextSpoolBlock == NULL, "tail should terminate spool list"); |
|
188 |
_splice_point = _spoolTail; // save for splicing |
|
189 |
_spoolTail->nextSpoolBlock = getSpoolBlock(); // might fail |
|
190 |
_spoolTail = _spoolTail->nextSpoolBlock; // might become NULL ... |
|
191 |
// ... but will attempt filling before next promotion attempt |
|
192 |
_nextIndex = 1; |
|
193 |
} |
|
194 |
} |
|
195 |
||
196 |
// Ensure that spooling space exists. Return false if spooling space |
|
197 |
// could not be obtained. |
|
198 |
bool PromotionInfo::ensure_spooling_space_work() { |
|
199 |
assert(!has_spooling_space(), "Only call when there is no spooling space"); |
|
200 |
// Try and obtain more spooling space |
|
201 |
SpoolBlock* newSpool = getSpoolBlock(); |
|
202 |
assert(newSpool == NULL || |
|
203 |
(newSpool->bufferSize != 0 && newSpool->nextSpoolBlock == NULL), |
|
204 |
"getSpoolBlock() sanity check"); |
|
205 |
if (newSpool == NULL) { |
|
206 |
return false; |
|
207 |
} |
|
208 |
_nextIndex = 1; |
|
209 |
if (_spoolTail == NULL) { |
|
210 |
_spoolTail = newSpool; |
|
211 |
if (_spoolHead == NULL) { |
|
212 |
_spoolHead = newSpool; |
|
213 |
_firstIndex = 1; |
|
214 |
} else { |
|
215 |
assert(_splice_point != NULL && _splice_point->nextSpoolBlock == NULL, |
|
216 |
"Splice point invariant"); |
|
217 |
// Extra check that _splice_point is connected to list |
|
218 |
#ifdef ASSERT |
|
219 |
{ |
|
220 |
SpoolBlock* blk = _spoolHead; |
|
221 |
for (; blk->nextSpoolBlock != NULL; |
|
222 |
blk = blk->nextSpoolBlock); |
|
223 |
assert(blk != NULL && blk == _splice_point, |
|
224 |
"Splice point incorrect"); |
|
225 |
} |
|
226 |
#endif // ASSERT |
|
227 |
_splice_point->nextSpoolBlock = newSpool; |
|
228 |
} |
|
229 |
} else { |
|
230 |
assert(_spoolHead != NULL, "spool list consistency"); |
|
231 |
_spoolTail->nextSpoolBlock = newSpool; |
|
232 |
_spoolTail = newSpool; |
|
233 |
} |
|
234 |
return true; |
|
235 |
} |
|
236 |
||
237 |
// Get a free spool buffer from the free pool, getting a new block |
|
238 |
// from the heap if necessary. |
|
239 |
SpoolBlock* PromotionInfo::getSpoolBlock() { |
|
240 |
SpoolBlock* res; |
|
241 |
if ((res = _spareSpool) != NULL) { |
|
242 |
_spareSpool = _spareSpool->nextSpoolBlock; |
|
243 |
res->nextSpoolBlock = NULL; |
|
244 |
} else { // spare spool exhausted, get some from heap |
|
245 |
res = (SpoolBlock*)(space()->allocateScratch(refillSize())); |
|
246 |
if (res != NULL) { |
|
247 |
res->init(); |
|
248 |
} |
|
249 |
} |
|
250 |
assert(res == NULL || res->nextSpoolBlock == NULL, "postcondition"); |
|
251 |
return res; |
|
252 |
} |
|
253 |
||
254 |
void PromotionInfo::startTrackingPromotions() { |
|
38198
8144ec8f789e
8155257: ParNew/CMS: Clean up promoted object tracking
tonyp
parents:
35862
diff
changeset
|
255 |
assert(noPromotions(), "sanity"); |
5434 | 256 |
assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex, |
257 |
"spooling inconsistency?"); |
|
258 |
_firstIndex = _nextIndex = 1; |
|
259 |
_tracking = true; |
|
260 |
} |
|
261 |
||
38198
8144ec8f789e
8155257: ParNew/CMS: Clean up promoted object tracking
tonyp
parents:
35862
diff
changeset
|
262 |
void PromotionInfo::stopTrackingPromotions() { |
8144ec8f789e
8155257: ParNew/CMS: Clean up promoted object tracking
tonyp
parents:
35862
diff
changeset
|
263 |
assert(noPromotions(), "we should have torn down the lists by now"); |
5434 | 264 |
assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex, |
265 |
"spooling inconsistency?"); |
|
266 |
_firstIndex = _nextIndex = 1; |
|
267 |
_tracking = false; |
|
268 |
} |
|
269 |
||
270 |
// When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex> |
|
271 |
// points to the next slot available for filling. |
|
272 |
// The set of slots holding displaced headers are then all those in the |
|
273 |
// right-open interval denoted by: |
|
274 |
// |
|
275 |
// [ <_spoolHead, _firstIndex>, <_spoolTail, _nextIndex> ) |
|
276 |
// |
|
277 |
// When _spoolTail is NULL, then the set of slots with displaced headers |
|
278 |
// is all those starting at the slot <_spoolHead, _firstIndex> and |
|
279 |
// going up to the last slot of last block in the linked list. |
|
22551 | 280 |
// In this latter case, _splice_point points to the tail block of |
5434 | 281 |
// this linked list of blocks holding displaced headers. |
282 |
void PromotionInfo::verify() const { |
|
283 |
// Verify the following: |
|
284 |
// 1. the number of displaced headers matches the number of promoted |
|
285 |
// objects that have displaced headers |
|
286 |
// 2. each promoted object lies in this space |
|
287 |
debug_only( |
|
288 |
PromotedObject* junk = NULL; |
|
289 |
assert(junk->next_addr() == (void*)(oop(junk)->mark_addr()), |
|
290 |
"Offset of PromotedObject::_next is expected to align with " |
|
291 |
" the OopDesc::_mark within OopDesc"); |
|
292 |
) |
|
293 |
// FIXME: guarantee???? |
|
294 |
guarantee(_spoolHead == NULL || _spoolTail != NULL || |
|
295 |
_splice_point != NULL, "list consistency"); |
|
296 |
guarantee(_promoHead == NULL || _promoTail != NULL, "list consistency"); |
|
297 |
// count the number of objects with displaced headers |
|
298 |
size_t numObjsWithDisplacedHdrs = 0; |
|
299 |
for (PromotedObject* curObj = _promoHead; curObj != NULL; curObj = curObj->next()) { |
|
300 |
guarantee(space()->is_in_reserved((HeapWord*)curObj), "Containment"); |
|
301 |
// the last promoted object may fail the mark() != NULL test of is_oop(). |
|
46968
9119841280f4
8160399: is_oop_or_null involves undefined behavior
coleenp
parents:
38198
diff
changeset
|
302 |
guarantee(curObj->next() == NULL || oopDesc::is_oop(oop(curObj)), "must be an oop"); |
5434 | 303 |
if (curObj->hasDisplacedMark()) { |
304 |
numObjsWithDisplacedHdrs++; |
|
305 |
} |
|
306 |
} |
|
307 |
// Count the number of displaced headers |
|
308 |
size_t numDisplacedHdrs = 0; |
|
309 |
for (SpoolBlock* curSpool = _spoolHead; |
|
310 |
curSpool != _spoolTail && curSpool != NULL; |
|
311 |
curSpool = curSpool->nextSpoolBlock) { |
|
312 |
// the first entry is just a self-pointer; indices 1 through |
|
313 |
// bufferSize - 1 are occupied (thus, bufferSize - 1 slots). |
|
314 |
guarantee((void*)curSpool->displacedHdr == (void*)&curSpool->displacedHdr, |
|
315 |
"first entry of displacedHdr should be self-referential"); |
|
316 |
numDisplacedHdrs += curSpool->bufferSize - 1; |
|
317 |
} |
|
318 |
guarantee((_spoolHead == _spoolTail) == (numDisplacedHdrs == 0), |
|
319 |
"internal consistency"); |
|
320 |
guarantee(_spoolTail != NULL || _nextIndex == 1, |
|
321 |
"Inconsistency between _spoolTail and _nextIndex"); |
|
322 |
// We overcounted (_firstIndex-1) worth of slots in block |
|
323 |
// _spoolHead and we undercounted (_nextIndex-1) worth of |
|
324 |
// slots in block _spoolTail. We make an appropriate |
|
325 |
// adjustment by subtracting the first and adding the |
|
326 |
// second: - (_firstIndex - 1) + (_nextIndex - 1) |
|
327 |
numDisplacedHdrs += (_nextIndex - _firstIndex); |
|
328 |
guarantee(numDisplacedHdrs == numObjsWithDisplacedHdrs, "Displaced hdr count"); |
|
329 |
} |
|
330 |
||
331 |
void PromotionInfo::print_on(outputStream* st) const { |
|
332 |
SpoolBlock* curSpool = NULL; |
|
333 |
size_t i = 0; |
|
6258
68f252c6e825
6948538: CMS: BOT walkers can fall into object allocation and initialization cracks
ysr
parents:
5547
diff
changeset
|
334 |
st->print_cr(" start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")", |
5434 | 335 |
_firstIndex, _nextIndex); |
336 |
for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL; |
|
337 |
curSpool = curSpool->nextSpoolBlock) { |
|
338 |
curSpool->print_on(st); |
|
339 |
st->print_cr(" active "); |
|
340 |
i++; |
|
341 |
} |
|
342 |
for (curSpool = _spoolTail; curSpool != NULL; |
|
343 |
curSpool = curSpool->nextSpoolBlock) { |
|
344 |
curSpool->print_on(st); |
|
345 |
st->print_cr(" inactive "); |
|
346 |
i++; |
|
347 |
} |
|
348 |
for (curSpool = _spareSpool; curSpool != NULL; |
|
349 |
curSpool = curSpool->nextSpoolBlock) { |
|
350 |
curSpool->print_on(st); |
|
351 |
st->print_cr(" free "); |
|
352 |
i++; |
|
353 |
} |
|
6258
68f252c6e825
6948538: CMS: BOT walkers can fall into object allocation and initialization cracks
ysr
parents:
5547
diff
changeset
|
354 |
st->print_cr(" " SIZE_FORMAT " header spooling blocks", i); |
5434 | 355 |
} |
356 |
||
357 |
void SpoolBlock::print_on(outputStream* st) const { |
|
358 |
st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT, |
|
29797
4d360e3ddebf
8076055: cms: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
24424
diff
changeset
|
359 |
p2i(this), p2i((HeapWord*)displacedHdr + bufferSize), |
4d360e3ddebf
8076055: cms: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
24424
diff
changeset
|
360 |
bufferSize, p2i(nextSpoolBlock)); |
5434 | 361 |
} |