Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @ 20212:d7e2d5f2846b
8027553: Change the in_cset_fast_test functionality to use the G1BiasedArray abstraction
Summary: Instead of using a manually managed array for the in_cset_fast_test array, use a G1BiasedArray instance.
Reviewed-by: brutisso, mgerdin
author | tschatzl |
---|---|
date | Mon, 21 Jul 2014 09:40:19 +0200 |
parents | ce8f6bb717c9 |
children | b0c374311c4e |
comparison
equal
deleted
inserted
replaced
20211:82693fb204a5 | 20212:d7e2d5f2846b |
---|---|
176 | 176 |
177 // This is a fast test on whether a reference points into the | 177 // This is a fast test on whether a reference points into the |
178 // collection set or not. Assume that the reference | 178 // collection set or not. Assume that the reference |
179 // points into the heap. | 179 // points into the heap. |
180 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) { | 180 inline bool G1CollectedHeap::in_cset_fast_test(oop obj) { |
181 assert(_in_cset_fast_test != NULL, "sanity"); | 181 bool ret = _in_cset_fast_test.get_by_address((HeapWord*)obj); |
182 assert(_g1_committed.contains((HeapWord*) obj), err_msg("Given reference outside of heap, is "PTR_FORMAT, p2i((HeapWord*)obj))); | |
183 // no need to subtract the bottom of the heap from obj, | |
184 // _in_cset_fast_test is biased | |
185 uintx index = cast_from_oop<uintx>(obj) >> HeapRegion::LogOfHRGrainBytes; | |
186 bool ret = _in_cset_fast_test[index]; | |
187 // let's make sure the result is consistent with what the slower | 182 // let's make sure the result is consistent with what the slower |
188 // test returns | 183 // test returns |
189 assert( ret || !obj_in_cs(obj), "sanity"); | 184 assert( ret || !obj_in_cs(obj), "sanity"); |
190 assert(!ret || obj_in_cs(obj), "sanity"); | 185 assert(!ret || obj_in_cs(obj), "sanity"); |
191 return ret; | 186 return ret; |