2773 return true;
2774 }
2775
2776 // a type array references its class
2777 inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
2778 Klass* k = o->klass();
2779 oop mirror = k->java_mirror();
2780 if (!CallbackInvoker::report_class_reference(o, mirror)) {
2781 return false;
2782 }
2783
2784 // report the array contents if required
2785 if (is_reporting_primitive_array_values()) {
2786 if (!CallbackInvoker::report_primitive_array_values(o)) {
2787 return false;
2788 }
2789 }
2790 return true;
2791 }
2792
2793 // verify that a static oop field is in range
2794 static inline bool verify_static_oop(InstanceKlass* ik,
2795 oop mirror, int offset) {
2796 address obj_p = (address)mirror + offset;
2797 address start = (address)InstanceMirrorKlass::start_of_static_fields(mirror);
2798 address end = start + (java_lang_Class::static_oop_field_count(mirror) * heapOopSize);
2799 assert(end >= start, "sanity check");
2800
2801 if (obj_p >= start && obj_p < end) {
2802 return true;
2803 } else {
2804 return false;
2805 }
2806 }
2807
2808 // a class references its super class, interfaces, class loader, ...
2809 // and finally its static fields
2810 inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
2811 int i;
2812 Klass* klass = java_lang_Class::as_Klass(java_class);
2813
2814 if (klass->oop_is_instance()) {
2815 InstanceKlass* ik = InstanceKlass::cast(klass);
2816
2817 // ignore the class if it's has been initialized yet
2818 if (!ik->is_linked()) {
2819 return true;
2820 }
2821
2822 // get the java mirror
2823 oop mirror = klass->java_mirror();
2824
2825 // super (only if something more interesting than java.lang.Object)
2826 Klass* java_super = ik->java_super();
|
2773 return true;
2774 }
2775
2776 // a type array references its class
2777 inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
2778 Klass* k = o->klass();
2779 oop mirror = k->java_mirror();
2780 if (!CallbackInvoker::report_class_reference(o, mirror)) {
2781 return false;
2782 }
2783
2784 // report the array contents if required
2785 if (is_reporting_primitive_array_values()) {
2786 if (!CallbackInvoker::report_primitive_array_values(o)) {
2787 return false;
2788 }
2789 }
2790 return true;
2791 }
2792
2793 #ifndef PRODUCT
2794 // Function only used in assert, which will be disabled with NDEBUG
2795 // ??? Somehow NDEBUG is not working, use PRODUCT
2796 // verify that a static oop field is in range
2797 static inline bool verify_static_oop(InstanceKlass* ik,
2798 oop mirror, int offset) {
2799 address obj_p = (address)mirror + offset;
2800 address start = (address)InstanceMirrorKlass::start_of_static_fields(mirror);
2801 address end = start + (java_lang_Class::static_oop_field_count(mirror) * heapOopSize);
2802 assert(end >= start, "sanity check");
2803
2804 if (obj_p >= start && obj_p < end) {
2805 return true;
2806 } else {
2807 return false;
2808 }
2809 }
2810 #endif // #ifndef PRODUCT
2811
2812 // a class references its super class, interfaces, class loader, ...
2813 // and finally its static fields
2814 inline bool VM_HeapWalkOperation::iterate_over_class(oop java_class) {
2815 int i;
2816 Klass* klass = java_lang_Class::as_Klass(java_class);
2817
2818 if (klass->oop_is_instance()) {
2819 InstanceKlass* ik = InstanceKlass::cast(klass);
2820
2821 // ignore the class if it's has been initialized yet
2822 if (!ik->is_linked()) {
2823 return true;
2824 }
2825
2826 // get the java mirror
2827 oop mirror = klass->java_mirror();
2828
2829 // super (only if something more interesting than java.lang.Object)
2830 Klass* java_super = ik->java_super();
|