280 inline bool ZPage::is_object_marked(zaddress addr, bool finalizable) const {
281 return finalizable ? is_object_marked_live(addr) : is_object_marked_strong(addr);
282 }
283
284 inline bool ZPage::mark_object(zaddress addr, bool finalizable, bool& inc_live) {
285 assert(is_relocatable(), "Invalid page state");
286 assert(is_in(addr), "Invalid address");
287
288 // Verify oop
289 assert_is_oop(addr);
290
291 // Set mark bit
292 const BitMap::idx_t index = bit_index(addr);
293 return _livemap.set(_generation_id, index, finalizable, inc_live);
294 }
295
296 inline void ZPage::inc_live(uint32_t objects, size_t bytes) {
297 _livemap.inc_live(objects, bytes);
298 }
299
300 #define assert_zpage_mark_state() \
301 do { \
302 assert(is_marked(), "Should be marked"); \
303 assert(!is_young() || !ZGeneration::young()->is_phase_mark(), "Wrong phase"); \
304 assert(!is_old() || !ZGeneration::old()->is_phase_mark(), "Wrong phase"); \
305 } while (0)
306
307 inline uint32_t ZPage::live_objects() const {
308 assert_zpage_mark_state();
309
310 return _livemap.live_objects();
311 }
312
313 inline size_t ZPage::live_bytes() const {
314 assert_zpage_mark_state();
315
316 return _livemap.live_bytes();
317 }
318
319 template <typename Function>
|
280 inline bool ZPage::is_object_marked(zaddress addr, bool finalizable) const {
281 return finalizable ? is_object_marked_live(addr) : is_object_marked_strong(addr);
282 }
283
284 inline bool ZPage::mark_object(zaddress addr, bool finalizable, bool& inc_live) {
285 assert(is_relocatable(), "Invalid page state");
286 assert(is_in(addr), "Invalid address");
287
288 // Verify oop
289 assert_is_oop(addr);
290
291 // Set mark bit
292 const BitMap::idx_t index = bit_index(addr);
293 return _livemap.set(_generation_id, index, finalizable, inc_live);
294 }
295
296 inline void ZPage::inc_live(uint32_t objects, size_t bytes) {
297 _livemap.inc_live(objects, bytes);
298 }
299
300 inline void ZPage::inc_will_expand(uint32_t objects) {
301 _livemap.inc_will_expand(objects);
302 }
303
304 #define assert_zpage_mark_state() \
305 do { \
306 assert(is_marked(), "Should be marked"); \
307 assert(!is_young() || !ZGeneration::young()->is_phase_mark(), "Wrong phase"); \
308 assert(!is_old() || !ZGeneration::old()->is_phase_mark(), "Wrong phase"); \
309 } while (0)
310
311 inline uint32_t ZPage::live_objects() const {
312 assert_zpage_mark_state();
313
314 return _livemap.live_objects();
315 }
316
317 inline size_t ZPage::live_bytes() const {
318 assert_zpage_mark_state();
319
320 return _livemap.live_bytes();
321 }
322
323 template <typename Function>
|