hotspot/src/share/vm/utilities/globalDefinitions.hpp
changeset 13728 882756847a04
parent 12779 06778de5193e
child 13969 d2a189b83b87
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri Aug 31 16:39:35 2012 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Sat Sep 01 13:25:18 2012 -0400
@@ -128,6 +128,14 @@
 #endif
 };
 
+// Analogous opaque struct for metadata allocated from
+// metaspaces.
+class MetaWord {
+  friend class VMStructs;
+ private:
+  char* i;
+};
+
 // HeapWordSize must be 2^LogHeapWordSize.
 const int HeapWordSize        = sizeof(HeapWord);
 #ifdef _LP64
@@ -272,6 +280,10 @@
 inline size_t pointer_delta(const HeapWord* left, const HeapWord* right) {
   return pointer_delta(left, right, sizeof(HeapWord));
 }
+// A version specialized for MetaWord*'s.
+inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) {
+  return pointer_delta(left, right, sizeof(MetaWord));
+}
 
 //
 // ANSI C++ does not allow casting from one pointer type to a function pointer
@@ -482,7 +494,8 @@
   T_VOID     = 14,
   T_ADDRESS  = 15,
   T_NARROWOOP= 16,
-  T_CONFLICT = 17, // for stack value type with conflicting contents
+  T_METADATA = 17,
+  T_CONFLICT = 18, // for stack value type with conflicting contents
   T_ILLEGAL  = 99
 };
 
@@ -854,6 +867,7 @@
 class JavaCallWrapper;
 
 class   oopDesc;
+class   metaDataOopDesc;
 
 class NativeCall;
 
@@ -911,6 +925,7 @@
 const int      uninitBlockPad   = 0xF1;                     // value used to zap newly malloc'd blocks.
 const intptr_t badJNIHandleVal  = (intptr_t) CONST64(0xFEFEFEFEFEFEFEFE); // value used to zap jni handle area
 const juint    badHeapWordVal   = 0xBAADBABE;               // value used to zap heap after GC
+const juint    badMetaWordVal   = 0xBAADFADE;               // value used to zap metadata heap after GC
 const int      badCodeHeapNewVal= 0xCC;                     // value used to zap Code heap at allocation
 const int      badCodeHeapFreeVal = 0xDD;                   // value used to zap Code heap at deallocation