< prev index next >

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

Print this page




  60 inline void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) {
  61   _marker->follow_cld(cld);
  62 }
  63 
  64 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
  65   T heap_oop = RawAccess<>::oop_load(p);
  66   if (CompressedOops::is_null(heap_oop)) {
  67     return;
  68   }
  69 
  70   oop obj = CompressedOops::decode_not_null(heap_oop);
  71   assert(Universe::heap()->is_in(obj), "should be in heap");
  72   if (G1ArchiveAllocator::is_archived_object(obj)) {
  73     // We never forward archive objects.
  74     return;
  75   }
  76 
  77   oop forwardee = obj->forwardee();
  78   if (forwardee == NULL) {
  79     // Not forwarded, return current reference.
  80     assert(obj->mark_raw() == markWord::prototype_for_klass(obj->klass()) || // Correct mark
  81            obj->mark_must_be_preserved() || // Will be restored by PreservedMarksSet
  82            (UseBiasedLocking && obj->has_bias_pattern_raw()), // Will be restored by BiasedLocking
  83            "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
  84            p2i(obj), obj->mark_raw().value(), markWord::prototype_for_klass(obj->klass()).value());
  85     return;
  86   }
  87 
  88   // Forwarded, just update.
  89   assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
  90   RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
  91 }
  92 
  93 inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
  94 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
  95 
  96 inline bool G1IsAliveClosure::do_object_b(oop p) {
  97   return _bitmap->is_marked(p) || G1ArchiveAllocator::is_closed_archive_object(p);
  98 }
  99 
 100 template<typename T>
 101 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
 102   _marker->mark_and_push(p);
 103 }
 104 
 105 #endif // SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP


  60 inline void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) {
  61   _marker->follow_cld(cld);
  62 }
  63 
  64 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
  65   T heap_oop = RawAccess<>::oop_load(p);
  66   if (CompressedOops::is_null(heap_oop)) {
  67     return;
  68   }
  69 
  70   oop obj = CompressedOops::decode_not_null(heap_oop);
  71   assert(Universe::heap()->is_in(obj), "should be in heap");
  72   if (G1ArchiveAllocator::is_archived_object(obj)) {
  73     // We never forward archive objects.
  74     return;
  75   }
  76 
  77   oop forwardee = obj->forwardee();
  78   if (forwardee == NULL) {
  79     // Not forwarded, return current reference.
  80     assert(obj->mark_raw() == markOopDesc::prototype_for_object(obj) || // Correct mark
  81            obj->mark_raw()->must_be_preserved(obj) || // Will be restored by PreservedMarksSet
  82            (UseBiasedLocking && obj->has_bias_pattern_raw()), // Will be restored by BiasedLocking
  83            "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
  84            p2i(obj), p2i(obj->mark_raw()), p2i(markOopDesc::prototype_for_object(obj)));
  85     return;
  86   }
  87 
  88   // Forwarded, just update.
  89   assert(Universe::heap()->is_in_reserved(forwardee), "should be in object space");
  90   RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
  91 }
  92 
  93 inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
  94 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
  95 
  96 inline bool G1IsAliveClosure::do_object_b(oop p) {
  97   return _bitmap->is_marked(p) || G1ArchiveAllocator::is_closed_archive_object(p);
  98 }
  99 
 100 template<typename T>
 101 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
 102   _marker->mark_and_push(p);
 103 }
 104 
 105 #endif // SHARE_GC_G1_G1FULLGCOOPCLOSURES_INLINE_HPP
< prev index next >