< prev index next >

src/hotspot/share/gc/serial/markSweep.inline.hpp

Print this page




  70 inline void MarkAndPushClosure::do_oop(oop* p)               { do_oop_work(p); }
  71 inline void MarkAndPushClosure::do_oop(narrowOop* p)         { do_oop_work(p); }
  72 inline void MarkAndPushClosure::do_klass(Klass* k)           { MarkSweep::follow_klass(k); }
  73 inline void MarkAndPushClosure::do_cld(ClassLoaderData* cld) { MarkSweep::follow_cld(cld); }
  74 
  75 template <class T> inline void MarkSweep::adjust_pointer(T* p) {
  76   T heap_oop = RawAccess<>::oop_load(p);
  77   if (!CompressedOops::is_null(heap_oop)) {
  78     oop obj = CompressedOops::decode_not_null(heap_oop);
  79     assert(Universe::heap()->is_in(obj), "should be in heap");
  80 
  81     oop new_obj = oop(obj->mark_raw().decode_pointer());
  82 
  83     assert(new_obj != NULL ||                          // is forwarding ptr?
  84            obj->mark_raw() == markWord::prototype() || // not gc marked?
  85            (UseBiasedLocking && obj->mark_raw().has_bias_pattern()),
  86            // not gc marked?
  87            "should be forwarded");
  88 
  89     if (new_obj != NULL) {
  90       DEBUG_ONLY(Universe::heap()->check_oop_location((HeapWord*)new_obj);)
  91       RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
  92     }
  93   }
  94 }
  95 
  96 template <typename T>
  97 void AdjustPointerClosure::do_oop_work(T* p)           { MarkSweep::adjust_pointer(p); }
  98 inline void AdjustPointerClosure::do_oop(oop* p)       { do_oop_work(p); }
  99 inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 100 
 101 
 102 inline int MarkSweep::adjust_pointers(oop obj) {
 103   return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
 104 }
 105 
 106 #endif // SHARE_GC_SERIAL_MARKSWEEP_INLINE_HPP


  70 inline void MarkAndPushClosure::do_oop(oop* p)               { do_oop_work(p); }
  71 inline void MarkAndPushClosure::do_oop(narrowOop* p)         { do_oop_work(p); }
  72 inline void MarkAndPushClosure::do_klass(Klass* k)           { MarkSweep::follow_klass(k); }
  73 inline void MarkAndPushClosure::do_cld(ClassLoaderData* cld) { MarkSweep::follow_cld(cld); }
  74 
  75 template <class T> inline void MarkSweep::adjust_pointer(T* p) {
  76   T heap_oop = RawAccess<>::oop_load(p);
  77   if (!CompressedOops::is_null(heap_oop)) {
  78     oop obj = CompressedOops::decode_not_null(heap_oop);
  79     assert(Universe::heap()->is_in(obj), "should be in heap");
  80 
  81     oop new_obj = oop(obj->mark_raw().decode_pointer());
  82 
  83     assert(new_obj != NULL ||                          // is forwarding ptr?
  84            obj->mark_raw() == markWord::prototype() || // not gc marked?
  85            (UseBiasedLocking && obj->mark_raw().has_bias_pattern()),
  86            // not gc marked?
  87            "should be forwarded");
  88 
  89     if (new_obj != NULL) {
  90       assert(Universe::heap()->is_oop_location(new_obj), "invalid oop location");
  91       RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
  92     }
  93   }
  94 }
  95 
  96 template <typename T>
  97 void AdjustPointerClosure::do_oop_work(T* p)           { MarkSweep::adjust_pointer(p); }
  98 inline void AdjustPointerClosure::do_oop(oop* p)       { do_oop_work(p); }
  99 inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); }
 100 
 101 
 102 inline int MarkSweep::adjust_pointers(oop obj) {
 103   return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
 104 }
 105 
 106 #endif // SHARE_GC_SERIAL_MARKSWEEP_INLINE_HPP
< prev index next >