< prev index next >

src/hotspot/share/prims/jvmtiRedefineClasses.cpp

Print this page




 215   for (int i = 0; i < _class_count; i++) {
 216     redefine_single_class(_class_defs[i].klass, _scratch_classes[i], thread);
 217   }
 218 
 219   // Flush all compiled code that depends on the classes redefined.
 220   flush_dependent_code();
 221 
 222   // Adjust constantpool caches and vtables for all classes
 223   // that reference methods of the evolved classes.
 224   // Have to do this after all classes are redefined and all methods that
 225   // are redefined are marked as old.
 226   AdjustAndCleanMetadata adjust_and_clean_metadata(thread);
 227   ClassLoaderDataGraph::classes_do(&adjust_and_clean_metadata);
 228 
 229   // JSR-292 support
 230   if (_any_class_has_resolved_methods) {
 231     bool trace_name_printed = false;
 232     ResolvedMethodTable::adjust_method_entries(&trace_name_printed);
 233   }
 234 
 235   // Set flag indicating that some invariants are no longer true.
 236   // See jvmtiExport.hpp for detailed explanation.
 237   JvmtiExport::set_has_redefined_a_class();
 238 
 239   // check_class() is optionally called for product bits, but is
 240   // always called for non-product bits.
 241 #ifdef PRODUCT
 242   if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
 243 #endif
 244     log_trace(redefine, class, obsolete, metadata)("calling check_class");
 245     CheckClass check_class(thread);
 246     ClassLoaderDataGraph::classes_do(&check_class);
 247 #ifdef PRODUCT
 248   }
 249 #endif
 250 
 251   // Clean up any metadata now unreferenced while MetadataOnStackMark is set.
 252   ClassLoaderDataGraph::clean_deallocate_lists(false);
 253 }
 254 
 255 void VM_RedefineClasses::doit_epilogue() {
 256   unlock_classes();
 257 




 215   for (int i = 0; i < _class_count; i++) {
 216     redefine_single_class(_class_defs[i].klass, _scratch_classes[i], thread);
 217   }
 218 
 219   // Flush all compiled code that depends on the classes redefined.
 220   flush_dependent_code();
 221 
 222   // Adjust constantpool caches and vtables for all classes
 223   // that reference methods of the evolved classes.
 224   // Have to do this after all classes are redefined and all methods that
 225   // are redefined are marked as old.
 226   AdjustAndCleanMetadata adjust_and_clean_metadata(thread);
 227   ClassLoaderDataGraph::classes_do(&adjust_and_clean_metadata);
 228 
 229   // JSR-292 support
 230   if (_any_class_has_resolved_methods) {
 231     bool trace_name_printed = false;
 232     ResolvedMethodTable::adjust_method_entries(&trace_name_printed);
 233   }
 234 
 235   // Increment flag indicating that some invariants are no longer true.
 236   // See jvmtiExport.hpp for detailed explanation.
 237   JvmtiExport::increment_redefinition_count();
 238 
 239   // check_class() is optionally called for product bits, but is
 240   // always called for non-product bits.
 241 #ifdef PRODUCT
 242   if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
 243 #endif
 244     log_trace(redefine, class, obsolete, metadata)("calling check_class");
 245     CheckClass check_class(thread);
 246     ClassLoaderDataGraph::classes_do(&check_class);
 247 #ifdef PRODUCT
 248   }
 249 #endif
 250 
 251   // Clean up any metadata now unreferenced while MetadataOnStackMark is set.
 252   ClassLoaderDataGraph::clean_deallocate_lists(false);
 253 }
 254 
 255 void VM_RedefineClasses::doit_epilogue() {
 256   unlock_classes();
 257 


< prev index next >