701 bool in_cset_fast_test(oop obj) { |
701 bool in_cset_fast_test(oop obj) { |
702 assert(_in_cset_fast_test != NULL, "sanity"); |
702 assert(_in_cset_fast_test != NULL, "sanity"); |
703 if (_g1_committed.contains((HeapWord*) obj)) { |
703 if (_g1_committed.contains((HeapWord*) obj)) { |
704 // no need to subtract the bottom of the heap from obj, |
704 // no need to subtract the bottom of the heap from obj, |
705 // _in_cset_fast_test is biased |
705 // _in_cset_fast_test is biased |
706 uintx index = (uintx) obj >> HeapRegion::LogOfHRGrainBytes; |
706 uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes; |
707 bool ret = _in_cset_fast_test[index]; |
707 bool ret = _in_cset_fast_test[index]; |
708 // let's make sure the result is consistent with what the slower |
708 // let's make sure the result is consistent with what the slower |
709 // test returns |
709 // test returns |
710 assert( ret || !obj_in_cs(obj), "sanity"); |
710 assert( ret || !obj_in_cs(obj), "sanity"); |
711 assert(!ret || obj_in_cs(obj), "sanity"); |
711 assert(!ret || obj_in_cs(obj), "sanity"); |