8003553: NPG: metaspace objects should be zeroed in constructors

Zero metadata in constructors, not in allocation (and some in constructors)

Reviewed-by: jmasa, sspitsyn
This commit is contained in:
Coleen Phillimore 2013-03-08 11:47:57 -05:00
parent 4cdcd6dc13
commit addd95f165
13 changed files with 111 additions and 97 deletions

View file

@ -44,6 +44,8 @@
void ConstantPoolCacheEntry::initialize_entry(int index) {
assert(0 < index && index < 0x10000, "sanity check");
_indices = index;
_f1 = NULL;
_f2 = _flags = 0;
assert(constant_pool_index() == index, "");
}
@ -533,13 +535,17 @@ void ConstantPoolCacheEntry::verify(outputStream* st) const {
// Implementation of ConstantPoolCache
ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data,
int length,
const intStack& index_map,
const intStack& invokedynamic_map, TRAPS) {
int size = ConstantPoolCache::size(length);
return new (loader_data, size, false, THREAD) ConstantPoolCache(length);
return new (loader_data, size, false, THREAD) ConstantPoolCache(length, index_map, invokedynamic_map);
}
void ConstantPoolCache::initialize(intArray& inverse_index_map, intArray& invokedynamic_references_map) {
void ConstantPoolCache::initialize(const intArray& inverse_index_map,
const intArray& invokedynamic_references_map) {
assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
for (int i = 0; i < length(); i++) {
ConstantPoolCacheEntry* e = entry_at(i);