--- old/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2019-08-13 12:39:45.340144256 +0200 +++ new/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2019-08-13 12:39:45.040139052 +0200 @@ -7779,7 +7779,7 @@ const markWord proto = markWord::prototype(); NOT_PRODUCT(ssize_t n = 0;) for (oop next; i > 0 && cur != NULL; cur = next, i--) { - next = oop((void*)cur->mark_raw().value()); + next = oop(cur->mark_raw().to_pointer()); cur->set_mark_raw(proto); // until proven otherwise assert(oopDesc::is_oop(cur), "Should be an oop"); bool res = stack->push(cur); @@ -7863,8 +7863,8 @@ size_t i = num; oop cur = prefix; // Walk down the first "num" objects, unless we reach the end. - for (; i > 1 && cur->mark_raw().value() != 0; cur = oop((void*)cur->mark_raw().value()), i--); - if (cur->mark_raw().value() == 0) { + for (; i > 1 && cur->mark_raw().to_pointer() != NULL; cur = oop(cur->mark_raw().to_pointer()), i--); + if (cur->mark_raw().to_pointer() == 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 @@ -7874,9 +7874,9 @@ } } else { // Chop off the suffix and return it to the global list. - assert(cur->mark_raw().value() != (uintptr_t)(void*)BUSY, "Error"); - oop suffix_head = oop((void*)cur->mark_raw().value()); // suffix will be put back on global list - cur->set_mark_raw(markWord(0)); // break off suffix + assert(cur->mark_raw().to_pointer() != (void*)BUSY, "Error"); + oop suffix_head = oop(cur->mark_raw().to_pointer()); // suffix will be put back on global list + cur->set_mark_raw(markWord::from_pointer(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 @@ -7896,18 +7896,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_raw().value() != 0; cur = (oop)((void*)cur->mark_raw().value())); + for (cur = suffix_head; cur->mark_raw().to_pointer() != NULL; cur = (oop)(cur->mark_raw().to_pointer())); oop suffix_tail = cur; - assert(suffix_tail != NULL && suffix_tail->mark_raw().value() == 0, + assert(suffix_tail != NULL && suffix_tail->mark_raw().to_pointer() == 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_raw(markWord((uintptr_t)(void*)cur_overflow_list)); + suffix_tail->set_mark_raw(markWord::from_pointer((void*)cur_overflow_list)); } else { // cur_overflow_list == BUSY - suffix_tail->set_mark_raw(markWord(0)); + suffix_tail->set_mark_raw(markWord::from_pointer(NULL)); } // ... and try to place spliced list back on overflow_list ... observed_overflow_list = @@ -7923,7 +7923,7 @@ oop next; NOT_PRODUCT(ssize_t n = 0;) for (cur = prefix; cur != NULL; cur = next) { - next = oop((void*)cur->mark_raw().value()); + next = oop(cur->mark_raw().to_pointer()); cur->set_mark_raw(proto); // until proven otherwise assert(oopDesc::is_oop(cur), "Should be an oop"); bool res = work_q->push(cur); @@ -7956,9 +7956,9 @@ do { cur_overflow_list = observed_overflow_list; if (cur_overflow_list != BUSY) { - p->set_mark_raw(markWord((uintptr_t)(void*)cur_overflow_list)); + p->set_mark_raw(markWord::from_pointer((void*)cur_overflow_list)); } else { - p->set_mark_raw(markWord(0)); + p->set_mark_raw(markWord::from_pointer(NULL)); } observed_overflow_list = Atomic::cmpxchg((oopDesc*)p, &_overflow_list, (oopDesc*)cur_overflow_list);