diff src/share/vm/oops/oopsHierarchy.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents c7f3d0b4570f
children aed758eda82a
line wrap: on
line diff
--- a/src/share/vm/oops/oopsHierarchy.hpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/src/share/vm/oops/oopsHierarchy.hpp	Sat Sep 01 13:25:18 2012 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,29 +33,19 @@
 // of B, A's representation is a prefix of B's representation.
 
 typedef juint narrowOop; // Offset instead of address for an oop within a java object
-typedef class klassOopDesc* wideKlassOop; // to keep SA happy and unhandled oop
-                                          // detector happy.
 typedef void* OopOrNarrowOopStar;
+typedef class   markOopDesc*                markOop;
 
 #ifndef CHECK_UNHANDLED_OOPS
 
 typedef class oopDesc*                            oop;
 typedef class   instanceOopDesc*            instanceOop;
-typedef class   methodOopDesc*                    methodOop;
-typedef class   constMethodOopDesc*            constMethodOop;
-typedef class   methodDataOopDesc*            methodDataOop;
 typedef class   arrayOopDesc*                    arrayOop;
 typedef class     objArrayOopDesc*            objArrayOop;
 typedef class     typeArrayOopDesc*            typeArrayOop;
-typedef class   constantPoolOopDesc*            constantPoolOop;
-typedef class   constantPoolCacheOopDesc*   constantPoolCacheOop;
-typedef class   klassOopDesc*                    klassOop;
-typedef class   markOopDesc*                    markOop;
-typedef class   compiledICHolderOopDesc*    compiledICHolderOop;
 
 #else
 
-
 // When CHECK_UNHANDLED_OOPS is defined, an "oop" is a class with a
 // carefully chosen set of constructors and conversion operators to go
 // to and from the underlying oopDesc pointer type.
@@ -71,7 +61,6 @@
 // instead, which generates less code anyway.
 
 class Thread;
-typedef class   markOopDesc*                markOop;
 class PromotedObject;
 
 
@@ -106,7 +95,7 @@
   oopDesc*  operator->() const        { return obj(); }
   bool operator==(const oop o) const  { return obj() == o.obj(); }
   bool operator==(void *p) const      { return obj() == p; }
-  bool operator!=(const oop o) const  { return obj() != o.obj(); }
+  bool operator!=(const volatile oop o) const  { return obj() != o.obj(); }
   bool operator!=(void *p) const      { return obj() != p; }
   bool operator==(intptr_t p) const   { return obj() == (oopDesc*)p; }
   bool operator!=(intptr_t p) const   { return obj() != (oopDesc*)p; }
@@ -126,7 +115,7 @@
   operator markOop () const           { return markOop(obj()); }
 
   operator address   () const         { return (address)obj(); }
-  operator intptr_t () const          { return (intptr_t)obj(); }
+  operator intptr_t () const volatile { return (intptr_t)obj(); }
 
   // from javaCalls.cpp
   operator jobject () const           { return (jobject)obj(); }
@@ -139,7 +128,7 @@
 #endif
 
   // from parNewGeneration and other things that want to get to the end of
-  // an oop for stuff (like constMethodKlass.cpp, objArrayKlass.cpp)
+  // an oop for stuff (like objArrayKlass.cpp)
   operator oop* () const              { return (oop *)obj(); }
 };
 
@@ -154,41 +143,37 @@
        type##OopDesc* operator->() const {                                 \
             return (type##OopDesc*)obj();                                  \
        }                                                                   \
-   };                                                                      \
+   };
 
 DEF_OOP(instance);
-DEF_OOP(method);
-DEF_OOP(methodData);
 DEF_OOP(array);
-DEF_OOP(constMethod);
-DEF_OOP(constantPool);
-DEF_OOP(constantPoolCache);
 DEF_OOP(objArray);
 DEF_OOP(typeArray);
-DEF_OOP(klass);
-DEF_OOP(compiledICHolder);
 
 #endif // CHECK_UNHANDLED_OOPS
 
+// The metadata hierarchy is separate from the oop hierarchy
+
+//      class MetaspaceObj
+class   ConstMethod;
+class   ConstantPoolCache;
+class   MethodData;
+//      class Metadata
+class   Method;
+class   ConstantPool;
+//      class CHeapObj
+class   CompiledICHolder;
+
+
 // The klass hierarchy is separate from the oop hierarchy.
 
 class Klass;
-class   instanceKlass;
+class   InstanceKlass;
 class     instanceMirrorKlass;
+class     instanceClassLoaderKlass;
 class     instanceRefKlass;
-class   methodKlass;
-class   constMethodKlass;
-class   methodDataKlass;
-class   klassKlass;
-class     instanceKlassKlass;
-class     arrayKlassKlass;
-class       objArrayKlassKlass;
-class       typeArrayKlassKlass;
 class   arrayKlass;
 class     objArrayKlass;
 class     typeArrayKlass;
-class   constantPoolKlass;
-class   constantPoolCacheKlass;
-class   compiledICHolderKlass;
 
 #endif // SHARE_VM_OOPS_OOPSHIERARCHY_HPP