hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 28734 a7ef74a8eca2
parent 28374 0558e321c027
child 29081 c61eb4914428
equal deleted inserted replaced
28733:0fc2c4609840 28734:a7ef74a8eca2
  3374     // adjust the default method vtable indices.
  3374     // adjust the default method vtable indices.
  3375     // We also need to adjust any default method entries that are
  3375     // We also need to adjust any default method entries that are
  3376     // not yet in the vtable, because the vtable setup is in progress.
  3376     // not yet in the vtable, because the vtable setup is in progress.
  3377     // This must be done after we adjust the default_methods and
  3377     // This must be done after we adjust the default_methods and
  3378     // default_vtable_indices for methods already in the vtable.
  3378     // default_vtable_indices for methods already in the vtable.
       
  3379     // If redefining Unsafe, walk all the vtables looking for entries.
  3379     if (ik->vtable_length() > 0 && (_the_class_oop->is_interface()
  3380     if (ik->vtable_length() > 0 && (_the_class_oop->is_interface()
       
  3381         || _the_class_oop == SystemDictionary::misc_Unsafe_klass()
  3380         || ik->is_subtype_of(_the_class_oop))) {
  3382         || ik->is_subtype_of(_the_class_oop))) {
  3381       // ik->vtable() creates a wrapper object; rm cleans it up
  3383       // ik->vtable() creates a wrapper object; rm cleans it up
  3382       ResourceMark rm(_thread);
  3384       ResourceMark rm(_thread);
  3383       ik->vtable()->adjust_method_entries(_matching_old_methods,
  3385       ik->vtable()->adjust_method_entries(_matching_old_methods,
  3384                                           _matching_new_methods,
  3386                                           _matching_new_methods,
  3394     // interface or if the current class is a subclass of the_class, then
  3396     // interface or if the current class is a subclass of the_class, then
  3395     // we potentially have to fix the itable. If we are redefining an
  3397     // we potentially have to fix the itable. If we are redefining an
  3396     // interface, then we have to call adjust_method_entries() for
  3398     // interface, then we have to call adjust_method_entries() for
  3397     // every InstanceKlass that has an itable since there isn't a
  3399     // every InstanceKlass that has an itable since there isn't a
  3398     // subclass relationship between an interface and an InstanceKlass.
  3400     // subclass relationship between an interface and an InstanceKlass.
       
  3401     // If redefining Unsafe, walk all the itables looking for entries.
  3399     if (ik->itable_length() > 0 && (_the_class_oop->is_interface()
  3402     if (ik->itable_length() > 0 && (_the_class_oop->is_interface()
       
  3403         || _the_class_oop == SystemDictionary::misc_Unsafe_klass()
  3400         || ik->is_subclass_of(_the_class_oop))) {
  3404         || ik->is_subclass_of(_the_class_oop))) {
  3401       // ik->itable() creates a wrapper object; rm cleans it up
  3405       // ik->itable() creates a wrapper object; rm cleans it up
  3402       ResourceMark rm(_thread);
  3406       ResourceMark rm(_thread);
  3403       ik->itable()->adjust_method_entries(_matching_old_methods,
  3407       ik->itable()->adjust_method_entries(_matching_old_methods,
  3404                                           _matching_new_methods,
  3408                                           _matching_new_methods,