331 // update logging post-barrier, we don't maintain remembered set
332 // information for young gen objects.
333 inline bool G1CollectedHeap::can_elide_initializing_store_barrier(oop new_obj) {
334 return is_in_young(new_obj);
335 }
336
337 inline bool G1CollectedHeap::is_obj_dead(const oop obj) const {
338 if (obj == NULL) {
339 return false;
340 }
341 return is_obj_dead(obj, heap_region_containing(obj));
342 }
343
344 inline bool G1CollectedHeap::is_obj_ill(const oop obj) const {
345 if (obj == NULL) {
346 return false;
347 }
348 return is_obj_ill(obj, heap_region_containing(obj));
349 }
350
351 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
352 uint region = addr_to_region((HeapWord*)obj);
353 // We not only set the "live" flag in the humongous_is_live table, but also
354 // reset the entry in the _in_cset_fast_test table so that subsequent references
355 // to the same humongous object do not go into the slow path again.
356 // This is racy, as multiple threads may at the same time enter here, but this
357 // is benign.
358 // During collection we only ever set the "live" flag, and only ever clear the
359 // entry in the in_cset_fast_table.
360 // We only ever evaluate the contents of these tables (in the VM thread) after
361 // having synchronized the worker threads with the VM thread, or in the same
362 // thread (i.e. within the VM thread).
363 if (!_humongous_is_live.is_live(region)) {
364 _humongous_is_live.set_live(region);
365 _in_cset_fast_test.clear_humongous(region);
366 }
367 }
368
369 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
|
331 // update logging post-barrier, we don't maintain remembered set
332 // information for young gen objects.
333 inline bool G1CollectedHeap::can_elide_initializing_store_barrier(oop new_obj) {
334 return is_in_young(new_obj);
335 }
336
337 inline bool G1CollectedHeap::is_obj_dead(const oop obj) const {
338 if (obj == NULL) {
339 return false;
340 }
341 return is_obj_dead(obj, heap_region_containing(obj));
342 }
343
344 inline bool G1CollectedHeap::is_obj_ill(const oop obj) const {
345 if (obj == NULL) {
346 return false;
347 }
348 return is_obj_ill(obj, heap_region_containing(obj));
349 }
350
351 inline void G1CollectedHeap::set_humongous_reclaim_candidate(uint region, bool value) {
352 assert(_hrm.at(region)->startsHumongous(), "Must start a humongous object");
353 _humongous_reclaim_candidates.set_candidate(region, value);
354 }
355
356 inline bool G1CollectedHeap::is_humongous_reclaim_candidate(uint region) {
357 assert(_hrm.at(region)->startsHumongous(), "Must start a humongous object");
358 return _humongous_reclaim_candidates.is_candidate(region);
359 }
360
361 inline void G1CollectedHeap::set_humongous_is_live(oop obj) {
362 uint region = addr_to_region((HeapWord*)obj);
363 // Clear the flag in the humongous_reclaim_candidates table. Also
364 // reset the entry in the _in_cset_fast_test table so that subsequent references
365 // to the same humongous object do not go into the slow path again.
366 // This is racy, as multiple threads may at the same time enter here, but this
367 // is benign.
368 // During collection we only ever clear the "candidate" flag, and only ever clear the
369 // entry in the in_cset_fast_table.
370 // We only ever evaluate the contents of these tables (in the VM thread) after
371 // having synchronized the worker threads with the VM thread, or in the same
372 // thread (i.e. within the VM thread).
373 if (is_humongous_reclaim_candidate(region)) {
374 set_humongous_reclaim_candidate(region, false);
375 _in_cset_fast_test.clear_humongous(region);
376 }
377 }
378
379 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1COLLECTEDHEAP_INLINE_HPP
|