Mercurial > hg > graal-compiler
comparison src/share/vm/gc_interface/collectedHeap.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 9a9bb0010c91 |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
83 | 83 |
84 { | 84 { |
85 const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT)); | 85 const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT)); |
86 const size_t elements_per_word = HeapWordSize / sizeof(jint); | 86 const size_t elements_per_word = HeapWordSize / sizeof(jint); |
87 _filler_array_max_size = align_object_size(filler_array_hdr_size() + | 87 _filler_array_max_size = align_object_size(filler_array_hdr_size() + |
88 max_len * elements_per_word); | 88 max_len / elements_per_word); |
89 | 89 |
90 _barrier_set = NULL; | 90 _barrier_set = NULL; |
91 _is_gc_active = false; | 91 _is_gc_active = false; |
92 _total_collections = _total_full_collections = 0; | 92 _total_collections = _total_full_collections = 0; |
93 _gc_cause = _gc_lastcause = GCCause::_no_gc; | 93 _gc_cause = _gc_lastcause = GCCause::_no_gc; |
301 | 301 |
302 size_t CollectedHeap::filler_array_min_size() { | 302 size_t CollectedHeap::filler_array_min_size() { |
303 return align_object_size(filler_array_hdr_size()); // align to MinObjAlignment | 303 return align_object_size(filler_array_hdr_size()); // align to MinObjAlignment |
304 } | 304 } |
305 | 305 |
306 size_t CollectedHeap::filler_array_max_size() { | |
307 return _filler_array_max_size; | |
308 } | |
309 | |
310 #ifdef ASSERT | 306 #ifdef ASSERT |
311 void CollectedHeap::fill_args_check(HeapWord* start, size_t words) | 307 void CollectedHeap::fill_args_check(HeapWord* start, size_t words) |
312 { | 308 { |
313 assert(words >= min_fill_size(), "too small to fill"); | 309 assert(words >= min_fill_size(), "too small to fill"); |
314 assert(words % MinObjAlignment == 0, "unaligned size"); | 310 assert(words % MinObjAlignment == 0, "unaligned size"); |
331 assert(words >= filler_array_min_size(), "too small for an array"); | 327 assert(words >= filler_array_min_size(), "too small for an array"); |
332 assert(words <= filler_array_max_size(), "too big for a single object"); | 328 assert(words <= filler_array_max_size(), "too big for a single object"); |
333 | 329 |
334 const size_t payload_size = words - filler_array_hdr_size(); | 330 const size_t payload_size = words - filler_array_hdr_size(); |
335 const size_t len = payload_size * HeapWordSize / sizeof(jint); | 331 const size_t len = payload_size * HeapWordSize / sizeof(jint); |
332 assert((int)len >= 0, err_msg("size too large " SIZE_FORMAT " becomes %d", words, (int)len)); | |
336 | 333 |
337 // Set the length first for concurrent GC. | 334 // Set the length first for concurrent GC. |
338 ((arrayOop)start)->set_length((int)len); | 335 ((arrayOop)start)->set_length((int)len); |
339 post_allocation_setup_common(Universe::intArrayKlassObj(), start, words); | 336 post_allocation_setup_common(Universe::intArrayKlassObj(), start); |
340 DEBUG_ONLY(zap_filler_array(start, words, zap);) | 337 DEBUG_ONLY(zap_filler_array(start, words, zap);) |
341 } | 338 } |
342 | 339 |
343 void | 340 void |
344 CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) | 341 CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) |
347 | 344 |
348 if (words >= filler_array_min_size()) { | 345 if (words >= filler_array_min_size()) { |
349 fill_with_array(start, words, zap); | 346 fill_with_array(start, words, zap); |
350 } else if (words > 0) { | 347 } else if (words > 0) { |
351 assert(words == min_fill_size(), "unaligned size"); | 348 assert(words == min_fill_size(), "unaligned size"); |
352 post_allocation_setup_common(SystemDictionary::Object_klass(), start, | 349 post_allocation_setup_common(SystemDictionary::Object_klass(), start); |
353 words); | |
354 } | 350 } |
355 } | 351 } |
356 | 352 |
357 void CollectedHeap::fill_with_object(HeapWord* start, size_t words, bool zap) | 353 void CollectedHeap::fill_with_object(HeapWord* start, size_t words, bool zap) |
358 { | 354 { |
478 obj = common_permanent_mem_allocate_init(size, CHECK_NULL); | 474 obj = common_permanent_mem_allocate_init(size, CHECK_NULL); |
479 } else { | 475 } else { |
480 assert(ScavengeRootsInCode > 0, "must be"); | 476 assert(ScavengeRootsInCode > 0, "must be"); |
481 obj = common_mem_allocate_init(size, CHECK_NULL); | 477 obj = common_mem_allocate_init(size, CHECK_NULL); |
482 } | 478 } |
483 post_allocation_setup_common(klass, obj, size); | 479 post_allocation_setup_common(klass, obj); |
484 assert(Universe::is_bootstrapping() || | 480 assert(Universe::is_bootstrapping() || |
485 !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); | 481 !((oop)obj)->blueprint()->oop_is_array(), "must not be an array"); |
486 NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); | 482 NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); |
487 oop mirror = (oop)obj; | 483 oop mirror = (oop)obj; |
488 | 484 |