Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 4708:3c648b9ad052
7121373: Clean up CollectedHeap::is_in
Summary: Fixed G1CollectedHeap::is_in, added tests, cleaned up comments and made Space::is_in pure virtual.
Reviewed-by: brutisso, tonyp, jcoomes
author | stefank |
---|---|
date | Wed, 14 Dec 2011 12:15:26 +0100 |
parents | dc467e8b2c5e |
children | fd2b426c30db |
comparison
equal
deleted
inserted
replaced
4132:6d7d0790074d | 4708:3c648b9ad052 |
---|---|
2409 } | 2409 } |
2410 } | 2410 } |
2411 } | 2411 } |
2412 | 2412 |
2413 bool G1CollectedHeap::is_in(const void* p) const { | 2413 bool G1CollectedHeap::is_in(const void* p) const { |
2414 HeapRegion* hr = _hrs.addr_to_region((HeapWord*) p); | 2414 if (_g1_committed.contains(p)) { |
2415 if (hr != NULL) { | 2415 // Given that we know that p is in the committed space, |
2416 // heap_region_containing_raw() should successfully | |
2417 // return the containing region. | |
2418 HeapRegion* hr = heap_region_containing_raw(p); | |
2416 return hr->is_in(p); | 2419 return hr->is_in(p); |
2417 } else { | 2420 } else { |
2418 return _perm_gen->as_gen()->is_in(p); | 2421 return _perm_gen->as_gen()->is_in(p); |
2419 } | 2422 } |
2420 } | 2423 } |