hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 18940 d39d4765e6cb
parent 17864 29aa71317b51
child 19278 c4355bebb414
equal deleted inserted replaced
18938:ff8f8cec9434 18940:d39d4765e6cb
  3340   // with them was cached on the scratch class, move to the_class.
  3340   // with them was cached on the scratch class, move to the_class.
  3341   // Note: we still want to do this if nothing needed caching since it
  3341   // Note: we still want to do this if nothing needed caching since it
  3342   // should get cleared in the_class too.
  3342   // should get cleared in the_class too.
  3343   if (the_class->get_cached_class_file_bytes() == 0) {
  3343   if (the_class->get_cached_class_file_bytes() == 0) {
  3344     // the_class doesn't have a cache yet so copy it
  3344     // the_class doesn't have a cache yet so copy it
  3345     the_class->set_cached_class_file(
  3345     the_class->set_cached_class_file(scratch_class->get_cached_class_file());
  3346       scratch_class->get_cached_class_file_bytes(),
       
  3347       scratch_class->get_cached_class_file_len());
       
  3348   }
  3346   }
  3349 #ifndef PRODUCT
  3347 #ifndef PRODUCT
  3350   else {
  3348   else {
  3351     assert(the_class->get_cached_class_file_bytes() ==
  3349     assert(the_class->get_cached_class_file_bytes() ==
  3352       scratch_class->get_cached_class_file_bytes(), "cache ptrs must match");
  3350       scratch_class->get_cached_class_file_bytes(), "cache ptrs must match");
  3355   }
  3353   }
  3356 #endif
  3354 #endif
  3357 
  3355 
  3358   // NULL out in scratch class to not delete twice.  The class to be redefined
  3356   // NULL out in scratch class to not delete twice.  The class to be redefined
  3359   // always owns these bytes.
  3357   // always owns these bytes.
  3360   scratch_class->set_cached_class_file(NULL, 0);
  3358   scratch_class->set_cached_class_file(NULL);
  3361 
  3359 
  3362   // Replace inner_classes
  3360   // Replace inner_classes
  3363   Array<u2>* old_inner_classes = the_class->inner_classes();
  3361   Array<u2>* old_inner_classes = the_class->inner_classes();
  3364   the_class->set_inner_classes(scratch_class->inner_classes());
  3362   the_class->set_inner_classes(scratch_class->inner_classes());
  3365   scratch_class->set_inner_classes(old_inner_classes);
  3363   scratch_class->set_inner_classes(old_inner_classes);