< prev index next >
src/hotspot/share/gc/z/zVerify.cpp
Print this page
rev 58099 : 8239492: [x86] Turn MacroAssembler::verify_oop into macro recording file and line
*** 34,53 ****
#include "memory/iterator.inline.hpp"
#include "oops/oop.hpp"
#define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, p2i(o), p2i(p)
! static void verify_oop(oop* p) {
const oop o = RawAccess<>::oop_load(p);
if (o != NULL) {
const uintptr_t addr = ZOop::to_address(o);
guarantee(ZAddress::is_good(addr), BAD_OOP_ARG(o, p));
guarantee(oopDesc::is_oop(ZOop::from_address(addr)), BAD_OOP_ARG(o, p));
}
}
! static void verify_possibly_weak_oop(oop* p) {
const oop o = RawAccess<>::oop_load(p);
if (o != NULL) {
const uintptr_t addr = ZOop::to_address(o);
guarantee(ZAddress::is_good(addr) || ZAddress::is_finalizable_good(addr), BAD_OOP_ARG(o, p));
guarantee(oopDesc::is_oop(ZOop::from_address(ZAddress::good(addr))), BAD_OOP_ARG(o, p));
--- 34,53 ----
#include "memory/iterator.inline.hpp"
#include "oops/oop.hpp"
#define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, p2i(o), p2i(p)
! static void z_verify_oop(oop* p) {
const oop o = RawAccess<>::oop_load(p);
if (o != NULL) {
const uintptr_t addr = ZOop::to_address(o);
guarantee(ZAddress::is_good(addr), BAD_OOP_ARG(o, p));
guarantee(oopDesc::is_oop(ZOop::from_address(addr)), BAD_OOP_ARG(o, p));
}
}
! static void z_verify_possibly_weak_oop(oop* p) {
const oop o = RawAccess<>::oop_load(p);
if (o != NULL) {
const uintptr_t addr = ZOop::to_address(o);
guarantee(ZAddress::is_good(addr) || ZAddress::is_finalizable_good(addr), BAD_OOP_ARG(o, p));
guarantee(oopDesc::is_oop(ZOop::from_address(ZAddress::good(addr))), BAD_OOP_ARG(o, p));
*** 55,65 ****
}
class ZVerifyRootClosure : public ZRootsIteratorClosure {
public:
virtual void do_oop(oop* p) {
! verify_oop(p);
}
virtual void do_oop(narrowOop*) {
ShouldNotReachHere();
}
--- 55,65 ----
}
class ZVerifyRootClosure : public ZRootsIteratorClosure {
public:
virtual void do_oop(oop* p) {
! z_verify_oop(p);
}
virtual void do_oop(narrowOop*) {
ShouldNotReachHere();
}
*** 74,88 ****
ClaimMetadataVisitingOopIterateClosure(ClassLoaderData::_claim_other),
_verify_weaks(verify_weaks) {}
virtual void do_oop(oop* p) {
if (_verify_weaks) {
! verify_possibly_weak_oop(p);
} else {
// We should never encounter finalizable oops through strong
// paths. This assumes we have only visited strong roots.
! verify_oop(p);
}
}
virtual void do_oop(narrowOop* p) {
ShouldNotReachHere();
--- 74,88 ----
ClaimMetadataVisitingOopIterateClosure(ClassLoaderData::_claim_other),
_verify_weaks(verify_weaks) {}
virtual void do_oop(oop* p) {
if (_verify_weaks) {
! z_verify_possibly_weak_oop(p);
} else {
// We should never encounter finalizable oops through strong
// paths. This assumes we have only visited strong roots.
! z_verify_oop(p);
}
}
virtual void do_oop(narrowOop* p) {
ShouldNotReachHere();
< prev index next >