< prev index next >

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

Print this page

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

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