--- old/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2017-02-23 10:57:56.100686170 +0100 +++ new/src/share/vm/gc/g1/g1ConcurrentMark.cpp 2017-02-23 10:57:55.988682811 +0100 @@ -271,7 +271,7 @@ return result; } -bool G1CMMarkStack::par_push_chunk(oop* ptr_arr) { +bool G1CMMarkStack::par_push_chunk(G1TaskQueueEntry* ptr_arr) { // Get a new chunk. OopChunk* new_chunk = remove_chunk_from_free_list(); @@ -285,21 +285,21 @@ return false; } - Copy::conjoint_memory_atomic(ptr_arr, new_chunk->data, OopsPerChunk * sizeof(oop)); + Copy::conjoint_memory_atomic(ptr_arr, new_chunk->data, EntriesPerChunk * sizeof(G1TaskQueueEntry)); add_chunk_to_chunk_list(new_chunk); return true; } -bool G1CMMarkStack::par_pop_chunk(oop* ptr_arr) { +bool G1CMMarkStack::par_pop_chunk(G1TaskQueueEntry* ptr_arr) { OopChunk* cur = remove_chunk_from_chunk_list(); if (cur == NULL) { return false; } - Copy::conjoint_memory_atomic(cur->data, ptr_arr, OopsPerChunk * sizeof(oop)); + Copy::conjoint_memory_atomic(cur->data, ptr_arr, EntriesPerChunk * sizeof(G1TaskQueueEntry)); add_chunk_to_free_list(cur); return true; @@ -2008,13 +2008,13 @@ _info(info) { } - void operator()(oop obj) const { - guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || obj->is_oop(), + void operator()(G1TaskQueueEntry task_entry) const { + guarantee(task_entry.is_array_slice() || task_entry.obj()->is_oop(), "Non-oop " PTR_FORMAT ", phase: %s, info: %d", - p2i(obj), _phase, _info); - guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || !_g1h->is_in_cset(obj), + p2i(task_entry.obj()), _phase, _info); + guarantee(task_entry.is_array_slice() || !_g1h->is_in_cset(task_entry.obj()), "obj: " PTR_FORMAT " in CSet, phase: %s, info: %d", - p2i(obj), _phase, _info); + p2i(task_entry.obj()), _phase, _info); } }; @@ -2399,16 +2399,16 @@ void G1CMTask::move_entries_to_global_stack() { // Local array where we'll store the entries that will be popped // from the local queue. - oop buffer[G1CMMarkStack::OopsPerChunk]; + G1TaskQueueEntry buffer[G1CMMarkStack::EntriesPerChunk]; size_t n = 0; - oop obj; - while (n < G1CMMarkStack::OopsPerChunk && _task_queue->pop_local(obj)) { - buffer[n] = obj; + G1TaskQueueEntry task_entry; + while (n < G1CMMarkStack::EntriesPerChunk && _task_queue->pop_local(task_entry)) { + buffer[n] = task_entry; ++n; } - if (n < G1CMMarkStack::OopsPerChunk) { - buffer[n] = NULL; + if (n < G1CMMarkStack::EntriesPerChunk) { + buffer[n] = G1TaskQueueEntry(); } if (n > 0) { @@ -2424,20 +2424,20 @@ bool G1CMTask::get_entries_from_global_stack() { // Local array where we'll store the entries that will be popped // from the global stack. - oop buffer[G1CMMarkStack::OopsPerChunk]; + G1TaskQueueEntry buffer[G1CMMarkStack::EntriesPerChunk]; if (!_cm->mark_stack_pop(buffer)) { return false; } // We did actually pop at least one entry. - for (size_t i = 0; i < G1CMMarkStack::OopsPerChunk; ++i) { - oop elem = buffer[i]; - if (elem == NULL) { + for (size_t i = 0; i < G1CMMarkStack::EntriesPerChunk; ++i) { + G1TaskQueueEntry task_entry = buffer[i]; + if (task_entry.is_null()) { break; } - assert(G1CMObjArrayProcessor::is_array_slice(elem) || elem->is_oop(), "Element " PTR_FORMAT " must be an array slice or oop", p2i(elem)); - bool success = _task_queue->push(elem); + assert(task_entry.is_array_slice() || task_entry.obj()->is_oop(), "Element " PTR_FORMAT " must be an array slice or oop", p2i(task_entry.obj())); + bool success = _task_queue->push(task_entry); // We only call this when the local queue is empty or under a // given target limit. So, we do not expect this push to fail. assert(success, "invariant"); @@ -2464,7 +2464,7 @@ } if (_task_queue->size() > target_size) { - oop obj; + G1TaskQueueEntry obj; bool ret = _task_queue->pop_local(obj); while (ret) { scan_object(obj); @@ -2552,8 +2552,8 @@ _step_times_ms.maximum(), _step_times_ms.sum()); } -bool G1ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { - return _task_queues->steal(worker_id, hash_seed, obj); +bool G1ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, G1TaskQueueEntry& task_entry) { + return _task_queues->steal(worker_id, hash_seed, task_entry); } /***************************************************************************** @@ -2876,7 +2876,7 @@ assert(_cm->out_of_regions() && _task_queue->size() == 0, "only way to reach here"); while (!has_aborted()) { - oop obj; + G1TaskQueueEntry obj; if (_cm->try_stealing(_worker_id, &_hash_seed, obj)) { scan_object(obj);