522 {
523 MutexLocker ml(Heap_lock);
524 // This value is guarded by the Heap_lock
525 gc_count = total_collections();
526 full_gc_count = total_full_collections();
527 }
528
529 if (GCLocker::should_discard(cause, gc_count)) {
530 return;
531 }
532
533 VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
534 VMThread::execute(&op);
535 }
536
537 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
538 young_gen()->object_iterate(cl);
539 old_gen()->object_iterate(cl);
540 }
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
|
522 {
523 MutexLocker ml(Heap_lock);
524 // This value is guarded by the Heap_lock
525 gc_count = total_collections();
526 full_gc_count = total_full_collections();
527 }
528
529 if (GCLocker::should_discard(cause, gc_count)) {
530 return;
531 }
532
533 VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
534 VMThread::execute(&op);
535 }
536
537 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
538 young_gen()->object_iterate(cl);
539 old_gen()->object_iterate(cl);
540 }
541
542 void ParallelScavengeHeap::run_task(AbstractGangTask* task) {
543 _workers.run_task(task);
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
|