hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 29316 5287df8a8972
parent 28738 8f9731dd6bd4
child 29576 c223b0a9872e
child 29687 281ffb2398cd
equal deleted inserted replaced
29198:c1e6bf2dad41 29316:5287df8a8972
  2791 #if INCLUDE_JVMTI
  2791 #if INCLUDE_JVMTI
  2792 // update default_methods for redefineclasses for methods that are
  2792 // update default_methods for redefineclasses for methods that are
  2793 // not yet in the vtable due to concurrent subclass define and superinterface
  2793 // not yet in the vtable due to concurrent subclass define and superinterface
  2794 // redefinition
  2794 // redefinition
  2795 // Note: those in the vtable, should have been updated via adjust_method_entries
  2795 // Note: those in the vtable, should have been updated via adjust_method_entries
  2796 void InstanceKlass::adjust_default_methods(Method** old_methods, Method** new_methods,
  2796 void InstanceKlass::adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed) {
  2797                                            int methods_length, bool* trace_name_printed) {
       
  2798   // search the default_methods for uses of either obsolete or EMCP methods
  2797   // search the default_methods for uses of either obsolete or EMCP methods
  2799   if (default_methods() != NULL) {
  2798   if (default_methods() != NULL) {
  2800     for (int j = 0; j < methods_length; j++) {
  2799     for (int index = 0; index < default_methods()->length(); index ++) {
  2801       Method* old_method = old_methods[j];
  2800       Method* old_method = default_methods()->at(index);
  2802       Method* new_method = new_methods[j];
  2801       if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
  2803 
  2802         continue; // skip uninteresting entries
  2804       for (int index = 0; index < default_methods()->length(); index ++) {
  2803       }
  2805         if (default_methods()->at(index) == old_method) {
  2804       assert(!old_method->is_deleted(), "default methods may not be deleted");
  2806           default_methods()->at_put(index, new_method);
  2805 
  2807           if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
  2806       Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
  2808             if (!(*trace_name_printed)) {
  2807 
  2809               // RC_TRACE_MESG macro has an embedded ResourceMark
  2808       assert(new_method != NULL, "method_with_idnum() should not be NULL");
  2810               RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
  2809       assert(old_method != new_method, "sanity check");
  2811                              external_name(),
  2810 
  2812                              old_method->method_holder()->external_name()));
  2811       default_methods()->at_put(index, new_method);
  2813               *trace_name_printed = true;
  2812       if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
  2814             }
  2813         if (!(*trace_name_printed)) {
  2815             RC_TRACE(0x00100000, ("default method update: %s(%s) ",
  2814           // RC_TRACE_MESG macro has an embedded ResourceMark
  2816                                   new_method->name()->as_C_string(),
  2815           RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
  2817                                   new_method->signature()->as_C_string()));
  2816                          external_name(),
  2818           }
  2817                          old_method->method_holder()->external_name()));
       
  2818           *trace_name_printed = true;
  2819         }
  2819         }
       
  2820         RC_TRACE(0x00100000, ("default method update: %s(%s) ",
       
  2821                               new_method->name()->as_C_string(),
       
  2822                               new_method->signature()->as_C_string()));
  2820       }
  2823       }
  2821     }
  2824     }
  2822   }
  2825   }
  2823 }
  2826 }
  2824 #endif // INCLUDE_JVMTI
  2827 #endif // INCLUDE_JVMTI