--- old/src/share/vm/gc/cms/parNewGeneration.cpp 2016-09-26 10:58:40.888950565 +0200 +++ new/src/share/vm/gc/cms/parNewGeneration.cpp 2016-09-26 10:58:40.740950558 +0200 @@ -1263,7 +1263,7 @@ // (although some performance comparisons would be useful since // single global lists have their own performance disadvantages // as we were made painfully aware not long ago, see 6786503). -#define BUSY (cast_to_oop(0x1aff1aff)) +#define BUSY ((oopDesc*)(0x1aff1aff)) void ParNewGeneration::push_on_overflow_list(oop from_space_obj, ParScanThreadState* par_scan_state) { assert(is_in_reserved(from_space_obj), "Should be from this generation"); if (ParGCUseLocalOverflow) { @@ -1286,8 +1286,8 @@ listhead->forward_to(from_space_obj); from_space_obj = listhead; } - oop observed_overflow_list = _overflow_list; - oop cur_overflow_list; + oopDesc* observed_overflow_list = _overflow_list; + oopDesc* cur_overflow_list; do { cur_overflow_list = observed_overflow_list; if (cur_overflow_list != BUSY) { @@ -1296,7 +1296,7 @@ from_space_obj->set_klass_to_list_ptr(NULL); } observed_overflow_list = - (oop)Atomic::cmpxchg_ptr(from_space_obj, &_overflow_list, cur_overflow_list); + (oopDesc*)Atomic::cmpxchg_ptr(from_space_obj, &_overflow_list, cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); } } @@ -1339,7 +1339,7 @@ if (_overflow_list == NULL) return false; // Otherwise, there was something there; try claiming the list. - oop prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); + oopDesc* prefix = (oopDesc*)Atomic::xchg_ptr(BUSY, &_overflow_list); // Trim off a prefix of at most objsFromOverflow items Thread* tid = Thread::current(); size_t spin_count = ParallelGCThreads; @@ -1353,7 +1353,7 @@ return false; } else if (_overflow_list != BUSY) { // try and grab the prefix - prefix = cast_to_oop(Atomic::xchg_ptr(BUSY, &_overflow_list)); + prefix = (oopDesc*)Atomic::xchg_ptr(BUSY, &_overflow_list); } } if (prefix == NULL || prefix == BUSY) { @@ -1367,7 +1367,7 @@ } assert(prefix != NULL && prefix != BUSY, "Error"); size_t i = 1; - oop cur = prefix; + oopDesc* cur = prefix; while (i < objsFromOverflow && cur->klass_or_null() != NULL) { i++; cur = cur->list_ptr_from_klass(); } @@ -1380,18 +1380,18 @@ (void) Atomic::cmpxchg_ptr(NULL, &_overflow_list, BUSY); } } else { - assert(cur->klass_or_null() != (Klass*)(address)BUSY, "Error"); - oop suffix = cur->list_ptr_from_klass(); // suffix will be put back on global list - cur->set_klass_to_list_ptr(NULL); // break off suffix + assert(cur->klass_or_null() != (Klass*)BUSY, "Error"); + oopDesc* suffix = cur->list_ptr_from_klass(); // suffix will be put back on global list + cur->set_klass_to_list_ptr(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. - oop observed_overflow_list = _overflow_list; - oop cur_overflow_list = observed_overflow_list; + oopDesc* observed_overflow_list = _overflow_list; + oopDesc* cur_overflow_list = observed_overflow_list; bool attached = false; while (observed_overflow_list == BUSY || observed_overflow_list == NULL) { observed_overflow_list = - (oop) Atomic::cmpxchg_ptr(suffix, &_overflow_list, cur_overflow_list); + (oopDesc*) Atomic::cmpxchg_ptr(suffix, &_overflow_list, cur_overflow_list); if (cur_overflow_list == observed_overflow_list) { attached = true; break; @@ -1400,7 +1400,7 @@ if (!attached) { // Too bad, someone else got in in between; we'll need to do a splice. // Find the last item of suffix list - oop last = suffix; + oopDesc* last = suffix; while (last->klass_or_null() != NULL) { last = last->list_ptr_from_klass(); } @@ -1415,7 +1415,7 @@ last->set_klass_to_list_ptr(NULL); } observed_overflow_list = - (oop)Atomic::cmpxchg_ptr(suffix, &_overflow_list, cur_overflow_list); + (oopDesc*)Atomic::cmpxchg_ptr(suffix, &_overflow_list, cur_overflow_list); } while (cur_overflow_list != observed_overflow_list); } } @@ -1425,8 +1425,8 @@ cur = prefix; ssize_t n = 0; while (cur != NULL) { - oop obj_to_push = cur->forwardee(); - oop next = cur->list_ptr_from_klass(); + oopDesc* obj_to_push = (oopDesc*)cur->forwardee(); + oopDesc* next = cur->list_ptr_from_klass(); cur->set_klass(obj_to_push->klass()); // This may be an array object that is self-forwarded. In that case, the list pointer // space, cur, is not in the Java heap, but rather in the C-heap and should be freed. @@ -1435,7 +1435,7 @@ // with promotion failure. oopDesc* f = cur; FREE_C_HEAP_ARRAY(oopDesc, f); - } else if (par_scan_state->should_be_partially_scanned(obj_to_push, cur)) { + } else if (par_scan_state->should_be_partially_scanned(oop(obj_to_push), oop(cur))) { assert(arrayOop(cur)->length() == 0, "entire array remaining to be scanned"); obj_to_push = cur; }