< prev index next >

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

Print this page

 63   _marker->follow_cld(cld);
 64 }
 65 
 66 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
 67   T heap_oop = RawAccess<>::oop_load(p);
 68   if (CompressedOops::is_null(heap_oop)) {
 69     return;
 70   }
 71 
 72   oop obj = CompressedOops::decode_not_null(heap_oop);
 73   assert(Universe::heap()->is_in(obj), "should be in heap");
 74   if (!_collector->is_compacting(obj)) {
 75     // We never forward objects in non-compacting regions so there is no need to
 76     // process them further.
 77     return;
 78   }
 79 
 80   oop forwardee = obj->forwardee();
 81   if (forwardee == NULL) {
 82     // Not forwarded, return current reference.
 83     assert(obj->mark() == markWord::prototype() || // Correct mark
 84            obj->mark_must_be_preserved(), // Will be restored by PreservedMarksSet
 85            "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
 86            p2i(obj), obj->mark().value(), markWord::prototype().value());
 87     return;
 88   }
 89 
 90   // Forwarded, just update.
 91   assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
 92   RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
 93 }
 94 
 95 inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
 96 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 97 
 98 inline bool G1IsAliveClosure::do_object_b(oop p) {
 99   return _bitmap->is_marked(p) || _collector->is_skip_marking(p);
100 }
101 
102 template<typename T>
103 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
104   _marker->mark_and_push(p);
105 }
106 

 63   _marker->follow_cld(cld);
 64 }
 65 
 66 template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
 67   T heap_oop = RawAccess<>::oop_load(p);
 68   if (CompressedOops::is_null(heap_oop)) {
 69     return;
 70   }
 71 
 72   oop obj = CompressedOops::decode_not_null(heap_oop);
 73   assert(Universe::heap()->is_in(obj), "should be in heap");
 74   if (!_collector->is_compacting(obj)) {
 75     // We never forward objects in non-compacting regions so there is no need to
 76     // process them further.
 77     return;
 78   }
 79 
 80   oop forwardee = obj->forwardee();
 81   if (forwardee == NULL) {
 82     // Not forwarded, return current reference.
 83     assert(obj->mark() == obj->klass()->prototype_header() || // Correct mark
 84            obj->mark_must_be_preserved(), // Will be restored by PreservedMarksSet
 85            "Must have correct prototype or be preserved, obj: " PTR_FORMAT ", mark: " PTR_FORMAT ", prototype: " PTR_FORMAT,
 86            p2i(obj), obj->mark().value(), obj->klass()->prototype_header().value());
 87     return;
 88   }
 89 
 90   // Forwarded, just update.
 91   assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
 92   RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
 93 }
 94 
 95 inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
 96 inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 97 
 98 inline bool G1IsAliveClosure::do_object_b(oop p) {
 99   return _bitmap->is_marked(p) || _collector->is_skip_marking(p);
100 }
101 
102 template<typename T>
103 inline void G1FullKeepAliveClosure::do_oop_work(T* p) {
104   _marker->mark_and_push(p);
105 }
106 
< prev index next >