src/share/vm/memory/allocation.hpp

Print this page
rev 3953 : JDK-8005012: Add WB APIs to better support NMT testing
Summary:


 128  * |                         |     type    |             |
 129  */
 130 enum MemoryType {
 131   // Memory type by sub systems. It occupies lower byte.
 132   mtNone              = 0x0000,  // undefined
 133   mtClass             = 0x0100,  // memory class for Java classes
 134   mtThread            = 0x0200,  // memory for thread objects
 135   mtThreadStack       = 0x0300,
 136   mtCode              = 0x0400,  // memory for generated code
 137   mtGC                = 0x0500,  // memory for GC
 138   mtCompiler          = 0x0600,  // memory for compiler
 139   mtInternal          = 0x0700,  // memory used by VM, but does not belong to
 140                                  // any of above categories, and not used for
 141                                  // native memory tracking
 142   mtOther             = 0x0800,  // memory not used by VM
 143   mtSymbol            = 0x0900,  // symbol
 144   mtNMT               = 0x0A00,  // memory used by native memory tracking
 145   mtChunk             = 0x0B00,  // chunk that holds content of arenas
 146   mtJavaHeap          = 0x0C00,  // Java heap
 147   mtClassShared       = 0x0D00,  // class data sharing
 148   mt_number_of_types  = 0x000D,  // number of memory types (mtDontTrack

 149                                  // is not included as validate type)
 150   mtDontTrack         = 0x0E00,  // memory we do not or cannot track
 151   mt_masks            = 0x7F00,
 152 
 153   // object type mask
 154   otArena             = 0x0010, // an arena object
 155   otNMTRecorder       = 0x0020, // memory recorder object
 156   ot_masks            = 0x00F0
 157 };
 158 
 159 #define IS_MEMORY_TYPE(flags, type) ((flags & mt_masks) == type)
 160 #define HAS_VALID_MEMORY_TYPE(flags)((flags & mt_masks) != mtNone)
 161 #define FLAGS_TO_MEMORY_TYPE(flags) (flags & mt_masks)
 162 
 163 #define IS_ARENA_OBJ(flags)         ((flags & ot_masks) == otArena)
 164 #define IS_NMT_RECORDER(flags)      ((flags & ot_masks) == otNMTRecorder)
 165 #define NMT_CAN_TRACK(flags)        (!IS_NMT_RECORDER(flags) && !(IS_MEMORY_TYPE(flags, mtDontTrack)))
 166 
 167 typedef unsigned short MEMFLAGS;
 168 
 169 #if INCLUDE_NMT
 170 




 128  * |                         |     type    |             |
 129  */
 130 enum MemoryType {
 131   // Memory type by sub systems. It occupies lower byte.
 132   mtNone              = 0x0000,  // undefined
 133   mtClass             = 0x0100,  // memory class for Java classes
 134   mtThread            = 0x0200,  // memory for thread objects
 135   mtThreadStack       = 0x0300,
 136   mtCode              = 0x0400,  // memory for generated code
 137   mtGC                = 0x0500,  // memory for GC
 138   mtCompiler          = 0x0600,  // memory for compiler
 139   mtInternal          = 0x0700,  // memory used by VM, but does not belong to
 140                                  // any of above categories, and not used for
 141                                  // native memory tracking
 142   mtOther             = 0x0800,  // memory not used by VM
 143   mtSymbol            = 0x0900,  // symbol
 144   mtNMT               = 0x0A00,  // memory used by native memory tracking
 145   mtChunk             = 0x0B00,  // chunk that holds content of arenas
 146   mtJavaHeap          = 0x0C00,  // Java heap
 147   mtClassShared       = 0x0D00,  // class data sharing
 148   mtTest              = 0x0E00,  // Test type for verifying NMT
 149   mt_number_of_types  = 0x000E,  // number of memory types (mtDontTrack
 150                                  // is not included as validate type)
 151   mtDontTrack         = 0x0F00,  // memory we do not or cannot track
 152   mt_masks            = 0x7F00,
 153 
 154   // object type mask
 155   otArena             = 0x0010, // an arena object
 156   otNMTRecorder       = 0x0020, // memory recorder object
 157   ot_masks            = 0x00F0
 158 };
 159 
 160 #define IS_MEMORY_TYPE(flags, type) ((flags & mt_masks) == type)
 161 #define HAS_VALID_MEMORY_TYPE(flags)((flags & mt_masks) != mtNone)
 162 #define FLAGS_TO_MEMORY_TYPE(flags) (flags & mt_masks)
 163 
 164 #define IS_ARENA_OBJ(flags)         ((flags & ot_masks) == otArena)
 165 #define IS_NMT_RECORDER(flags)      ((flags & ot_masks) == otNMTRecorder)
 166 #define NMT_CAN_TRACK(flags)        (!IS_NMT_RECORDER(flags) && !(IS_MEMORY_TYPE(flags, mtDontTrack)))
 167 
 168 typedef unsigned short MEMFLAGS;
 169 
 170 #if INCLUDE_NMT
 171