< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page




3639   bool good_state = is_shared() ? (_init_state <= state)
3640                                                : (_init_state < state);
3641   assert(good_state || state == allocated, "illegal state transition");
3642   _init_state = (u1)state;
3643 }
3644 #endif
3645 
3646 #if INCLUDE_JVMTI
3647 
3648 // RedefineClasses() support for previous versions
3649 
3650 // Globally, there is at least one previous version of a class to walk
3651 // during class unloading, which is saved because old methods in the class
3652 // are still running.   Otherwise the previous version list is cleaned up.
3653 bool InstanceKlass::_has_previous_versions = false;
3654 
3655 // Returns true if there are previous versions of a class for class
3656 // unloading only. Also resets the flag to false. purge_previous_version
3657 // will set the flag to true if there are any left, i.e., if there's any
3658 // work to do for next time. This is to avoid the expensive code cache
3659 // walk in CLDG::do_unloading().
3660 bool InstanceKlass::has_previous_versions_and_reset() {
3661   bool ret = _has_previous_versions;
3662   log_trace(redefine, class, iklass, purge)("Class unloading: has_previous_versions = %s",
3663      ret ? "true" : "false");
3664   _has_previous_versions = false;
3665   return ret;
3666 }
3667 
3668 // Purge previous versions before adding new previous versions of the class and
3669 // during class unloading.
3670 void InstanceKlass::purge_previous_version_list() {
3671   assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
3672   assert(has_been_redefined(), "Should only be called for main class");
3673 
3674   // Quick exit.
3675   if (previous_versions() == NULL) {
3676     return;
3677   }
3678 
3679   // This klass has previous versions so see what we can cleanup




3639   bool good_state = is_shared() ? (_init_state <= state)
3640                                                : (_init_state < state);
3641   assert(good_state || state == allocated, "illegal state transition");
3642   _init_state = (u1)state;
3643 }
3644 #endif
3645 
3646 #if INCLUDE_JVMTI
3647 
3648 // RedefineClasses() support for previous versions
3649 
3650 // Globally, there is at least one previous version of a class to walk
3651 // during class unloading, which is saved because old methods in the class
3652 // are still running.   Otherwise the previous version list is cleaned up.
3653 bool InstanceKlass::_has_previous_versions = false;
3654 
3655 // Returns true if there are previous versions of a class for class
3656 // unloading only. Also resets the flag to false. purge_previous_version
3657 // will set the flag to true if there are any left, i.e., if there's any
3658 // work to do for next time. This is to avoid the expensive code cache
3659 // walk in CLDG::clean_deallocate_lists().
3660 bool InstanceKlass::has_previous_versions_and_reset() {
3661   bool ret = _has_previous_versions;
3662   log_trace(redefine, class, iklass, purge)("Class unloading: has_previous_versions = %s",
3663      ret ? "true" : "false");
3664   _has_previous_versions = false;
3665   return ret;
3666 }
3667 
3668 // Purge previous versions before adding new previous versions of the class and
3669 // during class unloading.
3670 void InstanceKlass::purge_previous_version_list() {
3671   assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
3672   assert(has_been_redefined(), "Should only be called for main class");
3673 
3674   // Quick exit.
3675   if (previous_versions() == NULL) {
3676     return;
3677   }
3678 
3679   // This klass has previous versions so see what we can cleanup


< prev index next >