Mon, 21 Feb 2011 11:26:45 +0100
7020992: jmm_DumpThreads should not allocate system object arrays outside the perm gen
Summary: Allocate ordinary object arrays
Reviewed-by: ysr, never, mchung
1.1 --- a/src/share/vm/memory/oopFactory.cpp Mon Feb 14 22:21:18 2011 -0500 1.2 +++ b/src/share/vm/memory/oopFactory.cpp Mon Feb 21 11:26:45 2011 +0100 1.3 @@ -92,21 +92,12 @@ 1.4 } 1.5 } 1.6 1.7 -objArrayOop oopFactory::new_system_objArray(int length, bool in_perm_gen, TRAPS) { 1.8 +objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { 1.9 int size = objArrayOopDesc::object_size(length); 1.10 KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj()); 1.11 - oop o; 1.12 - if (in_perm_gen) { 1.13 - o = Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); 1.14 - } else { 1.15 - o = Universe::heap()->array_allocate(klass, size, length, CHECK_NULL); 1.16 - } 1.17 + objArrayOop o = (objArrayOop) 1.18 + Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); 1.19 // initialization not needed, allocated cleared 1.20 - return (objArrayOop) o; 1.21 -} 1.22 - 1.23 -objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { 1.24 - objArrayOop o = oopFactory::new_system_objArray(length, true, CHECK_NULL); 1.25 return o; 1.26 } 1.27
2.1 --- a/src/share/vm/memory/oopFactory.hpp Mon Feb 14 22:21:18 2011 -0500 2.2 +++ b/src/share/vm/memory/oopFactory.hpp Mon Feb 21 11:26:45 2011 +0100 2.3 @@ -102,7 +102,6 @@ 2.4 2.5 // System object arrays 2.6 static objArrayOop new_system_objArray(int length, TRAPS); 2.7 - static objArrayOop new_system_objArray(int length, bool in_perm_gen, TRAPS); 2.8 2.9 // Regular object arrays 2.10 static objArrayOop new_objArray(klassOop klass, int length, TRAPS);
3.1 --- a/src/share/vm/services/management.cpp Mon Feb 14 22:21:18 2011 -0500 3.2 +++ b/src/share/vm/services/management.cpp Mon Feb 21 11:26:45 2011 +0100 3.3 @@ -1311,7 +1311,7 @@ 3.4 if (locked_monitors) { 3.5 // Constructs Object[] and int[] to contain the object monitor and the stack depth 3.6 // where the thread locked it 3.7 - objArrayOop array = oopFactory::new_system_objArray(num_locked_monitors, false, CHECK_NULL); 3.8 + objArrayOop array = oopFactory::new_objArray(SystemDictionary::Object_klass(), num_locked_monitors, CHECK_NULL); 3.9 objArrayHandle mh(THREAD, array); 3.10 monitors_array = mh; 3.11 3.12 @@ -1353,7 +1353,7 @@ 3.13 GrowableArray<instanceOop>* locks = (tcl != NULL ? tcl->owned_locks() : NULL); 3.14 int num_locked_synchronizers = (locks != NULL ? locks->length() : 0); 3.15 3.16 - objArrayOop array = oopFactory::new_system_objArray(num_locked_synchronizers, false, CHECK_NULL); 3.17 + objArrayOop array = oopFactory::new_objArray(SystemDictionary::Object_klass(), num_locked_synchronizers, CHECK_NULL); 3.18 objArrayHandle sh(THREAD, array); 3.19 synchronizers_array = sh; 3.20