Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @ 264:15dd2594d08e
6718283: existing uses of *_FORMAT_W() were broken by 6521491
Reviewed-by: ysr, pbk
author | jcoomes |
---|---|
date | Fri, 11 Jul 2008 16:11:34 -0700 |
parents | 12eea04c8b06 |
children | f88815ca1af1 |
comparison
equal
deleted
inserted
replaced
263:12eea04c8b06 | 264:15dd2594d08e |
---|---|
198 tty->print_cr("------ ---------- ---------- ---------- ----------"); | 198 tty->print_cr("------ ---------- ---------- ---------- ----------"); |
199 | 199 |
200 for (unsigned int id = 0; id < last_space_id; ++id) { | 200 for (unsigned int id = 0; id < last_space_id; ++id) { |
201 const MutableSpace* space = _space_info[id].space(); | 201 const MutableSpace* space = _space_info[id].space(); |
202 tty->print_cr("%u %s " | 202 tty->print_cr("%u %s " |
203 SIZE_FORMAT_W("10") " " SIZE_FORMAT_W("10") " " | 203 SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " " |
204 SIZE_FORMAT_W("10") " " SIZE_FORMAT_W("10") " ", | 204 SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " ", |
205 id, space_names[id], | 205 id, space_names[id], |
206 summary_data().addr_to_chunk_idx(space->bottom()), | 206 summary_data().addr_to_chunk_idx(space->bottom()), |
207 summary_data().addr_to_chunk_idx(space->top()), | 207 summary_data().addr_to_chunk_idx(space->top()), |
208 summary_data().addr_to_chunk_idx(space->end()), | 208 summary_data().addr_to_chunk_idx(space->end()), |
209 summary_data().addr_to_chunk_idx(_space_info[id].new_top())); | 209 summary_data().addr_to_chunk_idx(_space_info[id].new_top())); |
211 } | 211 } |
212 | 212 |
213 void | 213 void |
214 print_generic_summary_chunk(size_t i, const ParallelCompactData::ChunkData* c) | 214 print_generic_summary_chunk(size_t i, const ParallelCompactData::ChunkData* c) |
215 { | 215 { |
216 #define CHUNK_IDX_FORMAT SIZE_FORMAT_W("7") | 216 #define CHUNK_IDX_FORMAT SIZE_FORMAT_W(7) |
217 #define CHUNK_DATA_FORMAT SIZE_FORMAT_W("5") | 217 #define CHUNK_DATA_FORMAT SIZE_FORMAT_W(5) |
218 | 218 |
219 ParallelCompactData& sd = PSParallelCompact::summary_data(); | 219 ParallelCompactData& sd = PSParallelCompact::summary_data(); |
220 size_t dci = c->destination() ? sd.addr_to_chunk_idx(c->destination()) : 0; | 220 size_t dci = c->destination() ? sd.addr_to_chunk_idx(c->destination()) : 0; |
221 tty->print_cr(CHUNK_IDX_FORMAT " " PTR_FORMAT " " | 221 tty->print_cr(CHUNK_IDX_FORMAT " " PTR_FORMAT " " |
222 CHUNK_IDX_FORMAT " " PTR_FORMAT " " | 222 CHUNK_IDX_FORMAT " " PTR_FORMAT " " |
267 void | 267 void |
268 print_initial_summary_chunk(size_t i, | 268 print_initial_summary_chunk(size_t i, |
269 const ParallelCompactData::ChunkData* c, | 269 const ParallelCompactData::ChunkData* c, |
270 bool newline = true) | 270 bool newline = true) |
271 { | 271 { |
272 tty->print(SIZE_FORMAT_W("5") " " PTR_FORMAT " " | 272 tty->print(SIZE_FORMAT_W(5) " " PTR_FORMAT " " |
273 SIZE_FORMAT_W("5") " " SIZE_FORMAT_W("5") " " | 273 SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " |
274 SIZE_FORMAT_W("5") " " SIZE_FORMAT_W("5") " %d", | 274 SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", |
275 i, c->destination(), | 275 i, c->destination(), |
276 c->partial_obj_size(), c->live_obj_size(), | 276 c->partial_obj_size(), c->live_obj_size(), |
277 c->data_size(), c->source_chunk(), c->destination_count()); | 277 c->data_size(), c->source_chunk(), c->destination_count()); |
278 if (newline) tty->cr(); | 278 if (newline) tty->cr(); |
279 } | 279 } |
324 max_dead_to_right = dead_to_right; | 324 max_dead_to_right = dead_to_right; |
325 max_live_to_right = live_to_right; | 325 max_live_to_right = live_to_right; |
326 } | 326 } |
327 | 327 |
328 print_initial_summary_chunk(i, c, false); | 328 print_initial_summary_chunk(i, c, false); |
329 tty->print_cr(" %12.10f " SIZE_FORMAT_W("10") " " SIZE_FORMAT_W("10"), | 329 tty->print_cr(" %12.10f " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10), |
330 reclaimed_ratio, dead_to_right, live_to_right); | 330 reclaimed_ratio, dead_to_right, live_to_right); |
331 | 331 |
332 live_to_right -= c->data_size(); | 332 live_to_right -= c->data_size(); |
333 ++i; | 333 ++i; |
334 } | 334 } |
336 // Any remaining chunks are empty. Print one more if there is one. | 336 // Any remaining chunks are empty. Print one more if there is one. |
337 if (i < end_chunk) { | 337 if (i < end_chunk) { |
338 print_initial_summary_chunk(i, summary_data.chunk(i)); | 338 print_initial_summary_chunk(i, summary_data.chunk(i)); |
339 } | 339 } |
340 | 340 |
341 tty->print_cr("max: " SIZE_FORMAT_W("4") " d2r=" SIZE_FORMAT_W("10") " " | 341 tty->print_cr("max: " SIZE_FORMAT_W(4) " d2r=" SIZE_FORMAT_W(10) " " |
342 "l2r=" SIZE_FORMAT_W("10") " max_ratio=%14.12f", | 342 "l2r=" SIZE_FORMAT_W(10) " max_ratio=%14.12f", |
343 max_reclaimed_ratio_chunk, max_dead_to_right, | 343 max_reclaimed_ratio_chunk, max_dead_to_right, |
344 max_live_to_right, max_reclaimed_ratio); | 344 max_live_to_right, max_reclaimed_ratio); |
345 } | 345 } |
346 | 346 |
347 void | 347 void |
1119 const ChunkData* const top_cp = sd.addr_to_chunk_ptr(space->top() - 1); | 1119 const ChunkData* const top_cp = sd.addr_to_chunk_ptr(space->top() - 1); |
1120 while (cp < end_cp) { | 1120 while (cp < end_cp) { |
1121 HeapWord* chunk_destination = cp->destination(); | 1121 HeapWord* chunk_destination = cp->destination(); |
1122 const size_t cur_deadwood = pointer_delta(dense_prefix, chunk_destination); | 1122 const size_t cur_deadwood = pointer_delta(dense_prefix, chunk_destination); |
1123 if (TraceParallelOldGCDensePrefix && Verbose) { | 1123 if (TraceParallelOldGCDensePrefix && Verbose) { |
1124 tty->print_cr("c#=" SIZE_FORMAT_W("04") " dst=" PTR_FORMAT " " | 1124 tty->print_cr("c#=" SIZE_FORMAT_W(4) " dst=" PTR_FORMAT " " |
1125 "dp=" SIZE_FORMAT_W("08") " " "cdw=" SIZE_FORMAT_W("08"), | 1125 "dp=" SIZE_FORMAT_W(8) " " "cdw=" SIZE_FORMAT_W(8), |
1126 sd.chunk(cp), chunk_destination, | 1126 sd.chunk(cp), chunk_destination, |
1127 dense_prefix, cur_deadwood); | 1127 dense_prefix, cur_deadwood); |
1128 } | 1128 } |
1129 | 1129 |
1130 if (cur_deadwood >= deadwood_goal) { | 1130 if (cur_deadwood >= deadwood_goal) { |
1145 double(prev_chunk_live_to_right) / prev_chunk_space_to_right; | 1145 double(prev_chunk_live_to_right) / prev_chunk_space_to_right; |
1146 if (density_to_right <= prev_chunk_density_to_right) { | 1146 if (density_to_right <= prev_chunk_density_to_right) { |
1147 return dense_prefix; | 1147 return dense_prefix; |
1148 } | 1148 } |
1149 if (TraceParallelOldGCDensePrefix && Verbose) { | 1149 if (TraceParallelOldGCDensePrefix && Verbose) { |
1150 tty->print_cr("backing up from c=" SIZE_FORMAT_W("4") " d2r=%10.8f " | 1150 tty->print_cr("backing up from c=" SIZE_FORMAT_W(4) " d2r=%10.8f " |
1151 "pc_d2r=%10.8f", sd.chunk(cp), density_to_right, | 1151 "pc_d2r=%10.8f", sd.chunk(cp), density_to_right, |
1152 prev_chunk_density_to_right); | 1152 prev_chunk_density_to_right); |
1153 } | 1153 } |
1154 dense_prefix -= chunk_size; | 1154 dense_prefix -= chunk_size; |
1155 live_to_right = prev_chunk_live_to_right; | 1155 live_to_right = prev_chunk_live_to_right; |
1182 const size_t space_cap = space->capacity_in_words(); | 1182 const size_t space_cap = space->capacity_in_words(); |
1183 const double dead_to_left_pct = double(dead_to_left) / space_cap; | 1183 const double dead_to_left_pct = double(dead_to_left) / space_cap; |
1184 const size_t live_to_right = new_top - cp->destination(); | 1184 const size_t live_to_right = new_top - cp->destination(); |
1185 const size_t dead_to_right = space->top() - addr - live_to_right; | 1185 const size_t dead_to_right = space->top() - addr - live_to_right; |
1186 | 1186 |
1187 tty->print_cr("%s=" PTR_FORMAT " dpc=" SIZE_FORMAT_W("05") " " | 1187 tty->print_cr("%s=" PTR_FORMAT " dpc=" SIZE_FORMAT_W(5) " " |
1188 "spl=" SIZE_FORMAT " " | 1188 "spl=" SIZE_FORMAT " " |
1189 "d2l=" SIZE_FORMAT " d2l%%=%6.4f " | 1189 "d2l=" SIZE_FORMAT " d2l%%=%6.4f " |
1190 "d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT | 1190 "d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT |
1191 " ratio=%10.8f", | 1191 " ratio=%10.8f", |
1192 algorithm, addr, chunk_idx, | 1192 algorithm, addr, chunk_idx, |
2511 cm->save_for_processing(cur); | 2511 cm->save_for_processing(cur); |
2512 | 2512 |
2513 if (TraceParallelOldGCCompactionPhase && Verbose) { | 2513 if (TraceParallelOldGCCompactionPhase && Verbose) { |
2514 const size_t count_mod_8 = fillable_chunks & 7; | 2514 const size_t count_mod_8 = fillable_chunks & 7; |
2515 if (count_mod_8 == 0) gclog_or_tty->print("fillable: "); | 2515 if (count_mod_8 == 0) gclog_or_tty->print("fillable: "); |
2516 gclog_or_tty->print(" " SIZE_FORMAT_W("7"), cur); | 2516 gclog_or_tty->print(" " SIZE_FORMAT_W(7), cur); |
2517 if (count_mod_8 == 7) gclog_or_tty->cr(); | 2517 if (count_mod_8 == 7) gclog_or_tty->cr(); |
2518 } | 2518 } |
2519 | 2519 |
2520 NOT_PRODUCT(++fillable_chunks;) | 2520 NOT_PRODUCT(++fillable_chunks;) |
2521 | 2521 |