src/hotspot/share/oops/klass.hpp
changeset 49329 04ed29f9ef33
parent 49056 91ada5977172
child 49368 2ed1c37df3a5
--- a/src/hotspot/share/oops/klass.hpp	Fri Mar 02 10:42:32 2018 -0800
+++ b/src/hotspot/share/oops/klass.hpp	Fri Mar 02 17:25:55 2018 -0500
@@ -156,6 +156,18 @@
   // -1.
   jshort _shared_class_path_index;
 
+#if INCLUDE_CDS
+  // Flags of the current shared class.
+  u2     _shared_class_flags;
+  enum {
+    _has_raw_archived_mirror = 1,
+    _has_signer_and_not_archived = 1 << 2
+  };
+#endif
+  // The _archived_mirror is set at CDS dump time pointing to the cached mirror
+  // in the open archive heap region when archiving java object is supported.
+  CDS_JAVA_HEAP_ONLY(narrowOop _archived_mirror);
+
   friend class SharedClassUtil;
 protected:
 
@@ -229,11 +241,17 @@
   oop java_mirror() const;
   void set_java_mirror(Handle m);
 
+  oop archived_java_mirror_raw() NOT_CDS_JAVA_HEAP_RETURN_(NULL); // no GC barrier
+  oop archived_java_mirror() NOT_CDS_JAVA_HEAP_RETURN_(NULL);     // accessor with GC barrier
+  void set_archived_java_mirror_raw(oop m) NOT_CDS_JAVA_HEAP_RETURN; // no GC barrier
+
   // Temporary mirror switch used by RedefineClasses
   // Both mirrors are on the ClassLoaderData::_handles list already so no
   // barriers are needed.
   void set_java_mirror_handle(OopHandle mirror) { _java_mirror = mirror; }
-  OopHandle java_mirror_handle() const          { return _java_mirror; }
+  OopHandle java_mirror_handle() const          {
+    return _java_mirror;
+  }
 
   // modifier flags
   jint modifier_flags() const          { return _modifier_flags; }
@@ -267,6 +285,26 @@
     _shared_class_path_index = index;
   };
 
+  void set_has_raw_archived_mirror() {
+    CDS_ONLY(_shared_class_flags |= _has_raw_archived_mirror;)
+  }
+  void clear_has_raw_archived_mirror() {
+    CDS_ONLY(_shared_class_flags &= ~_has_raw_archived_mirror;)
+  }
+  bool has_raw_archived_mirror() const {
+    CDS_ONLY(return (_shared_class_flags & _has_raw_archived_mirror) != 0;)
+    NOT_CDS(return false;)
+  }
+#if INCLUDE_CDS
+  void set_has_signer_and_not_archived() {
+    _shared_class_flags |= _has_signer_and_not_archived;
+  }
+  bool has_signer_and_not_archived() const {
+    assert(DumpSharedSpaces, "dump time only");
+    return (_shared_class_flags & _has_signer_and_not_archived) != 0;
+  }
+#endif // INCLUDE_CDS
+
   // Obtain the module or package for this class
   virtual ModuleEntry* module() const = 0;
   virtual PackageEntry* package() const = 0;