comparison src/share/vm/utilities/globalDefinitions.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 5c8bd7c16119
children 8e47bac5643a
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
126 public: 126 public:
127 char* value() { return i; } 127 char* value() { return i; }
128 #endif 128 #endif
129 }; 129 };
130 130
131 // Analogous opaque struct for metadata allocated from
132 // metaspaces.
133 class MetaWord {
134 friend class VMStructs;
135 private:
136 char* i;
137 };
138
131 // HeapWordSize must be 2^LogHeapWordSize. 139 // HeapWordSize must be 2^LogHeapWordSize.
132 const int HeapWordSize = sizeof(HeapWord); 140 const int HeapWordSize = sizeof(HeapWord);
133 #ifdef _LP64 141 #ifdef _LP64
134 const int LogHeapWordSize = 3; 142 const int LogHeapWordSize = 3;
135 #else 143 #else
270 } 278 }
271 // A version specialized for HeapWord*'s. 279 // A version specialized for HeapWord*'s.
272 inline size_t pointer_delta(const HeapWord* left, const HeapWord* right) { 280 inline size_t pointer_delta(const HeapWord* left, const HeapWord* right) {
273 return pointer_delta(left, right, sizeof(HeapWord)); 281 return pointer_delta(left, right, sizeof(HeapWord));
274 } 282 }
283 // A version specialized for MetaWord*'s.
284 inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) {
285 return pointer_delta(left, right, sizeof(MetaWord));
286 }
275 287
276 // 288 //
277 // ANSI C++ does not allow casting from one pointer type to a function pointer 289 // ANSI C++ does not allow casting from one pointer type to a function pointer
278 // directly without at best a warning. This macro accomplishes it silently 290 // directly without at best a warning. This macro accomplishes it silently
279 // In every case that is present at this point the value be cast is a pointer 291 // In every case that is present at this point the value be cast is a pointer
480 T_OBJECT = 12, 492 T_OBJECT = 12,
481 T_ARRAY = 13, 493 T_ARRAY = 13,
482 T_VOID = 14, 494 T_VOID = 14,
483 T_ADDRESS = 15, 495 T_ADDRESS = 15,
484 T_NARROWOOP= 16, 496 T_NARROWOOP= 16,
485 T_CONFLICT = 17, // for stack value type with conflicting contents 497 T_METADATA = 17,
498 T_CONFLICT = 18, // for stack value type with conflicting contents
486 T_ILLEGAL = 99 499 T_ILLEGAL = 99
487 }; 500 };
488 501
489 inline bool is_java_primitive(BasicType t) { 502 inline bool is_java_primitive(BasicType t) {
490 return T_BOOLEAN <= t && t <= T_LONG; 503 return T_BOOLEAN <= t && t <= T_LONG;
852 class PeriodicTask; 865 class PeriodicTask;
853 866
854 class JavaCallWrapper; 867 class JavaCallWrapper;
855 868
856 class oopDesc; 869 class oopDesc;
870 class metaDataOopDesc;
857 871
858 class NativeCall; 872 class NativeCall;
859 873
860 class zone; 874 class zone;
861 875
909 const int badResourceValue = 0xAB; // value used to zap resource area 923 const int badResourceValue = 0xAB; // value used to zap resource area
910 const int freeBlockPad = 0xBA; // value used to pad freed blocks. 924 const int freeBlockPad = 0xBA; // value used to pad freed blocks.
911 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks. 925 const int uninitBlockPad = 0xF1; // value used to zap newly malloc'd blocks.
912 const intptr_t badJNIHandleVal = (intptr_t) CONST64(0xFEFEFEFEFEFEFEFE); // value used to zap jni handle area 926 const intptr_t badJNIHandleVal = (intptr_t) CONST64(0xFEFEFEFEFEFEFEFE); // value used to zap jni handle area
913 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC 927 const juint badHeapWordVal = 0xBAADBABE; // value used to zap heap after GC
928 const juint badMetaWordVal = 0xBAADFADE; // value used to zap metadata heap after GC
914 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation 929 const int badCodeHeapNewVal= 0xCC; // value used to zap Code heap at allocation
915 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation 930 const int badCodeHeapFreeVal = 0xDD; // value used to zap Code heap at deallocation
916 931
917 932
918 // (These must be implemented as #defines because C++ compilers are 933 // (These must be implemented as #defines because C++ compilers are