163 } |
163 } |
164 } |
164 } |
165 return max; |
165 return max; |
166 } |
166 } |
167 |
167 |
168 bool Generation::promotion_attempt_is_safe(size_t promotion_in_bytes, |
168 bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { |
169 bool not_used) const { |
169 size_t available = max_contiguous_available(); |
|
170 bool res = (available >= max_promotion_in_bytes); |
170 if (PrintGC && Verbose) { |
171 if (PrintGC && Verbose) { |
171 gclog_or_tty->print_cr("Generation::promotion_attempt_is_safe" |
172 gclog_or_tty->print_cr( |
172 " contiguous_available: " SIZE_FORMAT |
173 "Generation: promo attempt is%s safe: available("SIZE_FORMAT") %s max_promo("SIZE_FORMAT")", |
173 " promotion_in_bytes: " SIZE_FORMAT, |
174 res? "":" not", available, res? ">=":"<", |
174 max_contiguous_available(), promotion_in_bytes); |
175 max_promotion_in_bytes); |
175 } |
176 } |
176 return max_contiguous_available() >= promotion_in_bytes; |
177 return res; |
177 } |
178 } |
178 |
179 |
179 // Ignores "ref" and calls allocate(). |
180 // Ignores "ref" and calls allocate(). |
180 oop Generation::promote(oop obj, size_t obj_size) { |
181 oop Generation::promote(oop obj, size_t obj_size) { |
181 assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); |
182 assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); |