equal
deleted
inserted
replaced
162 |
162 |
163 // This is a fast test on whether a reference points into the |
163 // This is a fast test on whether a reference points into the |
164 // collection set or not. Assume that the reference |
164 // collection set or not. Assume that the reference |
165 // points into the heap. |
165 // points into the heap. |
166 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) { |
166 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) { |
167 assert(_in_cset_fast_test != NULL, "sanity"); |
167 bool ret = _in_cset_fast_test.get_by_address((HeapWord*)obj); |
168 assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, (HeapWord*)obj)); |
|
169 // no need to subtract the bottom of the heap from obj, |
|
170 // _in_cset_fast_test is biased |
|
171 uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes; |
|
172 bool ret = _in_cset_fast_test[index]; |
|
173 // let's make sure the result is consistent with what the slower |
168 // let's make sure the result is consistent with what the slower |
174 // test returns |
169 // test returns |
175 assert( ret || !obj_in_cs(obj), "sanity"); |
170 assert( ret || !obj_in_cs(obj), "sanity"); |
176 assert(!ret || obj_in_cs(obj), "sanity"); |
171 assert(!ret || obj_in_cs(obj), "sanity"); |
177 return ret; |
172 return ret; |