8332401: G1: TestFromCardCacheIndex.java with -XX:GCCardSizeInBytes=128 triggers underflow assertion
Reviewed-by: tschatzl, iwalulya
This commit is contained in:
parent
7ffc9997bd
commit
4e169d1ed7
@ -62,7 +62,8 @@ inline uint8_t* G1BlockOffsetTable::entry_for_addr(const void* const p) const {
|
||||
}
|
||||
|
||||
inline HeapWord* G1BlockOffsetTable::addr_for_entry(const uint8_t* const p) const {
|
||||
size_t delta = pointer_delta(p, _offset_base, sizeof(uint8_t));
|
||||
// _offset_base can be "negative", so can't use pointer_delta().
|
||||
size_t delta = p - _offset_base;
|
||||
HeapWord* result = (HeapWord*) (delta << CardTable::card_shift());
|
||||
assert(_reserved.contains(result),
|
||||
"out of bounds accessor from block offset table");
|
||||
|
@ -57,7 +57,8 @@ class ObjectStartArray : public CHeapObj<mtGC> {
|
||||
|
||||
// Mapping from object start array entry to address of first word
|
||||
HeapWord* addr_for_entry(const uint8_t* const p) const {
|
||||
size_t delta = pointer_delta(p, _offset_base, sizeof(uint8_t));
|
||||
// _offset_base can be "negative", so can't use pointer_delta().
|
||||
size_t delta = p - _offset_base;
|
||||
HeapWord* result = (HeapWord*) (delta << CardTable::card_shift());
|
||||
assert(_covered_region.contains(result),
|
||||
"out of bounds accessor from card marking array");
|
||||
|
@ -35,7 +35,8 @@ inline uint8_t* SerialBlockOffsetTable::entry_for_addr(const void* const p) cons
|
||||
}
|
||||
|
||||
inline HeapWord* SerialBlockOffsetTable::addr_for_entry(const uint8_t* const p) const {
|
||||
size_t delta = pointer_delta(p, _offset_base, sizeof(uint8_t));
|
||||
// _offset_base can be "negative", so can't use pointer_delta().
|
||||
size_t delta = p - _offset_base;
|
||||
HeapWord* result = (HeapWord*) (delta << CardTable::card_shift());
|
||||
assert(_reserved.contains(result),
|
||||
"out of bounds accessor from block offset array");
|
||||
|
Loading…
Reference in New Issue
Block a user