8229437: assert(is_aligned(ref, HeapWordSize)) failed: invariant
Reviewed-by: egahlin
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp b/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
index 7a9d80e..d14d679 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp
@@ -230,8 +230,6 @@
void BFSClosure::do_root(const oop* ref) {
assert(ref != NULL, "invariant");
- assert(is_aligned(ref, HeapWordSize), "invariant");
- assert(*ref != NULL, "invariant");
if (!_edge_queue->is_full()) {
_edge_queue->add(NULL, ref);
}
diff --git a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
index abfd305..b1a1fca 100644
--- a/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
+++ b/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp
@@ -178,8 +178,7 @@
void DFSClosure::do_root(const oop* ref) {
assert(ref != NULL, "invariant");
- assert(is_aligned(ref, HeapWordSize), "invariant");
- const oop pointee = *ref;
+ const oop pointee = UnifiedOop::dereference(ref);
assert(pointee != NULL, "invariant");
closure_impl(ref, pointee);
}