103 static jlong class_method_data_size() { 104 return (UsePerfData ? _class_methods_size->get_value() : -1); 105 } 106 107 static void notify_class_loaded(InstanceKlass* k, bool shared_class) 108 NOT_MANAGEMENT_RETURN; 109 // All unloaded classes are non-shared 110 static void notify_class_unloaded(InstanceKlass* k) NOT_MANAGEMENT_RETURN; 111 static void add_class_method_size(int size) { 112 #if INCLUDE_MANAGEMENT 113 if (UsePerfData) { 114 _class_methods_size->inc(size); 115 } 116 #endif // INCLUDE_MANAGEMENT 117 } 118 }; 119 120 // FIXME: make this piece of code to be shared by M&M and JVMTI 121 class LoadedClassesEnumerator : public StackObj { 122 private: 123 static GrowableArray<KlassHandle>* _loaded_classes; 124 // _current_thread is for creating a KlassHandle with a faster version constructor 125 static Thread* _current_thread; 126 127 GrowableArray<KlassHandle>* _klass_handle_array; 128 129 public: 130 LoadedClassesEnumerator(Thread* cur_thread); 131 132 int num_loaded_classes() { return _klass_handle_array->length(); } 133 KlassHandle get_klass(int index) { return _klass_handle_array->at(index); } 134 135 static void add_loaded_class(Klass* k) { 136 // FIXME: For now - don't include array klasses 137 // The spec is unclear at this point to count array klasses or not 138 // and also indirect creation of array of super class and secondaries 139 // 140 // for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { 141 // KlassHandle h(_current_thread, l); 142 // _loaded_classes->append(h); 143 // } 144 KlassHandle h(_current_thread, k); 145 _loaded_classes->append(h); 146 } 147 }; 148 149 #endif // SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP | 103 static jlong class_method_data_size() { 104 return (UsePerfData ? _class_methods_size->get_value() : -1); 105 } 106 107 static void notify_class_loaded(InstanceKlass* k, bool shared_class) 108 NOT_MANAGEMENT_RETURN; 109 // All unloaded classes are non-shared 110 static void notify_class_unloaded(InstanceKlass* k) NOT_MANAGEMENT_RETURN; 111 static void add_class_method_size(int size) { 112 #if INCLUDE_MANAGEMENT 113 if (UsePerfData) { 114 _class_methods_size->inc(size); 115 } 116 #endif // INCLUDE_MANAGEMENT 117 } 118 }; 119 120 // FIXME: make this piece of code to be shared by M&M and JVMTI 121 class LoadedClassesEnumerator : public StackObj { 122 private: 123 static GrowableArray<Klass*>* _loaded_classes; 124 // _current_thread is for creating a Klass* with a faster version constructor 125 static Thread* _current_thread; 126 127 GrowableArray<Klass*>* _klass_array; 128 129 public: 130 LoadedClassesEnumerator(Thread* cur_thread); 131 132 int num_loaded_classes() { return _klass_array->length(); } 133 Klass* get_klass(int index) { return _klass_array->at(index); } 134 135 static void add_loaded_class(Klass* k) { 136 // FIXME: For now - don't include array klasses 137 // The spec is unclear at this point to count array klasses or not 138 // and also indirect creation of array of super class and secondaries 139 // 140 // for (Klass* l = k; l != NULL; l = l->array_klass_or_null()) { 141 // _loaded_classes->append(l); 142 // } 143 _loaded_classes->append(k); 144 } 145 }; 146 147 #endif // SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP |