comparison src/share/vm/memory/universe.cpp @ 7176:59c790074993

8003635: NPG: AsynchGetCallTrace broken by Method* virtual call Summary: Make metaspace::contains be lock free and used to see if something is in metaspace, also compare Method* with vtbl pointer. Reviewed-by: dholmes, sspitsyn, dcubed, jmasa
author coleenp
date Wed, 28 Nov 2012 17:50:21 -0500
parents 80e866b1d053
children c24f778e9401
comparison
equal deleted inserted replaced
7175:b51dc8df86e5 7176:59c790074993
423 // CDS support for patching vtables in metadata in the shared archive. 423 // CDS support for patching vtables in metadata in the shared archive.
424 // All types inherited from Metadata have vtables, but not types inherited 424 // All types inherited from Metadata have vtables, but not types inherited
425 // from MetaspaceObj, because the latter does not have virtual functions. 425 // from MetaspaceObj, because the latter does not have virtual functions.
426 // If the metadata type has a vtable, it cannot be shared in the read-only 426 // If the metadata type has a vtable, it cannot be shared in the read-only
427 // section of the CDS archive, because the vtable pointer is patched. 427 // section of the CDS archive, because the vtable pointer is patched.
428 static inline void* dereference(void* addr) {
429 return *(void**)addr;
430 }
431
432 static inline void add_vtable(void** list, int* n, void* o, int count) { 428 static inline void add_vtable(void** list, int* n, void* o, int count) {
433 guarantee((*n) < count, "vtable list too small"); 429 guarantee((*n) < count, "vtable list too small");
434 void* vtable = dereference(o); 430 void* vtable = dereference_vptr(o);
435 assert(dereference(vtable) != NULL, "invalid vtable"); 431 assert(*(void**)(vtable) != NULL, "invalid vtable");
436 list[(*n)++] = vtable; 432 list[(*n)++] = vtable;
437 } 433 }
438 434
439 void Universe::init_self_patching_vtbl_list(void** list, int count) { 435 void Universe::init_self_patching_vtbl_list(void** list, int count) {
440 int n = 0; 436 int n = 0;