216
217
218 // Base class for objects stored in Metaspace.
219 // Calling delete will result in fatal error.
220 //
221 // Do not inherit from something with a vptr because this class does
222 // not introduce one. This class is used to allocate both shared read-only
223 // and shared read-write classes.
224 //
225
226 class ClassLoaderData;
227 class MetaspaceClosure;
228
229 class MetaspaceObj {
230 public:
231 bool is_metaspace_object() const;
232 bool is_shared() const;
233 void print_address_on(outputStream* st) const; // nonvirtual address printing
234
235 #define METASPACE_OBJ_TYPES_DO(f) \
236 f(Unknown) \
237 f(Class) \
238 f(Symbol) \
239 f(TypeArrayU1) \
240 f(TypeArrayU2) \
241 f(TypeArrayU4) \
242 f(TypeArrayU8) \
243 f(TypeArrayOther) \
244 f(Method) \
245 f(ConstMethod) \
246 f(MethodData) \
247 f(ConstantPool) \
248 f(ConstantPoolCache) \
249 f(Annotations) \
250 f(MethodCounters)
251
252 #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type,
253 #define METASPACE_OBJ_TYPE_NAME_CASE(name) case name ## Type: return #name;
254
255 enum Type {
256 // Types are MetaspaceObj::ClassType, MetaspaceObj::SymbolType, etc
|
216
217
218 // Base class for objects stored in Metaspace.
219 // Calling delete will result in fatal error.
220 //
221 // Do not inherit from something with a vptr because this class does
222 // not introduce one. This class is used to allocate both shared read-only
223 // and shared read-write classes.
224 //
225
226 class ClassLoaderData;
227 class MetaspaceClosure;
228
229 class MetaspaceObj {
230 public:
231 bool is_metaspace_object() const;
232 bool is_shared() const;
233 void print_address_on(outputStream* st) const; // nonvirtual address printing
234
235 #define METASPACE_OBJ_TYPES_DO(f) \
236 f(Class) \
237 f(Symbol) \
238 f(TypeArrayU1) \
239 f(TypeArrayU2) \
240 f(TypeArrayU4) \
241 f(TypeArrayU8) \
242 f(TypeArrayOther) \
243 f(Method) \
244 f(ConstMethod) \
245 f(MethodData) \
246 f(ConstantPool) \
247 f(ConstantPoolCache) \
248 f(Annotations) \
249 f(MethodCounters)
250
251 #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type,
252 #define METASPACE_OBJ_TYPE_NAME_CASE(name) case name ## Type: return #name;
253
254 enum Type {
255 // Types are MetaspaceObj::ClassType, MetaspaceObj::SymbolType, etc
|