--- a/hotspot/src/share/vm/oops/constantPool.hpp Sat Jul 22 15:54:27 2017 -0400
+++ b/hotspot/src/share/vm/oops/constantPool.hpp Wed Aug 02 18:06:38 2017 -0700
@@ -99,6 +99,8 @@
friend class BytecodeInterpreter; // Directly extracts a klass in the pool for fast instanceof/checkcast
friend class Universe; // For null constructor
private:
+ // If you add a new field that points to any metaspace object, you
+ // must add this field to ConstantPool::metaspace_pointers_do().
Array<u1>* _tags; // the tag array describing the constant pool's contents
ConstantPoolCache* _cache; // the cache holding interpreter runtime information
InstanceKlass* _pool_holder; // the corresponding class
@@ -212,6 +214,9 @@
ConstantPoolCache* cache() const { return _cache; }
void set_cache(ConstantPoolCache* cache){ _cache = cache; }
+ virtual void metaspace_pointers_do(MetaspaceClosure* iter);
+ virtual MetaspaceObj::Type type() const { return ConstantPoolType; }
+
// Create object cache in the constant pool
void initialize_resolved_references(ClassLoaderData* loader_data,
const intStack& reference_map,
@@ -765,6 +770,9 @@
void collect_statistics(KlassSizeStats *sz) const;
#endif
+ // ConstantPools should be stored in the read-only region of CDS archive.
+ static bool is_read_only_by_default() { return true; }
+
friend class ClassFileParser;
friend class SystemDictionary;