266 // Returns true if the pointer points to a valid MetaspaceObj. A valid 267 // MetaspaceObj is MetaWord-aligned and contained within either 268 // non-shared or shared metaspace. 269 static bool is_valid(const MetaspaceObj* p); 270 271 static bool is_shared(const MetaspaceObj* p) { 272 // If no shared metaspace regions are mapped, _shared_metaspace_{base,top} will 273 // both be NULL and all values of p will be rejected quickly. 274 return (((void*)p) < _shared_metaspace_top && 275 ((void*)p) >= _shared_metaspace_base); 276 } 277 bool is_shared() const { return MetaspaceObj::is_shared(this); } 278 279 void print_address_on(outputStream* st) const; // nonvirtual address printing 280 281 static void set_shared_metaspace_range(void* base, void* top) { 282 _shared_metaspace_base = base; 283 _shared_metaspace_top = top; 284 } 285 286 static void expand_shared_metaspace_range(void* top) { 287 assert(top >= _shared_metaspace_top, "must be"); 288 _shared_metaspace_top = top; 289 } 290 291 static void* shared_metaspace_base() { return _shared_metaspace_base; } 292 static void* shared_metaspace_top() { return _shared_metaspace_top; } 293 294 #define METASPACE_OBJ_TYPES_DO(f) \ 295 f(Class) \ 296 f(Symbol) \ 297 f(TypeArrayU1) \ 298 f(TypeArrayU2) \ 299 f(TypeArrayU4) \ 300 f(TypeArrayU8) \ 301 f(TypeArrayOther) \ 302 f(Method) \ 303 f(ConstMethod) \ 304 f(MethodData) \ 305 f(ConstantPool) \ 306 f(ConstantPoolCache) \ 307 f(Annotations) \ 308 f(MethodCounters) 309 310 #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type, | 266 // Returns true if the pointer points to a valid MetaspaceObj. A valid 267 // MetaspaceObj is MetaWord-aligned and contained within either 268 // non-shared or shared metaspace. 269 static bool is_valid(const MetaspaceObj* p); 270 271 static bool is_shared(const MetaspaceObj* p) { 272 // If no shared metaspace regions are mapped, _shared_metaspace_{base,top} will 273 // both be NULL and all values of p will be rejected quickly. 274 return (((void*)p) < _shared_metaspace_top && 275 ((void*)p) >= _shared_metaspace_base); 276 } 277 bool is_shared() const { return MetaspaceObj::is_shared(this); } 278 279 void print_address_on(outputStream* st) const; // nonvirtual address printing 280 281 static void set_shared_metaspace_range(void* base, void* top) { 282 _shared_metaspace_base = base; 283 _shared_metaspace_top = top; 284 } 285 286 static void* shared_metaspace_base() { return _shared_metaspace_base; } 287 static void* shared_metaspace_top() { return _shared_metaspace_top; } 288 289 #define METASPACE_OBJ_TYPES_DO(f) \ 290 f(Class) \ 291 f(Symbol) \ 292 f(TypeArrayU1) \ 293 f(TypeArrayU2) \ 294 f(TypeArrayU4) \ 295 f(TypeArrayU8) \ 296 f(TypeArrayOther) \ 297 f(Method) \ 298 f(ConstMethod) \ 299 f(MethodData) \ 300 f(ConstantPool) \ 301 f(ConstantPoolCache) \ 302 f(Annotations) \ 303 f(MethodCounters) 304 305 #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type, |