Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @ 438:122d10c82f3f
6765804: GC "dead ratios" should be unsigned
Reviewed-by: ysr, tonyp
author | jcoomes |
---|---|
date | Wed, 29 Oct 2008 06:30:02 -0700 |
parents | a4b729f5b611 |
children | 7d7a7c599c17 |
comparison
equal
deleted
inserted
replaced
414:348be627a148 | 438:122d10c82f3f |
---|---|
88 * by the MarkSweepAlwaysCompactCount parameter. This is a significant | 88 * by the MarkSweepAlwaysCompactCount parameter. This is a significant |
89 * performance improvement! | 89 * performance improvement! |
90 */ | 90 */ |
91 bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); | 91 bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); |
92 | 92 |
93 ssize_t allowed_deadspace = 0; | 93 size_t allowed_deadspace = 0; |
94 if (skip_dead) { | 94 if (skip_dead) { |
95 int ratio = allowed_dead_ratio(); | 95 const size_t ratio = allowed_dead_ratio(); |
96 allowed_deadspace = (space()->capacity_in_bytes() * ratio / 100) / HeapWordSize; | 96 allowed_deadspace = space()->capacity_in_words() * ratio / 100; |
97 } | 97 } |
98 | 98 |
99 // Fetch the current destination decorator | 99 // Fetch the current destination decorator |
100 PSMarkSweepDecorator* dest = destination_decorator(); | 100 PSMarkSweepDecorator* dest = destination_decorator(); |
101 ObjectStartArray* start_array = dest->start_array(); | 101 ObjectStartArray* start_array = dest->start_array(); |
269 | 269 |
270 // Update compaction top | 270 // Update compaction top |
271 dest->set_compaction_top(compact_top); | 271 dest->set_compaction_top(compact_top); |
272 } | 272 } |
273 | 273 |
274 bool PSMarkSweepDecorator::insert_deadspace(ssize_t& allowed_deadspace_words, | 274 bool PSMarkSweepDecorator::insert_deadspace(size_t& allowed_deadspace_words, |
275 HeapWord* q, size_t deadlength) { | 275 HeapWord* q, size_t deadlength) { |
276 allowed_deadspace_words -= deadlength; | 276 if (allowed_deadspace_words >= deadlength) { |
277 if (allowed_deadspace_words >= 0) { | 277 allowed_deadspace_words -= deadlength; |
278 oop(q)->set_mark(markOopDesc::prototype()->set_marked()); | 278 oop(q)->set_mark(markOopDesc::prototype()->set_marked()); |
279 const size_t aligned_min_int_array_size = | 279 const size_t aligned_min_int_array_size = |
280 align_object_size(typeArrayOopDesc::header_size(T_INT)); | 280 align_object_size(typeArrayOopDesc::header_size(T_INT)); |
281 if (deadlength >= aligned_min_int_array_size) { | 281 if (deadlength >= aligned_min_int_array_size) { |
282 oop(q)->set_klass(Universe::intArrayKlassObj()); | 282 oop(q)->set_klass(Universe::intArrayKlassObj()); |