mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8212682: Avoid holding Compile_lock when blocking for GC in ObjArrayKlass::allocate_objArray_klass()
Reviewed-by: coleenp, dlong
This commit is contained in:
parent
041946dcb0
commit
8b1844626a
4 changed files with 1 additions and 6 deletions
|
@ -1282,7 +1282,6 @@ Klass* InstanceKlass::array_klass_impl(bool or_null, int n, TRAPS) {
|
|||
JavaThread *jt = (JavaThread *)THREAD;
|
||||
{
|
||||
// Atomic creation of array_klasses
|
||||
MutexLocker mc(Compile_lock, THREAD); // for vtables
|
||||
MutexLocker ma(MultiArray_lock, THREAD);
|
||||
|
||||
// Check if update has already taken place
|
||||
|
|
|
@ -80,7 +80,6 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
|
|||
Klass* ek = NULL;
|
||||
{
|
||||
MutexUnlocker mu(MultiArray_lock);
|
||||
MutexUnlocker mc(Compile_lock); // for vtables
|
||||
super_klass = element_super->array_klass(CHECK_0);
|
||||
for( int i = element_supers->length()-1; i >= 0; i-- ) {
|
||||
Klass* elem_super = element_supers->at(i);
|
||||
|
@ -332,7 +331,6 @@ Klass* ObjArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
|
|||
ResourceMark rm;
|
||||
JavaThread *jt = (JavaThread *)THREAD;
|
||||
{
|
||||
MutexLocker mc(Compile_lock, THREAD); // for vtables
|
||||
// Ensure atomic creation of higher dimensions
|
||||
MutexLocker mu(MultiArray_lock, THREAD);
|
||||
|
||||
|
|
|
@ -195,7 +195,6 @@ Klass* TypeArrayKlass::array_klass_impl(bool or_null, int n, TRAPS) {
|
|||
ResourceMark rm;
|
||||
JavaThread *jt = (JavaThread *)THREAD;
|
||||
{
|
||||
MutexLocker mc(Compile_lock, THREAD); // for vtables
|
||||
// Atomic create higher dimension and link into list
|
||||
MutexLocker mu(MultiArray_lock, THREAD);
|
||||
|
||||
|
|
|
@ -2944,8 +2944,7 @@ bool JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (Compile_lock->owner() == thread ||
|
||||
MultiArray_lock->owner() == thread) {
|
||||
if (MultiArray_lock->owner() == thread) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue