< prev index next >

src/hotspot/share/prims/jvmtiTagMap.cpp

Print this page

1420 
1421   // free the stacks
1422   delete _saved_oop_stack;
1423   delete _saved_mark_stack;
1424 }
1425 
1426 // mark an object
1427 inline void ObjectMarker::mark(oop o) {
1428   assert(Universe::heap()->is_in(o), "sanity check");
1429   assert(!o->mark().is_marked(), "should only mark an object once");
1430 
1431   // object's mark word
1432   markWord mark = o->mark();
1433 
1434   if (o->mark_must_be_preserved(mark)) {
1435     _saved_mark_stack->push(mark);
1436     _saved_oop_stack->push(o);
1437   }
1438 
1439   // mark the object
1440   o->set_mark(markWord::prototype().set_marked());
1441 }
1442 
1443 // return true if object is marked
1444 inline bool ObjectMarker::visited(oop o) {
1445   return o->mark().is_marked();
1446 }
1447 
1448 // Stack allocated class to help ensure that ObjectMarker is used
1449 // correctly. Constructor initializes ObjectMarker, destructor calls
1450 // ObjectMarker's done() function to restore object headers.
1451 class ObjectMarkerController : public StackObj {
1452  public:
1453   ObjectMarkerController() {
1454     ObjectMarker::init();
1455   }
1456   ~ObjectMarkerController() {
1457     ObjectMarker::done();
1458   }
1459 };
1460 

1420 
1421   // free the stacks
1422   delete _saved_oop_stack;
1423   delete _saved_mark_stack;
1424 }
1425 
1426 // mark an object
1427 inline void ObjectMarker::mark(oop o) {
1428   assert(Universe::heap()->is_in(o), "sanity check");
1429   assert(!o->mark().is_marked(), "should only mark an object once");
1430 
1431   // object's mark word
1432   markWord mark = o->mark();
1433 
1434   if (o->mark_must_be_preserved(mark)) {
1435     _saved_mark_stack->push(mark);
1436     _saved_oop_stack->push(o);
1437   }
1438 
1439   // mark the object
1440   o->set_mark(o->klass()->prototype_header().set_marked());
1441 }
1442 
1443 // return true if object is marked
1444 inline bool ObjectMarker::visited(oop o) {
1445   return o->mark().is_marked();
1446 }
1447 
1448 // Stack allocated class to help ensure that ObjectMarker is used
1449 // correctly. Constructor initializes ObjectMarker, destructor calls
1450 // ObjectMarker's done() function to restore object headers.
1451 class ObjectMarkerController : public StackObj {
1452  public:
1453   ObjectMarkerController() {
1454     ObjectMarker::init();
1455   }
1456   ~ObjectMarkerController() {
1457     ObjectMarker::done();
1458   }
1459 };
1460 
< prev index next >