< prev index next >

src/hotspot/share/gc/shared/collectedHeap.cpp

Print this page
rev 48551 : [mq]: heap8
rev 48552 : [mq]: heap10a
rev 48553 : [mq]: heap14_rebased
rev 48557 : [mq]: heap17
rev 48562 : [mq]: heap23
rev 48563 : [mq]: heap_to_thread
rev 48564 : [mq]: update-spec
rev 48565 : [mq]: event


 329   AllocTracer::send_allocation_in_new_tlab(klass, obj, new_tlab_size * HeapWordSize, size * HeapWordSize, thread);
 330 
 331   if (ZeroTLAB) {
 332     // ..and clear it.
 333     Copy::zero_to_words(obj, new_tlab_size);
 334   } else {
 335     // ...and zap just allocated object.
 336 #ifdef ASSERT
 337     // Skip mangling the space corresponding to the object header to
 338     // ensure that the returned space is not considered parsable by
 339     // any concurrent GC thread.
 340     size_t hdr_size = oopDesc::header_size();
 341     Copy::fill_to_words(obj + hdr_size, new_tlab_size - hdr_size, badHeapWordVal);
 342 #endif // ASSERT
 343   }
 344 
 345   // Send the thread information about this allocation in case a sample is
 346   // requested.
 347   if (HeapMonitoring::enabled()) {
 348     size_t tlab_bytes_since_last_sample = thread->tlab().bytes_since_last_sample_point();
 349     thread->check_for_sampling(obj, size, tlab_bytes_since_last_sample);
 350   }
 351 
 352   thread->tlab().fill(obj, obj + size, new_tlab_size);
 353   return obj;
 354 }
 355 
 356 void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) {
 357   MemRegion deferred = thread->deferred_card_mark();
 358   if (!deferred.is_empty()) {
 359     assert(_defer_initial_card_mark, "Otherwise should be empty");
 360     {
 361       // Verify that the storage points to a parsable object in heap
 362       DEBUG_ONLY(oop old_obj = oop(deferred.start());)
 363       assert(is_in(old_obj), "Not in allocated heap");
 364       assert(!can_elide_initializing_store_barrier(old_obj),
 365              "Else should have been filtered in new_store_pre_barrier()");
 366       assert(oopDesc::is_oop(old_obj, true), "Not an oop");
 367       assert(deferred.word_size() == (size_t)(old_obj->size()),
 368              "Mismatch: multiple objects?");
 369     }




 329   AllocTracer::send_allocation_in_new_tlab(klass, obj, new_tlab_size * HeapWordSize, size * HeapWordSize, thread);
 330 
 331   if (ZeroTLAB) {
 332     // ..and clear it.
 333     Copy::zero_to_words(obj, new_tlab_size);
 334   } else {
 335     // ...and zap just allocated object.
 336 #ifdef ASSERT
 337     // Skip mangling the space corresponding to the object header to
 338     // ensure that the returned space is not considered parsable by
 339     // any concurrent GC thread.
 340     size_t hdr_size = oopDesc::header_size();
 341     Copy::fill_to_words(obj + hdr_size, new_tlab_size - hdr_size, badHeapWordVal);
 342 #endif // ASSERT
 343   }
 344 
 345   // Send the thread information about this allocation in case a sample is
 346   // requested.
 347   if (HeapMonitoring::enabled()) {
 348     size_t tlab_bytes_since_last_sample = thread->tlab().bytes_since_last_sample_point();
 349     thread->heap_sampler().check_for_sampling(obj, size, tlab_bytes_since_last_sample);
 350   }
 351 
 352   thread->tlab().fill(obj, obj + size, new_tlab_size);
 353   return obj;
 354 }
 355 
 356 void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) {
 357   MemRegion deferred = thread->deferred_card_mark();
 358   if (!deferred.is_empty()) {
 359     assert(_defer_initial_card_mark, "Otherwise should be empty");
 360     {
 361       // Verify that the storage points to a parsable object in heap
 362       DEBUG_ONLY(oop old_obj = oop(deferred.start());)
 363       assert(is_in(old_obj), "Not in allocated heap");
 364       assert(!can_elide_initializing_store_barrier(old_obj),
 365              "Else should have been filtered in new_store_pre_barrier()");
 366       assert(oopDesc::is_oop(old_obj, true), "Not an oop");
 367       assert(deferred.word_size() == (size_t)(old_obj->size()),
 368              "Mismatch: multiple objects?");
 369     }


< prev index next >