src/share/vm/oops/instanceKlass.cpp

Print this page




2312   m->clear_all_breakpoints();
2313 }
2314 
2315 void InstanceKlass::release_C_heap_structures() {
2316   // Deallocate oop map cache
2317   if (_oop_map_cache != NULL) {
2318     delete _oop_map_cache;
2319     _oop_map_cache = NULL;
2320   }
2321 
2322   // Deallocate JNI identifiers for jfieldIDs
2323   JNIid::deallocate(jni_ids());
2324   set_jni_ids(NULL);
2325 
2326   jmethodID* jmeths = methods_jmethod_ids_acquire();
2327   if (jmeths != (jmethodID*)NULL) {
2328     release_set_methods_jmethod_ids(NULL);
2329     FreeHeap(jmeths);
2330   }
2331 





2332   int* indices = methods_cached_itable_indices_acquire();
2333   if (indices != (int*)NULL) {
2334     release_set_methods_cached_itable_indices(NULL);
2335     FreeHeap(indices);
2336   }
2337 
2338   // release dependencies
2339   nmethodBucket* b = _dependencies;
2340   _dependencies = NULL;
2341   while (b != NULL) {
2342     nmethodBucket* next = b->next();
2343     delete b;
2344     b = next;
2345   }
2346 
2347   // Deallocate breakpoint records
2348   if (breakpoints() != 0x0) {
2349     methods_do(clear_all_breakpoints);
2350     assert(breakpoints() == 0x0, "should have cleared breakpoints");
2351   }


2740       } else {
2741         if (best == NULL || (osr->comp_level() > best->comp_level())) {
2742           if (osr->comp_level() == CompLevel_highest_tier) {
2743             // Found the best possible - return it.
2744             OsrList_lock->unlock();
2745             return osr;
2746           }
2747           best = osr;
2748         }
2749       }
2750     }
2751     osr = osr->osr_link();
2752   }
2753   OsrList_lock->unlock();
2754   if (best != NULL && best->comp_level() >= comp_level && match_level == false) {
2755     return best;
2756   }
2757   return NULL;
2758 }
2759 










2760 // -----------------------------------------------------------------------------------------------------
2761 // Printing
2762 
2763 #ifndef PRODUCT
2764 
2765 #define BULLET  " - "
2766 
2767 static const char* state_names[] = {
2768   "allocated", "loaded", "linked", "being_initialized", "fully_initialized", "initialization_error"
2769 };
2770 
2771 void InstanceKlass::print_on(outputStream* st) const {
2772   assert(is_klass(), "must be klass");
2773   Klass::print_on(st);
2774 
2775   st->print(BULLET"instance size:     %d", size_helper());                        st->cr();
2776   st->print(BULLET"klass size:        %d", size());                               st->cr();
2777   st->print(BULLET"access:            "); access_flags().print_on(st);            st->cr();
2778   st->print(BULLET"state:             "); st->print_cr(state_names[_init_state]);
2779   st->print(BULLET"name:              "); name()->print_value_on(st);             st->cr();




2312   m->clear_all_breakpoints();
2313 }
2314 
2315 void InstanceKlass::release_C_heap_structures() {
2316   // Deallocate oop map cache
2317   if (_oop_map_cache != NULL) {
2318     delete _oop_map_cache;
2319     _oop_map_cache = NULL;
2320   }
2321 
2322   // Deallocate JNI identifiers for jfieldIDs
2323   JNIid::deallocate(jni_ids());
2324   set_jni_ids(NULL);
2325 
2326   jmethodID* jmeths = methods_jmethod_ids_acquire();
2327   if (jmeths != (jmethodID*)NULL) {
2328     release_set_methods_jmethod_ids(NULL);
2329     FreeHeap(jmeths);
2330   }
2331 
2332   MemberNameTable* mnt = member_names();
2333   if (mnt != NULL) {
2334     delete mnt;
2335   }
2336 
2337   int* indices = methods_cached_itable_indices_acquire();
2338   if (indices != (int*)NULL) {
2339     release_set_methods_cached_itable_indices(NULL);
2340     FreeHeap(indices);
2341   }
2342 
2343   // release dependencies
2344   nmethodBucket* b = _dependencies;
2345   _dependencies = NULL;
2346   while (b != NULL) {
2347     nmethodBucket* next = b->next();
2348     delete b;
2349     b = next;
2350   }
2351 
2352   // Deallocate breakpoint records
2353   if (breakpoints() != 0x0) {
2354     methods_do(clear_all_breakpoints);
2355     assert(breakpoints() == 0x0, "should have cleared breakpoints");
2356   }


2745       } else {
2746         if (best == NULL || (osr->comp_level() > best->comp_level())) {
2747           if (osr->comp_level() == CompLevel_highest_tier) {
2748             // Found the best possible - return it.
2749             OsrList_lock->unlock();
2750             return osr;
2751           }
2752           best = osr;
2753         }
2754       }
2755     }
2756     osr = osr->osr_link();
2757   }
2758   OsrList_lock->unlock();
2759   if (best != NULL && best->comp_level() >= comp_level && match_level == false) {
2760     return best;
2761   }
2762   return NULL;
2763 }
2764 
2765 void InstanceKlass::add_member_name(Handle mem_name) {
2766   jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
2767   MutexLocker ml(MemberNameTable_lock);
2768 
2769   if (_member_names == NULL) {
2770     _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable();
2771   }
2772   _member_names->add_member_name(mem_name_wref);
2773 }
2774 
2775 // -----------------------------------------------------------------------------------------------------
2776 // Printing
2777 
2778 #ifndef PRODUCT
2779 
2780 #define BULLET  " - "
2781 
2782 static const char* state_names[] = {
2783   "allocated", "loaded", "linked", "being_initialized", "fully_initialized", "initialization_error"
2784 };
2785 
2786 void InstanceKlass::print_on(outputStream* st) const {
2787   assert(is_klass(), "must be klass");
2788   Klass::print_on(st);
2789 
2790   st->print(BULLET"instance size:     %d", size_helper());                        st->cr();
2791   st->print(BULLET"klass size:        %d", size());                               st->cr();
2792   st->print(BULLET"access:            "); access_flags().print_on(st);            st->cr();
2793   st->print(BULLET"state:             "); st->print_cr(state_names[_init_state]);
2794   st->print(BULLET"name:              "); name()->print_value_on(st);             st->cr();