< prev index next >

hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp

Print this page
rev 7513 : 8076110: VM crash when class is redefined with Instrumentation.redefineClasses
Reviewed-by: coleenp, sspitsyn


4054 
4055   // keep track of previous versions of this class
4056   the_class->add_previous_version(scratch_class, &emcp_methods,
4057     emcp_method_count);
4058 
4059   RC_TIMER_STOP(_timer_rsc_phase1);
4060   RC_TIMER_START(_timer_rsc_phase2);
4061 
4062   // Adjust constantpool caches and vtables for all classes
4063   // that reference methods of the evolved class.
4064   AdjustCpoolCacheAndVtable adjust_cpool_cache_and_vtable(THREAD);
4065   ClassLoaderDataGraph::classes_do(&adjust_cpool_cache_and_vtable);
4066 
4067   // JSR-292 support
4068   MemberNameTable* mnt = the_class->member_names();
4069   if (mnt != NULL) {
4070     bool trace_name_printed = false;
4071     mnt->adjust_method_entries(the_class(), &trace_name_printed);
4072   }
4073 
4074   // Fix Resolution Error table also to remove old constant pools
4075   SystemDictionary::delete_resolution_error(old_constants);
4076 
4077   if (the_class->oop_map_cache() != NULL) {
4078     // Flush references to any obsolete methods from the oop map cache
4079     // so that obsolete methods are not pinned.
4080     the_class->oop_map_cache()->flush_obsolete_entries();
4081   }
4082 
4083   // increment the classRedefinedCount field in the_class and in any
4084   // direct and indirect subclasses of the_class
4085   increment_class_counter((InstanceKlass *)the_class(), THREAD);
4086 
4087   // RC_TRACE macro has an embedded ResourceMark
4088   RC_TRACE_WITH_THREAD(0x00000001, THREAD,
4089     ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
4090     the_class->external_name(),
4091     java_lang_Class::classRedefinedCount(the_class_mirror),
4092     os::available_memory() >> 10));
4093 
4094   RC_TIMER_STOP(_timer_rsc_phase2);
4095 } // end redefine_single_class()
4096 




4054 
4055   // keep track of previous versions of this class
4056   the_class->add_previous_version(scratch_class, &emcp_methods,
4057     emcp_method_count);
4058 
4059   RC_TIMER_STOP(_timer_rsc_phase1);
4060   RC_TIMER_START(_timer_rsc_phase2);
4061 
4062   // Adjust constantpool caches and vtables for all classes
4063   // that reference methods of the evolved class.
4064   AdjustCpoolCacheAndVtable adjust_cpool_cache_and_vtable(THREAD);
4065   ClassLoaderDataGraph::classes_do(&adjust_cpool_cache_and_vtable);
4066 
4067   // JSR-292 support
4068   MemberNameTable* mnt = the_class->member_names();
4069   if (mnt != NULL) {
4070     bool trace_name_printed = false;
4071     mnt->adjust_method_entries(the_class(), &trace_name_printed);
4072   }
4073 



4074   if (the_class->oop_map_cache() != NULL) {
4075     // Flush references to any obsolete methods from the oop map cache
4076     // so that obsolete methods are not pinned.
4077     the_class->oop_map_cache()->flush_obsolete_entries();
4078   }
4079 
4080   // increment the classRedefinedCount field in the_class and in any
4081   // direct and indirect subclasses of the_class
4082   increment_class_counter((InstanceKlass *)the_class(), THREAD);
4083 
4084   // RC_TRACE macro has an embedded ResourceMark
4085   RC_TRACE_WITH_THREAD(0x00000001, THREAD,
4086     ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
4087     the_class->external_name(),
4088     java_lang_Class::classRedefinedCount(the_class_mirror),
4089     os::available_memory() >> 10));
4090 
4091   RC_TIMER_STOP(_timer_rsc_phase2);
4092 } // end redefine_single_class()
4093 


< prev index next >