< prev index next >

src/hotspot/share/gc/shared/objectMarker.cpp

Print this page




 114 // mark an object
 115 bool DefaultObjectMarker::mark(oop o) {
 116   assert(Universe::heap()->is_in(o), "sanity check");
 117 
 118   // object's mark word
 119   markWord mark = o->mark();
 120   if (mark.is_marked()) {
 121     return false;
 122   }
 123 
 124   if (o->mark_must_be_preserved(mark)) {
 125     _saved_mark_stack->push(mark);
 126     _saved_oop_stack->push(o);
 127   }
 128 
 129   // mark the object
 130   o->set_mark(markWord::prototype().set_marked());
 131   return true;
 132 }
 133 
 134 // return true if object is visited
 135 bool DefaultObjectMarker::visited(oop o) {
 136   return o->mark().is_marked();
 137 }


 114 // mark an object
 115 bool DefaultObjectMarker::mark(oop o) {
 116   assert(Universe::heap()->is_in(o), "sanity check");
 117 
 118   // object's mark word
 119   markWord mark = o->mark();
 120   if (mark.is_marked()) {
 121     return false;
 122   }
 123 
 124   if (o->mark_must_be_preserved(mark)) {
 125     _saved_mark_stack->push(mark);
 126     _saved_oop_stack->push(o);
 127   }
 128 
 129   // mark the object
 130   o->set_mark(markWord::prototype().set_marked());
 131   return true;
 132 }
 133 
 134 // return true if object is marked
 135 bool DefaultObjectMarker::marked(oop o) {
 136   return o->mark().is_marked();
 137 }
< prev index next >