--- old/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2018-03-25 12:59:15.175995931 +0200 +++ new/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2018-03-25 12:59:15.011998151 +0200 @@ -1041,7 +1041,7 @@ // Except with compressed oops it's the mark word. HeapWord* old_ptr = (HeapWord*)old; // Restore the mark word copied above. - obj->set_mark(m); + obj->set_mark_raw(m); assert(obj->klass_or_null() == NULL, "Object should be uninitialized here."); assert(!((FreeChunk*)obj_ptr)->is_free(), "Error, block will look free but show wrong size"); OrderAccess::storestore(); @@ -7808,8 +7808,8 @@ const markOop proto = markOopDesc::prototype(); NOT_PRODUCT(ssize_t n = 0;) for (oop next; i > 0 && cur != NULL; cur = next, i--) { - next = oop(cur->mark()); - cur->set_mark(proto); // until proven otherwise + next = oop(cur->mark_raw()); + cur->set_mark_raw(proto); // until proven otherwise assert(oopDesc::is_oop(cur), "Should be an oop"); bool res = stack->push(cur); assert(res, "Bit off more than can chew?"); @@ -7892,8 +7892,8 @@ size_t i = num; oop cur = prefix; // Walk down the first "num" objects, unless we reach the end. - for (; i > 1 && cur->mark() != NULL; cur = oop(cur->mark()), i--); - if (cur->mark() == NULL) { + for (; i > 1 && cur->mark_raw() != NULL; cur = oop(cur->mark_raw()), i--); + if (cur->mark_raw() == NULL) { // We have "num" or fewer elements in the list, so there // is nothing to return to the global list. // Write back the NULL in lieu of the BUSY we wrote @@ -7903,9 +7903,9 @@ } } else { // Chop off the suffix and return it to the global list. - assert(cur->mark() != BUSY, "Error"); - oop suffix_head = cur->mark(); // suffix will be put back on global list - cur->set_mark(NULL); // break off suffix + assert(cur->mark_raw() != BUSY, "Error"); + oop suffix_head = cur->mark_raw(); // suffix will be put back on global list + cur->set_mark_raw(NULL); // break off suffix // It's possible that the list is still in the empty(busy) state // we left it in a short while ago; in that case we may be // able to place back the suffix without incurring the cost @@ -7925,18 +7925,18 @@ // Too bad, someone else sneaked in (at least) an element; we'll need // to do a splice. Find tail of suffix so we can prepend suffix to global // list. - for (cur = suffix_head; cur->mark() != NULL; cur = (oop)(cur->mark())); + for (cur = suffix_head; cur->mark_raw() != NULL; cur = (oop)(cur->mark_raw())); oop suffix_tail = cur; - assert(suffix_tail != NULL && suffix_tail->mark() == NULL, + assert(suffix_tail != NULL && suffix_tail->mark_raw() == NULL, "Tautology"); observed_overflow_list = _overflow_list; do { cur_overflow_list = observed_overflow_list; if (cur_overflow_list != BUSY) { // Do the splice ... - suffix_tail->set_mark(markOop(cur_overflow_list)); + suffix_tail->set_mark_raw(markOop(cur_overflow_list)); } else { // cur_overflow_list == BUSY - suffix_tail->set_mark(NULL); + suffix_tail->set_mark_raw(NULL); } // ... and try to place spliced list back on overflow_list ... observed_overflow_list = @@ -7952,8 +7952,8 @@ oop next; NOT_PRODUCT(ssize_t n = 0;) for (cur = prefix; cur != NULL; cur = next) { - next = oop(cur->mark()); - cur->set_mark(proto); // until proven otherwise + next = oop(cur->mark_raw()); + cur->set_mark_raw(proto); // until proven otherwise assert(oopDesc::is_oop(cur), "Should be an oop"); bool res = work_q->push(cur); assert(res, "Bit off more than we can chew?"); @@ -7971,7 +7971,7 @@ NOT_PRODUCT(_num_par_pushes++;) assert(oopDesc::is_oop(p), "Not an oop"); preserve_mark_if_necessary(p); - p->set_mark((markOop)_overflow_list); + p->set_mark_raw((markOop)_overflow_list); _overflow_list = p; } @@ -7985,9 +7985,9 @@ do { cur_overflow_list = observed_overflow_list; if (cur_overflow_list != BUSY) { - p->set_mark(markOop(cur_overflow_list)); + p->set_mark_raw(markOop(cur_overflow_list)); } else { - p->set_mark(NULL); + p->set_mark_raw(NULL); } observed_overflow_list = Atomic::cmpxchg((oopDesc*)p, &_overflow_list, (oopDesc*)cur_overflow_list); @@ -8012,21 +8012,21 @@ void CMSCollector::preserve_mark_work(oop p, markOop m) { _preserved_oop_stack.push(p); _preserved_mark_stack.push(m); - assert(m == p->mark(), "Mark word changed"); + assert(m == p->mark_raw(), "Mark word changed"); assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), "bijection"); } // Single threaded void CMSCollector::preserve_mark_if_necessary(oop p) { - markOop m = p->mark(); + markOop m = p->mark_raw(); if (m->must_be_preserved(p)) { preserve_mark_work(p, m); } } void CMSCollector::par_preserve_mark_if_necessary(oop p) { - markOop m = p->mark(); + markOop m = p->mark_raw(); if (m->must_be_preserved(p)) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); // Even though we read the mark word without holding @@ -8034,7 +8034,7 @@ // because we "own" this oop, so no other thread can // be trying to push it on the overflow list; see // the assertion in preserve_mark_work() that checks - // that m == p->mark(). + // that m == p->mark_raw(). preserve_mark_work(p, m); } } @@ -8067,10 +8067,10 @@ oop p = _preserved_oop_stack.pop(); assert(oopDesc::is_oop(p), "Should be an oop"); assert(_span.contains(p), "oop should be in _span"); - assert(p->mark() == markOopDesc::prototype(), + assert(p->mark_raw() == markOopDesc::prototype(), "Set when taken from overflow list"); markOop m = _preserved_mark_stack.pop(); - p->set_mark(m); + p->set_mark_raw(m); } assert(_preserved_mark_stack.is_empty() && _preserved_oop_stack.is_empty(), "stacks were cleared above");