647 648 // The following method needs to be MT safe. 649 uint oopDesc::age() const { 650 assert(!is_forwarded(), "Attempt to read age from forwarded mark"); 651 if (has_displaced_mark()) { 652 return displaced_mark()->age(); 653 } else { 654 return mark()->age(); 655 } 656 } 657 658 void oopDesc::incr_age() { 659 assert(!is_forwarded(), "Attempt to increment age of forwarded mark"); 660 if (has_displaced_mark()) { 661 set_displaced_mark(displaced_mark()->incr_age()); 662 } else { 663 set_mark(mark()->incr_age()); 664 } 665 } 666 667 int oopDesc::ms_adjust_pointers() { 668 debug_only(int check_size = size()); 669 int s = klass()->oop_ms_adjust_pointers(this); 670 assert(s == check_size, "should be the same"); 671 return s; 672 } 673 674 #if INCLUDE_ALL_GCS 675 void oopDesc::pc_follow_contents(ParCompactionManager* cm) { 676 klass()->oop_pc_follow_contents(this, cm); 677 } 678 679 void oopDesc::pc_update_contents(ParCompactionManager* cm) { 680 Klass* k = klass(); 681 if (!k->is_typeArray_klass()) { 682 // It might contain oops beyond the header, so take the virtual call. 683 k->oop_pc_update_pointers(this, cm); 684 } 685 // Else skip it. The TypeArrayKlass in the header never needs scavenging. 686 } 687 688 void oopDesc::ps_push_contents(PSPromotionManager* pm) { 689 Klass* k = klass(); | 647 648 // The following method needs to be MT safe. 649 uint oopDesc::age() const { 650 assert(!is_forwarded(), "Attempt to read age from forwarded mark"); 651 if (has_displaced_mark()) { 652 return displaced_mark()->age(); 653 } else { 654 return mark()->age(); 655 } 656 } 657 658 void oopDesc::incr_age() { 659 assert(!is_forwarded(), "Attempt to increment age of forwarded mark"); 660 if (has_displaced_mark()) { 661 set_displaced_mark(displaced_mark()->incr_age()); 662 } else { 663 set_mark(mark()->incr_age()); 664 } 665 } 666 667 int oopDesc::ms_adjust_pointers(MarkSweep* ms) { 668 debug_only(int check_size = size()); 669 int s = klass()->oop_ms_adjust_pointers(this, ms); 670 assert(s == check_size, "should be the same"); 671 return s; 672 } 673 674 #if INCLUDE_ALL_GCS 675 void oopDesc::pc_follow_contents(ParCompactionManager* cm) { 676 klass()->oop_pc_follow_contents(this, cm); 677 } 678 679 void oopDesc::pc_update_contents(ParCompactionManager* cm) { 680 Klass* k = klass(); 681 if (!k->is_typeArray_klass()) { 682 // It might contain oops beyond the header, so take the virtual call. 683 k->oop_pc_update_pointers(this, cm); 684 } 685 // Else skip it. The TypeArrayKlass in the header never needs scavenging. 686 } 687 688 void oopDesc::ps_push_contents(PSPromotionManager* pm) { 689 Klass* k = klass(); |