< prev index next >

src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp

Print this page




  33 #include "gc/g1/g1StringDedupQueue.hpp"
  34 #include "gc/shared/preservedMarks.inline.hpp"
  35 #include "oops/access.inline.hpp"
  36 #include "oops/compressedOops.inline.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "utilities/debug.hpp"
  39 
  40 inline bool G1FullGCMarker::mark_object(oop obj) {
  41   // Not marking closed archive objects.
  42   if (G1ArchiveAllocator::is_closed_archive_object(obj)) {
  43     return false;
  44   }
  45 
  46   // Try to mark.
  47   if (!_bitmap->par_mark(obj)) {
  48     // Lost mark race.
  49     return false;
  50   }
  51 
  52   // Marked by us, preserve if needed.
  53   markWord mark = obj->mark_raw();
  54   if (obj->mark_must_be_preserved(mark) &&
  55       !G1ArchiveAllocator::is_open_archive_object(obj)) {
  56     preserved_stack()->push(obj, mark);
  57   }
  58 
  59   // Check if deduplicatable string.
  60   if (G1StringDedup::is_enabled()) {
  61     G1StringDedup::enqueue_from_mark(obj, _worker_id);
  62   }
  63   return true;
  64 }
  65 
  66 template <class T> inline void G1FullGCMarker::mark_and_push(T* p) {
  67   T heap_oop = RawAccess<>::oop_load(p);
  68   if (!CompressedOops::is_null(heap_oop)) {
  69     oop obj = CompressedOops::decode_not_null(heap_oop);
  70     if (mark_object(obj)) {
  71       _oop_stack.push(obj);
  72       assert(_bitmap->is_marked(obj), "Must be marked now - map self");
  73     } else {
  74       assert(_bitmap->is_marked(obj) || G1ArchiveAllocator::is_closed_archive_object(obj),




  33 #include "gc/g1/g1StringDedupQueue.hpp"
  34 #include "gc/shared/preservedMarks.inline.hpp"
  35 #include "oops/access.inline.hpp"
  36 #include "oops/compressedOops.inline.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "utilities/debug.hpp"
  39 
  40 inline bool G1FullGCMarker::mark_object(oop obj) {
  41   // Not marking closed archive objects.
  42   if (G1ArchiveAllocator::is_closed_archive_object(obj)) {
  43     return false;
  44   }
  45 
  46   // Try to mark.
  47   if (!_bitmap->par_mark(obj)) {
  48     // Lost mark race.
  49     return false;
  50   }
  51 
  52   // Marked by us, preserve if needed.
  53   markOop mark = obj->mark_raw();
  54   if (mark->must_be_preserved(obj) &&
  55       !G1ArchiveAllocator::is_open_archive_object(obj)) {
  56     preserved_stack()->push(obj, mark);
  57   }
  58 
  59   // Check if deduplicatable string.
  60   if (G1StringDedup::is_enabled()) {
  61     G1StringDedup::enqueue_from_mark(obj, _worker_id);
  62   }
  63   return true;
  64 }
  65 
  66 template <class T> inline void G1FullGCMarker::mark_and_push(T* p) {
  67   T heap_oop = RawAccess<>::oop_load(p);
  68   if (!CompressedOops::is_null(heap_oop)) {
  69     oop obj = CompressedOops::decode_not_null(heap_oop);
  70     if (mark_object(obj)) {
  71       _oop_stack.push(obj);
  72       assert(_bitmap->is_marked(obj), "Must be marked now - map self");
  73     } else {
  74       assert(_bitmap->is_marked(obj) || G1ArchiveAllocator::is_closed_archive_object(obj),


< prev index next >