32 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
33 #include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
34 #include "gc/shenandoah/shenandoahForwarding.inline.hpp"
35 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
36 #include "gc/shenandoah/shenandoahHeap.hpp"
37 #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
38 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
39 #include "gc/shenandoah/shenandoahControlThread.hpp"
40 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
41 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
42 #include "oops/compressedOops.inline.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/atomic.hpp"
45 #include "runtime/prefetch.inline.hpp"
46 #include "runtime/thread.hpp"
47 #include "utilities/copy.hpp"
48 #include "utilities/globalDefinitions.hpp"
49
50
51 inline ShenandoahHeapRegion* ShenandoahRegionIterator::next() {
52 size_t new_index = Atomic::add((size_t) 1, &_index);
53 // get_region() provides the bounds-check and returns NULL on OOB.
54 return _heap->get_region(new_index - 1);
55 }
56
57 inline bool ShenandoahHeap::has_forwarded_objects() const {
58 return _gc_state.is_set(HAS_FORWARDED);
59 }
60
61 inline WorkGang* ShenandoahHeap::workers() const {
62 return _workers;
63 }
64
65 inline WorkGang* ShenandoahHeap::get_safepoint_workers() {
66 return _safepoint_workers;
67 }
68
69 inline size_t ShenandoahHeap::heap_region_index_containing(const void* addr) const {
70 uintptr_t region_start = ((uintptr_t) addr);
71 uintptr_t index = (region_start - (uintptr_t) base()) >> ShenandoahHeapRegion::region_size_bytes_shift();
72 assert(index < num_regions(), "Region index is in bounds: " PTR_FORMAT, p2i(addr));
|
32 #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp"
33 #include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
34 #include "gc/shenandoah/shenandoahForwarding.inline.hpp"
35 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
36 #include "gc/shenandoah/shenandoahHeap.hpp"
37 #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
38 #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp"
39 #include "gc/shenandoah/shenandoahControlThread.hpp"
40 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
41 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
42 #include "oops/compressedOops.inline.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/atomic.hpp"
45 #include "runtime/prefetch.inline.hpp"
46 #include "runtime/thread.hpp"
47 #include "utilities/copy.hpp"
48 #include "utilities/globalDefinitions.hpp"
49
50
51 inline ShenandoahHeapRegion* ShenandoahRegionIterator::next() {
52 size_t new_index = Atomic::add(&_index, (size_t) 1);
53 // get_region() provides the bounds-check and returns NULL on OOB.
54 return _heap->get_region(new_index - 1);
55 }
56
57 inline bool ShenandoahHeap::has_forwarded_objects() const {
58 return _gc_state.is_set(HAS_FORWARDED);
59 }
60
61 inline WorkGang* ShenandoahHeap::workers() const {
62 return _workers;
63 }
64
65 inline WorkGang* ShenandoahHeap::get_safepoint_workers() {
66 return _safepoint_workers;
67 }
68
69 inline size_t ShenandoahHeap::heap_region_index_containing(const void* addr) const {
70 uintptr_t region_start = ((uintptr_t) addr);
71 uintptr_t index = (region_start - (uintptr_t) base()) >> ShenandoahHeapRegion::region_size_bytes_shift();
72 assert(index < num_regions(), "Region index is in bounds: " PTR_FORMAT, p2i(addr));
|