169 } |
169 } |
170 return max_contiguous_available() >= promotion_in_bytes; |
170 return max_contiguous_available() >= promotion_in_bytes; |
171 } |
171 } |
172 |
172 |
173 // Ignores "ref" and calls allocate(). |
173 // Ignores "ref" and calls allocate(). |
174 oop Generation::promote(oop obj, size_t obj_size, oop* ref) { |
174 oop Generation::promote(oop obj, size_t obj_size) { |
175 assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); |
175 assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); |
176 |
176 |
177 #ifndef PRODUCT |
177 #ifndef PRODUCT |
178 if (Universe::heap()->promotion_should_fail()) { |
178 if (Universe::heap()->promotion_should_fail()) { |
179 return NULL; |
179 return NULL; |
184 if (result != NULL) { |
184 if (result != NULL) { |
185 Copy::aligned_disjoint_words((HeapWord*)obj, result, obj_size); |
185 Copy::aligned_disjoint_words((HeapWord*)obj, result, obj_size); |
186 return oop(result); |
186 return oop(result); |
187 } else { |
187 } else { |
188 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
188 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
189 return gch->handle_failed_promotion(this, obj, obj_size, ref); |
189 return gch->handle_failed_promotion(this, obj, obj_size); |
190 } |
190 } |
191 } |
191 } |
192 |
192 |
193 oop Generation::par_promote(int thread_num, |
193 oop Generation::par_promote(int thread_num, |
194 oop obj, markOop m, size_t word_sz) { |
194 oop obj, markOop m, size_t word_sz) { |