comparison src/share/vm/oops/cpCache.hpp @ 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 8d9fc28831cc
children 23123fc6968a
comparison
equal deleted inserted replaced
8711:6b803ba47588 8712:3efdfd6ddbf2
375 375
376 // Sizing 376 // Sizing
377 debug_only(friend class ClassVerifier;) 377 debug_only(friend class ClassVerifier;)
378 378
379 // Constructor 379 // Constructor
380 ConstantPoolCache(int length) : _length(length), _constant_pool(NULL) { 380 ConstantPoolCache(int length, const intStack& inverse_index_map,
381 const intStack& invokedynamic_references_map) :
382 _length(length), _constant_pool(NULL) {
383 initialize(inverse_index_map, invokedynamic_references_map);
381 for (int i = 0; i < length; i++) { 384 for (int i = 0; i < length; i++) {
382 assert(entry_at(i)->is_f1_null(), "Failed to clear?"); 385 assert(entry_at(i)->is_f1_null(), "Failed to clear?");
383 } 386 }
384 } 387 }
385 388
389 // Initialization
390 void initialize(const intArray& inverse_index_map, const intArray& invokedynamic_references_map);
386 public: 391 public:
387 static ConstantPoolCache* allocate(ClassLoaderData* loader_data, int length, TRAPS); 392 static ConstantPoolCache* allocate(ClassLoaderData* loader_data, int length,
393 const intStack& inverse_index_map,
394 const intStack& invokedynamic_references_map, TRAPS);
388 bool is_constantPoolCache() const { return true; } 395 bool is_constantPoolCache() const { return true; }
389 396
390 int length() const { return _length; } 397 int length() const { return _length; }
391 private: 398 private:
392 void set_length(int length) { _length = length; } 399 void set_length(int length) { _length = length; }
403 410
404 friend class constantPoolCacheKlass; 411 friend class constantPoolCacheKlass;
405 friend class ConstantPoolCacheEntry; 412 friend class ConstantPoolCacheEntry;
406 413
407 public: 414 public:
408 // Initialization
409 void initialize(intArray& inverse_index_map, intArray& invokedynamic_references_map);
410
411 // Accessors 415 // Accessors
412 void set_constant_pool(ConstantPool* pool) { _constant_pool = pool; } 416 void set_constant_pool(ConstantPool* pool) { _constant_pool = pool; }
413 ConstantPool* constant_pool() const { return _constant_pool; } 417 ConstantPool* constant_pool() const { return _constant_pool; }
414 // Fetches the entry at the given index. 418 // Fetches the entry at the given index.
415 // In either case the index must not be encoded or byte-swapped in any way. 419 // In either case the index must not be encoded or byte-swapped in any way.