8003635: NPG: AsynchGetCallTrace broken by Method* virtual call

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
This commit is contained in:
Coleen Phillimore 2012-11-28 17:50:21 -05:00
parent 696ef20cb4
commit 6538c5134b
14 changed files with 60 additions and 80 deletions

View file

@ -425,14 +425,10 @@ void Universe::genesis(TRAPS) {
// from MetaspaceObj, because the latter does not have virtual functions.
// If the metadata type has a vtable, it cannot be shared in the read-only
// section of the CDS archive, because the vtable pointer is patched.
static inline void* dereference(void* addr) {
return *(void**)addr;
}
static inline void add_vtable(void** list, int* n, void* o, int count) {
guarantee((*n) < count, "vtable list too small");
void* vtable = dereference(o);
assert(dereference(vtable) != NULL, "invalid vtable");
void* vtable = dereference_vptr(o);
assert(*(void**)(vtable) != NULL, "invalid vtable");
list[(*n)++] = vtable;
}