Mercurial > hg > truffle
comparison src/share/vm/memory/oopFactory.cpp @ 2267:02f78cfa4656
7020992: jmm_DumpThreads should not allocate system object arrays outside the perm gen
Summary: Allocate ordinary object arrays
Reviewed-by: ysr, never, mchung
author | stefank |
---|---|
date | Mon, 21 Feb 2011 11:26:45 +0100 |
parents | 55cc33cf55bc |
children | c7f3d0b4570f |
comparison
equal
deleted
inserted
replaced
2231:f7702f8c0e25 | 2267:02f78cfa4656 |
---|---|
90 assert (klass->klass_part()->oop_is_instance(), "new object array with klass not an instanceKlass"); | 90 assert (klass->klass_part()->oop_is_instance(), "new object array with klass not an instanceKlass"); |
91 return ((instanceKlass*)klass->klass_part())->allocate_objArray(1, length, THREAD); | 91 return ((instanceKlass*)klass->klass_part())->allocate_objArray(1, length, THREAD); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 objArrayOop oopFactory::new_system_objArray(int length, bool in_perm_gen, TRAPS) { | 95 objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { |
96 int size = objArrayOopDesc::object_size(length); | 96 int size = objArrayOopDesc::object_size(length); |
97 KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj()); | 97 KlassHandle klass (THREAD, Universe::systemObjArrayKlassObj()); |
98 oop o; | 98 objArrayOop o = (objArrayOop) |
99 if (in_perm_gen) { | 99 Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); |
100 o = Universe::heap()->permanent_array_allocate(klass, size, length, CHECK_NULL); | |
101 } else { | |
102 o = Universe::heap()->array_allocate(klass, size, length, CHECK_NULL); | |
103 } | |
104 // initialization not needed, allocated cleared | 100 // initialization not needed, allocated cleared |
105 return (objArrayOop) o; | |
106 } | |
107 | |
108 objArrayOop oopFactory::new_system_objArray(int length, TRAPS) { | |
109 objArrayOop o = oopFactory::new_system_objArray(length, true, CHECK_NULL); | |
110 return o; | 101 return o; |
111 } | 102 } |
112 | 103 |
113 | 104 |
114 constantPoolOop oopFactory::new_constantPool(int length, | 105 constantPoolOop oopFactory::new_constantPool(int length, |