equal
deleted
inserted
replaced
3990 // should get cleared in the_class too. |
3990 // should get cleared in the_class too. |
3991 if (the_class->get_cached_class_file_bytes() == 0) { |
3991 if (the_class->get_cached_class_file_bytes() == 0) { |
3992 // the_class doesn't have a cache yet so copy it |
3992 // the_class doesn't have a cache yet so copy it |
3993 the_class->set_cached_class_file(scratch_class->get_cached_class_file()); |
3993 the_class->set_cached_class_file(scratch_class->get_cached_class_file()); |
3994 } |
3994 } |
3995 #ifndef PRODUCT |
3995 else if (scratch_class->get_cached_class_file_bytes() != |
3996 else { |
3996 the_class->get_cached_class_file_bytes()) { |
3997 assert(the_class->get_cached_class_file_bytes() == |
3997 // The same class can be present twice in the scratch classes list or there |
3998 scratch_class->get_cached_class_file_bytes(), "cache ptrs must match"); |
3998 // are multiple concurrent RetransformClasses calls on different threads. |
3999 assert(the_class->get_cached_class_file_len() == |
3999 // In such cases we have to deallocate scratch_class cached_class_file_bytes. |
4000 scratch_class->get_cached_class_file_len(), "cache lens must match"); |
4000 os::free(scratch_class->get_cached_class_file_bytes()); |
4001 } |
4001 } |
4002 #endif |
|
4003 |
4002 |
4004 // NULL out in scratch class to not delete twice. The class to be redefined |
4003 // NULL out in scratch class to not delete twice. The class to be redefined |
4005 // always owns these bytes. |
4004 // always owns these bytes. |
4006 scratch_class->set_cached_class_file(NULL); |
4005 scratch_class->set_cached_class_file(NULL); |
4007 |
4006 |