aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/memory/space.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/memory/space.cpp')
-rw-r--r--src/share/vm/memory/space.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/share/vm/memory/space.cpp b/src/share/vm/memory/space.cpp
index b4fe565fd..7f9647f2e 100644
--- a/src/share/vm/memory/space.cpp
+++ b/src/share/vm/memory/space.cpp
@@ -790,7 +790,9 @@ ALL_SINCE_SAVE_MARKS_CLOSURES(ContigSpace_OOP_SINCE_SAVE_MARKS_DEFN)
// Very general, slow implementation.
HeapWord* ContiguousSpace::block_start_const(const void* p) const {
- assert(MemRegion(bottom(), end()).contains(p), "p not in space");
+ assert(MemRegion(bottom(), end()).contains(p),
+ err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
+ p, bottom(), end()));
if (p >= top()) {
return top();
} else {
@@ -800,19 +802,27 @@ HeapWord* ContiguousSpace::block_start_const(const void* p) const {
last = cur;
cur += oop(cur)->size();
}
- assert(oop(last)->is_oop(), "Should be an object start");
+ assert(oop(last)->is_oop(),
+ err_msg(PTR_FORMAT " should be an object start", last));
return last;
}
}
size_t ContiguousSpace::block_size(const HeapWord* p) const {
- assert(MemRegion(bottom(), end()).contains(p), "p not in space");
+ assert(MemRegion(bottom(), end()).contains(p),
+ err_msg("p (" PTR_FORMAT ") not in space [" PTR_FORMAT ", " PTR_FORMAT ")",
+ p, bottom(), end()));
HeapWord* current_top = top();
- assert(p <= current_top, "p is not a block start");
- assert(p == current_top || oop(p)->is_oop(), "p is not a block start");
- if (p < current_top)
+ assert(p <= current_top,
+ err_msg("p > current top - p: " PTR_FORMAT ", current top: " PTR_FORMAT,
+ p, current_top));
+ assert(p == current_top || oop(p)->is_oop(),
+ err_msg("p (" PTR_FORMAT ") is not a block start - "
+ "current_top: " PTR_FORMAT ", is_oop: %s",
+ p, current_top, BOOL_TO_STR(oop(p)->is_oop())));
+ if (p < current_top) {
return oop(p)->size();
- else {
+ } else {
assert(p == current_top, "just checking");
return pointer_delta(end(), (HeapWord*) p);
}