7020992: jmm_DumpThreads should not allocate system object arrays outside the perm gen
Allocate ordinary object arrays Reviewed-by: ysr, never, mchung
This commit is contained in:
parent
57d8e5b8ba
commit
46bcea93ef
@ -92,21 +92,12 @@ objArrayOop oopFactory::new_objArray(klassOop klass, int length, TRAPS) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
objArrayOop oopFactory::new_system_objArray(int length, bool in_perm_gen, TRAPS) {
|
objArrayOop oopFactory::new_system_objArray(int length, TRAPS) {
|
||||||
int size = objArrayOopDesc::object_size(length);
|
int size = objArrayOopDesc::object_size(length);
|
||||||
KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj());
|
KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj());
|
||||||
oop o;
|
objArrayOop o = (objArrayOop)
|
||||||
if (in_perm_gen) {
|
Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL);
|
||||||
o = Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL);
|
|
||||||
} else {
|
|
||||||
o = Universe::heap()->array_allocate(klass, size, length, CHECK_NULL);
|
|
||||||
}
|
|
||||||
// initialization not needed, allocated cleared
|
// initialization not needed, allocated cleared
|
||||||
return (objArrayOop) o;
|
|
||||||
}
|
|
||||||
|
|
||||||
objArrayOop oopFactory::new_system_objArray(int length, TRAPS) {
|
|
||||||
objArrayOop o = oopFactory::new_system_objArray(length, true, CHECK_NULL);
|
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ public:
|
|||||||
|
|
||||||
// System object arrays
|
// System object arrays
|
||||||
static objArrayOop new_system_objArray(int length, TRAPS);
|
static objArrayOop new_system_objArray(int length, TRAPS);
|
||||||
static objArrayOop new_system_objArray(int length, bool in_perm_gen, TRAPS);
|
|
||||||
|
|
||||||
// Regular object arrays
|
// Regular object arrays
|
||||||
static objArrayOop new_objArray(klassOop klass, int length, TRAPS);
|
static objArrayOop new_objArray(klassOop klass, int length, TRAPS);
|
||||||
|
@ -1311,7 +1311,7 @@ JVM_ENTRY(jobjectArray, jmm_DumpThreads(JNIEnv *env, jlongArray thread_ids, jboo
|
|||||||
if (locked_monitors) {
|
if (locked_monitors) {
|
||||||
// Constructs Object[] and int[] to contain the object monitor and the stack depth
|
// Constructs Object[] and int[] to contain the object monitor and the stack depth
|
||||||
// where the thread locked it
|
// where the thread locked it
|
||||||
objArrayOop array = oopFactory::new_system_objArray(num_locked_monitors, false, CHECK_NULL);
|
objArrayOop array = oopFactory::new_objArray(SystemDictionary::Object_klass(), num_locked_monitors, CHECK_NULL);
|
||||||
objArrayHandle mh(THREAD, array);
|
objArrayHandle mh(THREAD, array);
|
||||||
monitors_array = mh;
|
monitors_array = mh;
|
||||||
|
|
||||||
@ -1353,7 +1353,7 @@ JVM_ENTRY(jobjectArray, jmm_DumpThreads(JNIEnv *env, jlongArray thread_ids, jboo
|
|||||||
GrowableArray<instanceOop>* locks = (tcl != NULL ? tcl->owned_locks() : NULL);
|
GrowableArray<instanceOop>* locks = (tcl != NULL ? tcl->owned_locks() : NULL);
|
||||||
int num_locked_synchronizers = (locks != NULL ? locks->length() : 0);
|
int num_locked_synchronizers = (locks != NULL ? locks->length() : 0);
|
||||||
|
|
||||||
objArrayOop array = oopFactory::new_system_objArray(num_locked_synchronizers, false, CHECK_NULL);
|
objArrayOop array = oopFactory::new_objArray(SystemDictionary::Object_klass(), num_locked_synchronizers, CHECK_NULL);
|
||||||
objArrayHandle sh(THREAD, array);
|
objArrayHandle sh(THREAD, array);
|
||||||
synchronizers_array = sh;
|
synchronizers_array = sh;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user