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