mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
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:
parent
4cdcd6dc13
commit
addd95f165
13 changed files with 111 additions and 97 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue