< prev index next >

src/hotspot/share/gc/serial/markSweep.cpp

Print this page




 115       follow_object(obj);
 116     }
 117     // Process ObjArrays one at a time to avoid marking stack bloat.
 118     if (!_objarray_stack.is_empty()) {
 119       ObjArrayTask task = _objarray_stack.pop();
 120       follow_array_chunk(objArrayOop(task.obj()), task.index());
 121     }
 122   } while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
 123 }
 124 
 125 MarkSweep::FollowStackClosure MarkSweep::follow_stack_closure;
 126 
 127 void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
 128 
 129 template <class T> inline void MarkSweep::follow_root(T* p) {
 130   assert(!Universe::heap()->is_in(p),
 131          "roots shouldn't be things within the heap");
 132   T heap_oop = RawAccess<>::oop_load(p);
 133   if (!CompressedOops::is_null(heap_oop)) {
 134     oop obj = CompressedOops::decode_not_null(heap_oop);


 135     if (!obj->mark_raw().is_marked()) {
 136       mark_object(obj);
 137       follow_object(obj);
 138     }
 139   }
 140   follow_stack();
 141 }
 142 
 143 void MarkSweep::FollowRootClosure::do_oop(oop* p)       { follow_root(p); }
 144 void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); }
 145 
 146 void PreservedMark::adjust_pointer() {
 147   MarkSweep::adjust_pointer(&_obj);
 148 }
 149 
 150 void PreservedMark::restore() {
 151   _obj->set_mark_raw(_mark);
 152 }
 153 
 154 // We preserve the mark which should be replaced at the end and the location




 115       follow_object(obj);
 116     }
 117     // Process ObjArrays one at a time to avoid marking stack bloat.
 118     if (!_objarray_stack.is_empty()) {
 119       ObjArrayTask task = _objarray_stack.pop();
 120       follow_array_chunk(objArrayOop(task.obj()), task.index());
 121     }
 122   } while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
 123 }
 124 
 125 MarkSweep::FollowStackClosure MarkSweep::follow_stack_closure;
 126 
 127 void MarkSweep::FollowStackClosure::do_void() { follow_stack(); }
 128 
 129 template <class T> inline void MarkSweep::follow_root(T* p) {
 130   assert(!Universe::heap()->is_in(p),
 131          "roots shouldn't be things within the heap");
 132   T heap_oop = RawAccess<>::oop_load(p);
 133   if (!CompressedOops::is_null(heap_oop)) {
 134     oop obj = CompressedOops::decode_not_null(heap_oop);
 135     assert_object_is_in_heap(p, obj);
 136 
 137     if (!obj->mark_raw().is_marked()) {
 138       mark_object(obj);
 139       follow_object(obj);
 140     }
 141   }
 142   follow_stack();
 143 }
 144 
 145 void MarkSweep::FollowRootClosure::do_oop(oop* p)       { follow_root(p); }
 146 void MarkSweep::FollowRootClosure::do_oop(narrowOop* p) { follow_root(p); }
 147 
 148 void PreservedMark::adjust_pointer() {
 149   MarkSweep::adjust_pointer(&_obj);
 150 }
 151 
 152 void PreservedMark::restore() {
 153   _obj->set_mark_raw(_mark);
 154 }
 155 
 156 // We preserve the mark which should be replaced at the end and the location


< prev index next >