comparison src/share/vm/gc_implementation/g1/heapRegionSeq.inline.hpp @ 20335:eec72fa4b108

8040722: G1: Clean up usages of heap_region_containing Reviewed-by: tschatzl, jmasa
author brutisso
date Tue, 19 Aug 2014 12:39:06 +0200
parents 78bbf4d43a14
children 6701abbc4441
comparison
equal deleted inserted replaced
20334:ff3169f25621 20335:eec72fa4b108
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGIONSEQ_INLINE_HPP
27 27
28 #include "gc_implementation/g1/heapRegion.hpp" 28 #include "gc_implementation/g1/heapRegion.hpp"
29 #include "gc_implementation/g1/heapRegionSeq.hpp" 29 #include "gc_implementation/g1/heapRegionSeq.hpp"
30 30
31 inline HeapRegion* HeapRegionSeq::addr_to_region_unsafe(HeapWord* addr) const { 31 inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
32 assert(addr < heap_end(),
33 err_msg("addr: "PTR_FORMAT" end: "PTR_FORMAT, p2i(addr), p2i(heap_end())));
34 assert(addr >= heap_bottom(),
35 err_msg("addr: "PTR_FORMAT" bottom: "PTR_FORMAT, p2i(addr), p2i(heap_bottom())));
36
32 HeapRegion* hr = _regions.get_by_address(addr); 37 HeapRegion* hr = _regions.get_by_address(addr);
33 assert(hr != NULL, "invariant"); 38 assert(hr != NULL, "invariant");
34 return hr; 39 return hr;
35 }
36
37 inline HeapRegion* HeapRegionSeq::addr_to_region(HeapWord* addr) const {
38 if (addr != NULL && addr < heap_end()) {
39 assert(addr >= heap_bottom(),
40 err_msg("addr: " PTR_FORMAT " bottom: " PTR_FORMAT, p2i(addr), p2i(heap_bottom())));
41 return addr_to_region_unsafe(addr);
42 }
43 return NULL;
44 } 40 }
45 41
46 inline HeapRegion* HeapRegionSeq::at(uint index) const { 42 inline HeapRegion* HeapRegionSeq::at(uint index) const {
47 assert(index < length(), "pre-condition"); 43 assert(index < length(), "pre-condition");
48 HeapRegion* hr = _regions.get_by_index(index); 44 HeapRegion* hr = _regions.get_by_index(index);