comparison src/share/vm/memory/allocation.hpp @ 11019:eaf3742822ec

Merge
author chegar
date Mon, 17 Jun 2013 11:17:49 +0100
parents ce9ecec70f99 a1ebd310d5c1
children 3a0774193f71
comparison
equal deleted inserted replaced
11018:0861193d358a 11019:eaf3742822ec
266 bool is_metadata() const; 266 bool is_metadata() const;
267 bool is_metaspace_object() const; // more specific test but slower 267 bool is_metaspace_object() const; // more specific test but slower
268 bool is_shared() const; 268 bool is_shared() const;
269 void print_address_on(outputStream* st) const; // nonvirtual address printing 269 void print_address_on(outputStream* st) const; // nonvirtual address printing
270 270
271 #define METASPACE_OBJ_TYPES_DO(f) \
272 f(Unknown) \
273 f(Class) \
274 f(Symbol) \
275 f(TypeArrayU1) \
276 f(TypeArrayU2) \
277 f(TypeArrayU4) \
278 f(TypeArrayU8) \
279 f(TypeArrayOther) \
280 f(Method) \
281 f(ConstMethod) \
282 f(MethodData) \
283 f(ConstantPool) \
284 f(ConstantPoolCache) \
285 f(Annotation) \
286 f(MethodCounters)
287
288 #define METASPACE_OBJ_TYPE_DECLARE(name) name ## Type,
289 #define METASPACE_OBJ_TYPE_NAME_CASE(name) case name ## Type: return #name;
290
291 enum Type {
292 // Types are MetaspaceObj::ClassType, MetaspaceObj::SymbolType, etc
293 METASPACE_OBJ_TYPES_DO(METASPACE_OBJ_TYPE_DECLARE)
294 _number_of_types
295 };
296
297 static const char * type_name(Type type) {
298 switch(type) {
299 METASPACE_OBJ_TYPES_DO(METASPACE_OBJ_TYPE_NAME_CASE)
300 default:
301 ShouldNotReachHere();
302 return NULL;
303 }
304 }
305
306 static MetaspaceObj::Type array_type(size_t elem_size) {
307 switch (elem_size) {
308 case 1: return TypeArrayU1Type;
309 case 2: return TypeArrayU2Type;
310 case 4: return TypeArrayU4Type;
311 case 8: return TypeArrayU8Type;
312 default:
313 return TypeArrayOtherType;
314 }
315 }
316
271 void* operator new(size_t size, ClassLoaderData* loader_data, 317 void* operator new(size_t size, ClassLoaderData* loader_data,
272 size_t word_size, bool read_only, Thread* thread); 318 size_t word_size, bool read_only,
319 Type type, Thread* thread);
273 // can't use TRAPS from this header file. 320 // can't use TRAPS from this header file.
274 void operator delete(void* p) { ShouldNotCallThis(); } 321 void operator delete(void* p) { ShouldNotCallThis(); }
275 }; 322 };
276 323
277 // Base class for classes that constitute name spaces. 324 // Base class for classes that constitute name spaces.