src/hotspot/share/oops/instanceKlass.cpp
changeset 48873 9536c39ac6de
parent 48794 ea0d0781c63c
child 48874 f09fdaad7321
equal deleted inserted replaced
48872:c7774afc93e3 48873:9536c39ac6de
   122 #define DTRACE_CLASSINIT_PROBE(type, thread_type)
   122 #define DTRACE_CLASSINIT_PROBE(type, thread_type)
   123 #define DTRACE_CLASSINIT_PROBE_WAIT(type, thread_type, wait)
   123 #define DTRACE_CLASSINIT_PROBE_WAIT(type, thread_type, wait)
   124 
   124 
   125 #endif //  ndef DTRACE_ENABLED
   125 #endif //  ndef DTRACE_ENABLED
   126 
   126 
   127 volatile int InstanceKlass::_total_instanceKlass_count = 0;
       
   128 
       
   129 static inline bool is_class_loader(const Symbol* class_name,
   127 static inline bool is_class_loader(const Symbol* class_name,
   130                                    const ClassFileParser& parser) {
   128                                    const ClassFileParser& parser) {
   131   assert(class_name != NULL, "invariant");
   129   assert(class_name != NULL, "invariant");
   132 
   130 
   133   if (class_name == vmSymbols::java_lang_ClassLoader()) {
   131   if (class_name == vmSymbols::java_lang_ClassLoader()) {
   191   const bool publicize = !parser.is_internal();
   189   const bool publicize = !parser.is_internal();
   192 
   190 
   193   // Add all classes to our internal class loader list here,
   191   // Add all classes to our internal class loader list here,
   194   // including classes in the bootstrap (NULL) class loader.
   192   // including classes in the bootstrap (NULL) class loader.
   195   loader_data->add_class(ik, publicize);
   193   loader_data->add_class(ik, publicize);
   196   Atomic::inc(&_total_instanceKlass_count);
       
   197 
       
   198   return ik;
   194   return ik;
   199 }
   195 }
   200 
   196 
   201 
   197 
   202 // copy method ordering from resource area to Metaspace
   198 // copy method ordering from resource area to Metaspace
  2239   if (_name != NULL) _name->decrement_refcount();
  2235   if (_name != NULL) _name->decrement_refcount();
  2240   // unreference array name derived from this class name (arrays of an unloaded
  2236   // unreference array name derived from this class name (arrays of an unloaded
  2241   // class can't be referenced anymore).
  2237   // class can't be referenced anymore).
  2242   if (_array_name != NULL)  _array_name->decrement_refcount();
  2238   if (_array_name != NULL)  _array_name->decrement_refcount();
  2243   if (_source_debug_extension != NULL) FREE_C_HEAP_ARRAY(char, _source_debug_extension);
  2239   if (_source_debug_extension != NULL) FREE_C_HEAP_ARRAY(char, _source_debug_extension);
  2244 
       
  2245   assert(_total_instanceKlass_count >= 1, "Sanity check");
       
  2246   Atomic::dec(&_total_instanceKlass_count);
       
  2247 }
  2240 }
  2248 
  2241 
  2249 void InstanceKlass::set_source_debug_extension(const char* array, int length) {
  2242 void InstanceKlass::set_source_debug_extension(const char* array, int length) {
  2250   if (array == NULL) {
  2243   if (array == NULL) {
  2251     _source_debug_extension = NULL;
  2244     _source_debug_extension = NULL;