3754 // all future compilations will record dependencies so second and
3755 // subsequent calls to RedefineClasses need only throw away code
3756 // that depends on the class.
3757 //
3758 void VM_RedefineClasses::flush_dependent_code(instanceKlassHandle k_h, TRAPS) {
3759 assert_locked_or_safepoint(Compile_lock);
3760
3761 // All dependencies have been recorded from startup or this is a second or
3762 // subsequent use of RedefineClasses
3763 if (JvmtiExport::all_dependencies_are_recorded()) {
3764 CodeCache::flush_evol_dependents_on(k_h);
3765 } else {
3766 CodeCache::mark_all_nmethods_for_deoptimization();
3767
3768 ResourceMark rm(THREAD);
3769 DeoptimizationMarker dm;
3770
3771 // Deoptimize all activations depending on marked nmethods
3772 Deoptimization::deoptimize_dependents();
3773
3774 // Make the dependent methods not entrant (in VM_Deoptimize they are made zombies)
3775 CodeCache::make_marked_nmethods_not_entrant();
3776
3777 // From now on we know that the dependency information is complete
3778 JvmtiExport::set_all_dependencies_are_recorded(true);
3779 }
3780 }
3781
3782 void VM_RedefineClasses::compute_added_deleted_matching_methods() {
3783 Method* old_method;
3784 Method* new_method;
3785
3786 _matching_old_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3787 _matching_new_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3788 _added_methods = NEW_RESOURCE_ARRAY(Method*, _new_methods->length());
3789 _deleted_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3790
3791 _matching_methods_length = 0;
3792 _deleted_methods_length = 0;
3793 _added_methods_length = 0;
3794
|
3754 // all future compilations will record dependencies so second and
3755 // subsequent calls to RedefineClasses need only throw away code
3756 // that depends on the class.
3757 //
3758 void VM_RedefineClasses::flush_dependent_code(instanceKlassHandle k_h, TRAPS) {
3759 assert_locked_or_safepoint(Compile_lock);
3760
3761 // All dependencies have been recorded from startup or this is a second or
3762 // subsequent use of RedefineClasses
3763 if (JvmtiExport::all_dependencies_are_recorded()) {
3764 CodeCache::flush_evol_dependents_on(k_h);
3765 } else {
3766 CodeCache::mark_all_nmethods_for_deoptimization();
3767
3768 ResourceMark rm(THREAD);
3769 DeoptimizationMarker dm;
3770
3771 // Deoptimize all activations depending on marked nmethods
3772 Deoptimization::deoptimize_dependents();
3773
3774 // Make the dependent methods not entrant
3775 CodeCache::make_marked_nmethods_not_entrant();
3776
3777 // From now on we know that the dependency information is complete
3778 JvmtiExport::set_all_dependencies_are_recorded(true);
3779 }
3780 }
3781
3782 void VM_RedefineClasses::compute_added_deleted_matching_methods() {
3783 Method* old_method;
3784 Method* new_method;
3785
3786 _matching_old_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3787 _matching_new_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3788 _added_methods = NEW_RESOURCE_ARRAY(Method*, _new_methods->length());
3789 _deleted_methods = NEW_RESOURCE_ARRAY(Method*, _old_methods->length());
3790
3791 _matching_methods_length = 0;
3792 _deleted_methods_length = 0;
3793 _added_methods_length = 0;
3794
|