51
52 #ifdef ASSERT
53 int _mem_protection_level;
54 #endif
55
56 public:
57 ShenandoahHeapRegion(ShenandoahHeap* heap, HeapWord* start, size_t regionSize, size_t index);
58
59 static void setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size);
60
61 inline static size_t region_size_bytes() {
62 return ShenandoahHeapRegion::RegionSizeBytes;
63 }
64
65 inline static size_t region_size_shift() {
66 return ShenandoahHeapRegion::RegionSizeShift;
67 }
68
69 // Convert to jint with sanity checking
70 inline static jint region_size_bytes_jint() {
71 assert (ShenandoahHeapRegion::RegionSizeBytes <= max_jint, "sanity");
72 return (jint)ShenandoahHeapRegion::RegionSizeBytes;
73 }
74
75 // Convert to jint with sanity checking
76 inline static jint region_size_shift_jint() {
77 assert (ShenandoahHeapRegion::RegionSizeShift <= max_jint, "sanity");
78 return (jint)ShenandoahHeapRegion::RegionSizeShift;
79 }
80
81 size_t region_number() const;
82
83 // Roll back the previous allocation of an object with specified size.
84 // Returns TRUE when successful, FALSE if not successful or not supported.
85 bool rollback_allocation(uint size);
86
87 void clear_live_data();
88 void set_live_data(size_t s);
89 inline void increase_live_data_words(size_t s);
90 inline void increase_live_data_words(jint s);
91
92 void set_recently_allocated(bool value);
93 bool is_recently_allocated() const;
94
95 bool has_live() const;
96 size_t get_live_data_bytes() const;
97 size_t get_live_data_words() const;
|
51
52 #ifdef ASSERT
53 int _mem_protection_level;
54 #endif
55
56 public:
57 ShenandoahHeapRegion(ShenandoahHeap* heap, HeapWord* start, size_t regionSize, size_t index);
58
59 static void setup_heap_region_size(size_t initial_heap_size, size_t max_heap_size);
60
61 inline static size_t region_size_bytes() {
62 return ShenandoahHeapRegion::RegionSizeBytes;
63 }
64
65 inline static size_t region_size_shift() {
66 return ShenandoahHeapRegion::RegionSizeShift;
67 }
68
69 // Convert to jint with sanity checking
70 inline static jint region_size_bytes_jint() {
71 assert (ShenandoahHeapRegion::RegionSizeBytes <= (size_t)max_jint, "sanity");
72 return (jint)ShenandoahHeapRegion::RegionSizeBytes;
73 }
74
75 // Convert to jint with sanity checking
76 inline static jint region_size_shift_jint() {
77 assert (ShenandoahHeapRegion::RegionSizeShift <= (size_t)max_jint, "sanity");
78 return (jint)ShenandoahHeapRegion::RegionSizeShift;
79 }
80
81 size_t region_number() const;
82
83 // Roll back the previous allocation of an object with specified size.
84 // Returns TRUE when successful, FALSE if not successful or not supported.
85 bool rollback_allocation(uint size);
86
87 void clear_live_data();
88 void set_live_data(size_t s);
89 inline void increase_live_data_words(size_t s);
90 inline void increase_live_data_words(jint s);
91
92 void set_recently_allocated(bool value);
93 bool is_recently_allocated() const;
94
95 bool has_live() const;
96 size_t get_live_data_bytes() const;
97 size_t get_live_data_words() const;
|