comparison src/share/vm/oops/cpCache.cpp @ 8712:3efdfd6ddbf2

8003553: NPG: metaspace objects should be zeroed in constructors Summary: Zero metadata in constructors, not in allocation (and some in constructors) Reviewed-by: jmasa, sspitsyn
author coleenp
date Fri, 08 Mar 2013 11:47:57 -0500
parents 461a3adac4d1
children c115fac239eb
comparison
equal deleted inserted replaced
8711:6b803ba47588 8712:3efdfd6ddbf2
42 // Implememtation of ConstantPoolCacheEntry 42 // Implememtation of ConstantPoolCacheEntry
43 43
44 void ConstantPoolCacheEntry::initialize_entry(int index) { 44 void ConstantPoolCacheEntry::initialize_entry(int index) {
45 assert(0 < index && index < 0x10000, "sanity check"); 45 assert(0 < index && index < 0x10000, "sanity check");
46 _indices = index; 46 _indices = index;
47 _f1 = NULL;
48 _f2 = _flags = 0;
47 assert(constant_pool_index() == index, ""); 49 assert(constant_pool_index() == index, "");
48 } 50 }
49 51
50 int ConstantPoolCacheEntry::make_flags(TosState state, 52 int ConstantPoolCacheEntry::make_flags(TosState state,
51 int option_bits, 53 int option_bits,
531 // not implemented yet 533 // not implemented yet
532 } 534 }
533 535
534 // Implementation of ConstantPoolCache 536 // Implementation of ConstantPoolCache
535 537
536 ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data, int length, TRAPS) { 538 ConstantPoolCache* ConstantPoolCache::allocate(ClassLoaderData* loader_data,
539 int length,
540 const intStack& index_map,
541 const intStack& invokedynamic_map, TRAPS) {
537 int size = ConstantPoolCache::size(length); 542 int size = ConstantPoolCache::size(length);
538 543
539 return new (loader_data, size, false, THREAD) ConstantPoolCache(length); 544 return new (loader_data, size, false, THREAD) ConstantPoolCache(length, index_map, invokedynamic_map);
540 } 545 }
541 546
542 void ConstantPoolCache::initialize(intArray& inverse_index_map, intArray& invokedynamic_references_map) { 547 void ConstantPoolCache::initialize(const intArray& inverse_index_map,
548 const intArray& invokedynamic_references_map) {
543 assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache"); 549 assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
544 for (int i = 0; i < length(); i++) { 550 for (int i = 0; i < length(); i++) {
545 ConstantPoolCacheEntry* e = entry_at(i); 551 ConstantPoolCacheEntry* e = entry_at(i);
546 int original_index = inverse_index_map[i]; 552 int original_index = inverse_index_map[i];
547 e->initialize_entry(original_index); 553 e->initialize_entry(original_index);