Skip to content

Commit

Permalink
Remove assert macros
Browse files Browse the repository at this point in the history
  • Loading branch information
stefank committed Oct 22, 2020
1 parent 7ff6412 commit cac794c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/hotspot/share/gc/shared/collectedHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,4 @@ class GCCauseSetter : StackObj {
}
};

#define assert_object_is_in_heap(obj) \
assert(Universe::heap()->is_in(obj), \
"object not in heap " PTR_FORMAT, \
p2i(obj))

#define assert_object_is_in_heap_or_null(obj) \
debug_only(if (obj != NULL)) assert_object_is_in_heap(obj)

#endif // SHARE_GC_SHARED_COLLECTEDHEAP_HPP
6 changes: 3 additions & 3 deletions src/hotspot/share/oops/compressedOops.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ inline oop CompressedOops::decode_not_null(narrowOop v) {
assert(!is_null(v), "narrow oop value can never be zero");
oop result = decode_raw(v);
assert(is_object_aligned(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result));
assert_object_is_in_heap(result);
assert(Universe::heap()->is_in(result), "object not in heap " PTR_FORMAT, p2i((void*) result));
return result;
}

Expand All @@ -78,12 +78,12 @@ inline narrowOop CompressedOops::encode(oop v) {
}

inline oop CompressedOops::decode_not_null(oop v) {
assert_object_is_in_heap(v);
assert(Universe::heap()->is_in(v), "object not in heap " PTR_FORMAT, p2i((void*) v));
return v;
}

inline oop CompressedOops::decode(oop v) {
assert_object_is_in_heap_or_null(v);
assert(Universe::heap()->is_in_or_null(v), "object not in heap " PTR_FORMAT, p2i((void*) v));
return v;
}

Expand Down

0 comments on commit cac794c

Please sign in to comment.