mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-13 12:38:07 +00:00
8230853: Shenandoah: replace leftover assert(is_in(...)) with rich asserts
Reviewed-by: shade
This commit is contained in:
parent
9722dfc9bc
commit
d112950b5b
@ -80,8 +80,8 @@ public:
|
||||
|
||||
inline bool is_in(ShenandoahHeapRegion* r) const;
|
||||
inline bool is_in(size_t region_number) const;
|
||||
inline bool is_in(HeapWord* loc) const;
|
||||
inline bool is_in(oop obj) const;
|
||||
inline bool is_in_loc(void* loc) const;
|
||||
|
||||
void print_on(outputStream* out) const;
|
||||
|
||||
|
||||
@ -40,10 +40,11 @@ bool ShenandoahCollectionSet::is_in(ShenandoahHeapRegion* r) const {
|
||||
}
|
||||
|
||||
bool ShenandoahCollectionSet::is_in(oop p) const {
|
||||
return is_in(cast_from_oop<HeapWord*>(p));
|
||||
shenandoah_assert_in_heap(NULL, p);
|
||||
return is_in_loc(cast_from_oop<void*>(p));
|
||||
}
|
||||
|
||||
bool ShenandoahCollectionSet::is_in(HeapWord* p) const {
|
||||
bool ShenandoahCollectionSet::is_in_loc(void* p) const {
|
||||
assert(_heap->is_in(p), "Must be in the heap");
|
||||
uintx index = ((uintx) p) >> _region_size_bytes_shift;
|
||||
// no need to subtract the bottom of the heap from p,
|
||||
|
||||
@ -327,14 +327,12 @@ inline bool ShenandoahHeap::requires_marking(const void* entry) const {
|
||||
|
||||
inline bool ShenandoahHeap::in_collection_set(oop p) const {
|
||||
assert(collection_set() != NULL, "Sanity");
|
||||
assert(is_in(p), "should be in heap");
|
||||
return collection_set()->is_in(p);
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::in_collection_set_loc(void* p) const {
|
||||
assert(collection_set() != NULL, "Sanity");
|
||||
assert(is_in(p), "should be in heap");
|
||||
return collection_set()->is_in((HeapWord*)p);
|
||||
return collection_set()->is_in_loc(p);
|
||||
}
|
||||
|
||||
inline bool ShenandoahHeap::is_stable() const {
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONSET_INLINE_HPP
|
||||
#define SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONSET_INLINE_HPP
|
||||
|
||||
#include "gc/shenandoah/shenandoahAsserts.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.hpp"
|
||||
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
|
||||
@ -40,7 +41,7 @@ bool ShenandoahHeapRegionSet::is_in(ShenandoahHeapRegion* r) const {
|
||||
}
|
||||
|
||||
bool ShenandoahHeapRegionSet::is_in(oop p) const {
|
||||
assert(_heap->is_in(p), "Must be in the heap");
|
||||
shenandoah_assert_in_heap(NULL, p);
|
||||
uintx index = (cast_from_oop<uintx>(p)) >> _region_size_bytes_shift;
|
||||
// no need to subtract the bottom of the heap from p,
|
||||
// _biased_set_map is biased
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user