8027553: Change the in_cset_fast_test functionality to use the G1BiasedArray abstraction

Instead of using a manually managed array for the in_cset_fast_test array, use a G1BiasedArray instance.

Reviewed-by: brutisso, mgerdin
This commit is contained in:
Thomas Schatzl 2014-04-16 10:55:26 +02:00
parent f8088df0b4
commit aa00878260
3 changed files with 20 additions and 57 deletions

View file

@ -164,12 +164,7 @@ inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
// collection set or not. Assume that the reference
// points into the heap.
inline bool G1CollectedHeap::in_cset_fast_test(oop obj) {
assert(_in_cset_fast_test != NULL, "sanity");
assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, (HeapWord*)obj));
// no need to subtract the bottom of the heap from obj,
// _in_cset_fast_test is biased
uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes;
bool ret = _in_cset_fast_test[index];
bool ret = _in_cset_fast_test.get_by_address((HeapWord*)obj);
// let's make sure the result is consistent with what the slower
// test returns
assert( ret || !obj_in_cs(obj), "sanity");