提交 7c95fd0c 编写于 作者: S sspitsyn

8066679: jvmtiRedefineClasses.cpp assert cache ptrs must match

Summary: remove the assert and deallocate cashed class file bytes that are in collision
Reviewed-by: coleenp, dcubed
上级 3193b2f7
...@@ -3979,14 +3979,13 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass, ...@@ -3979,14 +3979,13 @@ void VM_RedefineClasses::redefine_single_class(jclass the_jclass,
// the_class doesn't have a cache yet so copy it // the_class doesn't have a cache yet so copy it
the_class->set_cached_class_file(scratch_class->get_cached_class_file()); the_class->set_cached_class_file(scratch_class->get_cached_class_file());
} }
#ifndef PRODUCT else if (scratch_class->get_cached_class_file_bytes() !=
else { the_class->get_cached_class_file_bytes()) {
assert(the_class->get_cached_class_file_bytes() == // The same class can be present twice in the scratch classes list or there
scratch_class->get_cached_class_file_bytes(), "cache ptrs must match"); // are multiple concurrent RetransformClasses calls on different threads.
assert(the_class->get_cached_class_file_len() == // In such cases we have to deallocate scratch_class cached_class_file_bytes.
scratch_class->get_cached_class_file_len(), "cache lens must match"); os::free(scratch_class->get_cached_class_file_bytes());
} }
#endif
// NULL out in scratch class to not delete twice. The class to be redefined // NULL out in scratch class to not delete twice. The class to be redefined
// always owns these bytes. // always owns these bytes.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册