8006 } |
8006 } |
8007 |
8007 |
8008 // Single threaded |
8008 // Single threaded |
8009 void CMSCollector::preserve_mark_if_necessary(oop p) { |
8009 void CMSCollector::preserve_mark_if_necessary(oop p) { |
8010 markWord m = p->mark_raw(); |
8010 markWord m = p->mark_raw(); |
8011 if (m.must_be_preserved(p)) { |
8011 if (p->mark_must_be_preserved(m)) { |
8012 preserve_mark_work(p, m); |
8012 preserve_mark_work(p, m); |
8013 } |
8013 } |
8014 } |
8014 } |
8015 |
8015 |
8016 void CMSCollector::par_preserve_mark_if_necessary(oop p) { |
8016 void CMSCollector::par_preserve_mark_if_necessary(oop p) { |
8017 markWord m = p->mark_raw(); |
8017 markWord m = p->mark_raw(); |
8018 if (m.must_be_preserved(p)) { |
8018 if (p->mark_must_be_preserved(m)) { |
8019 MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); |
8019 MutexLocker x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); |
8020 // Even though we read the mark word without holding |
8020 // Even though we read the mark word without holding |
8021 // the lock, we are assured that it will not change |
8021 // the lock, we are assured that it will not change |
8022 // because we "own" this oop, so no other thread can |
8022 // because we "own" this oop, so no other thread can |
8023 // be trying to push it on the overflow list; see |
8023 // be trying to push it on the overflow list; see |