src/share/vm/prims/jvmtiRedefineClasses.cpp
Print this page
*** 3990,4007 ****
// should get cleared in the_class too.
if (the_class->get_cached_class_file_bytes() == 0) {
// the_class doesn't have a cache yet so copy it
the_class->set_cached_class_file(scratch_class->get_cached_class_file());
}
! #ifndef PRODUCT
! else {
! assert(the_class->get_cached_class_file_bytes() ==
! scratch_class->get_cached_class_file_bytes(), "cache ptrs must match");
! assert(the_class->get_cached_class_file_len() ==
! scratch_class->get_cached_class_file_len(), "cache lens must match");
}
- #endif
// NULL out in scratch class to not delete twice. The class to be redefined
// always owns these bytes.
scratch_class->set_cached_class_file(NULL);
--- 3990,4006 ----
// should get cleared in the_class too.
if (the_class->get_cached_class_file_bytes() == 0) {
// the_class doesn't have a cache yet so copy it
the_class->set_cached_class_file(scratch_class->get_cached_class_file());
}
! else if (scratch_class->get_cached_class_file_bytes() !=
! the_class->get_cached_class_file_bytes()) {
! // The same class can be present twice in the scratch classes list or there
! // are multiple concurrent RetransformClasses calls on different threads.
! // In such cases we have to deallocate scratch_class cached_class_file_bytes.
! os::free(scratch_class->get_cached_class_file_bytes());
}
// NULL out in scratch class to not delete twice. The class to be redefined
// always owns these bytes.
scratch_class->set_cached_class_file(NULL);