inline void MarkSweep::mark_object(oop obj) { // some marks may contain information we need to preserve so we store them away // and overwrite the mark. We'll restore it at the end of markSweep. markOop mark = obj->mark(); obj->set_mark(markOopDesc::prototype()->set_marked()); if (mark->must_be_preserved(obj)) { preserve_mark(obj, mark); } }
inline void MarkSweep::mark_object(oop obj) { #if INCLUDE_ALL_GCS if (G1StringDedup::is_enabled()) { // We must enqueue the object before it is marked // as we otherwise can't read the object's age. G1StringDedup::enqueue_from_mark(obj); } #endif // some marks may contain information we need to preserve so we store them away // and overwrite the mark. We'll restore it at the end of markSweep. markOop mark = obj->mark(); obj->set_mark(markOopDesc::prototype()->set_marked()); if (mark->must_be_preserved(obj)) { preserve_mark(obj, mark); } }
void DefNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) { if (m->must_be_preserved_for_promotion_failure(obj)) { preserve_mark(obj, m); } }