comparison src/share/vm/prims/jvmtiTagMap.cpp @ 6983:070d523b96a7

8001471: Klass::cast() does nothing Summary: Remove function Klass::cast() and calls to it. Reviewed-by: dholmes, coleenp
author hseigel
date Mon, 12 Nov 2012 16:15:05 -0500
parents 045cb62046a7
children db9981fd3124
comparison
equal deleted inserted replaced
6981:8c413497f434 6983:070d523b96a7
2772 } 2772 }
2773 2773
2774 // a type array references its class 2774 // a type array references its class
2775 inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) { 2775 inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) {
2776 Klass* k = o->klass(); 2776 Klass* k = o->klass();
2777 oop mirror = Klass::cast(k)->java_mirror(); 2777 oop mirror = k->java_mirror();
2778 if (!CallbackInvoker::report_class_reference(o, mirror)) { 2778 if (!CallbackInvoker::report_class_reference(o, mirror)) {
2779 return false; 2779 return false;
2780 } 2780 }
2781 2781
2782 // report the array contents if required 2782 // report the array contents if required
2821 oop mirror = klass->java_mirror(); 2821 oop mirror = klass->java_mirror();
2822 2822
2823 // super (only if something more interesting than java.lang.Object) 2823 // super (only if something more interesting than java.lang.Object)
2824 Klass* java_super = ik->java_super(); 2824 Klass* java_super = ik->java_super();
2825 if (java_super != NULL && java_super != SystemDictionary::Object_klass()) { 2825 if (java_super != NULL && java_super != SystemDictionary::Object_klass()) {
2826 oop super = Klass::cast(java_super)->java_mirror(); 2826 oop super = java_super->java_mirror();
2827 if (!CallbackInvoker::report_superclass_reference(mirror, super)) { 2827 if (!CallbackInvoker::report_superclass_reference(mirror, super)) {
2828 return false; 2828 return false;
2829 } 2829 }
2830 } 2830 }
2831 2831
2863 if (tag.is_string()) { 2863 if (tag.is_string()) {
2864 entry = pool->resolved_string_at(i); 2864 entry = pool->resolved_string_at(i);
2865 // If the entry is non-null it is resolved. 2865 // If the entry is non-null it is resolved.
2866 if (entry == NULL) continue; 2866 if (entry == NULL) continue;
2867 } else { 2867 } else {
2868 entry = Klass::cast(pool->resolved_klass_at(i))->java_mirror(); 2868 entry = pool->resolved_klass_at(i)->java_mirror();
2869 } 2869 }
2870 if (!CallbackInvoker::report_constant_pool_reference(mirror, entry, (jint)i)) { 2870 if (!CallbackInvoker::report_constant_pool_reference(mirror, entry, (jint)i)) {
2871 return false; 2871 return false;
2872 } 2872 }
2873 } 2873 }
2877 // interfaces 2877 // interfaces
2878 // (These will already have been reported as references from the constant pool 2878 // (These will already have been reported as references from the constant pool
2879 // but are specified by IterateOverReachableObjects and must be reported). 2879 // but are specified by IterateOverReachableObjects and must be reported).
2880 Array<Klass*>* interfaces = ik->local_interfaces(); 2880 Array<Klass*>* interfaces = ik->local_interfaces();
2881 for (i = 0; i < interfaces->length(); i++) { 2881 for (i = 0; i < interfaces->length(); i++) {
2882 oop interf = Klass::cast((Klass*)interfaces->at(i))->java_mirror(); 2882 oop interf = ((Klass*)interfaces->at(i))->java_mirror();
2883 if (interf == NULL) { 2883 if (interf == NULL) {
2884 continue; 2884 continue;
2885 } 2885 }
2886 if (!CallbackInvoker::report_interface_reference(mirror, interf)) { 2886 if (!CallbackInvoker::report_interface_reference(mirror, interf)) {
2887 return false; 2887 return false;
2926 // an object references a class and its instance fields 2926 // an object references a class and its instance fields
2927 // (static fields are ignored here as we report these as 2927 // (static fields are ignored here as we report these as
2928 // references from the class). 2928 // references from the class).
2929 inline bool VM_HeapWalkOperation::iterate_over_object(oop o) { 2929 inline bool VM_HeapWalkOperation::iterate_over_object(oop o) {
2930 // reference to the class 2930 // reference to the class
2931 if (!CallbackInvoker::report_class_reference(o, Klass::cast(o->klass())->java_mirror())) { 2931 if (!CallbackInvoker::report_class_reference(o, o->klass()->java_mirror())) {
2932 return false; 2932 return false;
2933 } 2933 }
2934 2934
2935 // iterate over instance fields 2935 // iterate over instance fields
2936 ClassFieldMap* field_map = JvmtiCachedClassFieldMap::get_map_of_instance_fields(o); 2936 ClassFieldMap* field_map = JvmtiCachedClassFieldMap::get_map_of_instance_fields(o);