< prev index next >

src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp

Print this page




 519   {
 520     MutexLocker ml(Heap_lock);
 521     // This value is guarded by the Heap_lock
 522     gc_count      = total_collections();
 523     full_gc_count = total_full_collections();
 524   }
 525 
 526   if (GCLocker::should_discard(cause, gc_count)) {
 527     return;
 528   }
 529 
 530   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
 531   VMThread::execute(&op);
 532 }
 533 
 534 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
 535   young_gen()->object_iterate(cl);
 536   old_gen()->object_iterate(cl);
 537 }
 538 






 539 
 540 HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
 541   if (young_gen()->is_in_reserved(addr)) {
 542     assert(young_gen()->is_in(addr),
 543            "addr should be in allocated part of young gen");
 544     // called from os::print_location by find or VMError
 545     if (Debugging || VMError::fatal_error_in_progress())  return NULL;
 546     Unimplemented();
 547   } else if (old_gen()->is_in_reserved(addr)) {
 548     assert(old_gen()->is_in(addr),
 549            "addr should be in allocated part of old gen");
 550     return old_gen()->start_array()->object_start((HeapWord*)addr);
 551   }
 552   return 0;
 553 }
 554 
 555 bool ParallelScavengeHeap::block_is_obj(const HeapWord* addr) const {
 556   return block_start(addr) == addr;
 557 }
 558 




 519   {
 520     MutexLocker ml(Heap_lock);
 521     // This value is guarded by the Heap_lock
 522     gc_count      = total_collections();
 523     full_gc_count = total_full_collections();
 524   }
 525 
 526   if (GCLocker::should_discard(cause, gc_count)) {
 527     return;
 528   }
 529 
 530   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
 531   VMThread::execute(&op);
 532 }
 533 
 534 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
 535   young_gen()->object_iterate(cl);
 536   old_gen()->object_iterate(cl);
 537 }
 538 
 539 Tickspan ParallelScavengeHeap::run_task(AbstractGangTask* task) {
 540   Ticks start = Ticks::now();
 541   _workers.run_task(task);
 542   return Ticks::now() - start;
 543 }
 544 
 545 
 546 HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
 547   if (young_gen()->is_in_reserved(addr)) {
 548     assert(young_gen()->is_in(addr),
 549            "addr should be in allocated part of young gen");
 550     // called from os::print_location by find or VMError
 551     if (Debugging || VMError::fatal_error_in_progress())  return NULL;
 552     Unimplemented();
 553   } else if (old_gen()->is_in_reserved(addr)) {
 554     assert(old_gen()->is_in(addr),
 555            "addr should be in allocated part of old gen");
 556     return old_gen()->start_array()->object_start((HeapWord*)addr);
 557   }
 558   return 0;
 559 }
 560 
 561 bool ParallelScavengeHeap::block_is_obj(const HeapWord* addr) const {
 562   return block_start(addr) == addr;
 563 }
 564 


< prev index next >