< prev index next >
src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp
Print this page
rev 12666 : imported patch 8168467-use-taskentry-as-mark-stack-elem
rev 12667 : imported patch 8168467-kim-review
@@ -95,11 +95,11 @@
inline void G1CMMarkStack::iterate(Fn fn) const {
assert_at_safepoint(true);
size_t num_chunks = 0;
- OopChunk* cur = _chunk_list;
+ TaskQueueEntryChunk* cur = _chunk_list;
while (cur != NULL) {
guarantee(num_chunks <= _chunks_in_chunk_list, "Found " SIZE_FORMAT " oop chunks which is more than there should be", num_chunks);
for (size_t i = 0; i < EntriesPerChunk; ++i) {
if (cur->data[i].is_null()) {
@@ -112,11 +112,11 @@
}
}
#endif
// It scans an object and visits its children.
-inline void G1CMTask::scan_object(G1TaskQueueEntry task_entry) { process_grey_object<true>(task_entry); }
+inline void G1CMTask::scan_task_entry(G1TaskQueueEntry task_entry) { process_grey_task_entry<true>(task_entry); }
inline void G1CMTask::push(G1TaskQueueEntry task_entry) {
assert(task_entry.is_array_slice() || _g1h->is_in_g1_reserved(task_entry.obj()), "invariant");
assert(task_entry.is_array_slice() || !_g1h->is_on_master_free_list(
_g1h->heap_region_containing(task_entry.obj())), "invariant");
@@ -165,11 +165,11 @@
// Check global finger.
return objAddr < global_finger;
}
template<bool scan>
-inline void G1CMTask::process_grey_object(G1TaskQueueEntry task_entry) {
+inline void G1CMTask::process_grey_task_entry(G1TaskQueueEntry task_entry) {
assert(scan || (task_entry.is_oop() && task_entry.obj()->is_typeArray()), "Skipping scan of grey non-typeArray");
assert(task_entry.is_array_slice() || _nextMarkBitMap->isMarked((HeapWord*)task_entry.obj()),
"Any stolen object should be a slice or marked");
if (scan) {
@@ -210,10 +210,11 @@
// past this object. In this case, the object will probably
// be visited when a task is scanning the region and will also
// be pushed on the stack. So, some duplicate work, but no
// correctness problems.
if (is_below_finger(obj, global_finger)) {
+ G1TaskQueueEntry entry = G1TaskQueueEntry::from_oop(obj);
if (obj->is_typeArray()) {
// Immediately process arrays of primitive types, rather
// than pushing on the mark stack. This keeps us from
// adding humongous objects to the mark stack that might
// be reclaimed before the entry is processed - see
@@ -221,13 +222,13 @@
// objects. The cost of the additional type test is
// mitigated by avoiding a trip through the mark stack,
// by only doing a bookkeeping update and avoiding the
// actual scan of the object - a typeArray contains no
// references, and the metadata is built-in.
- process_grey_object<false>(obj);
+ process_grey_task_entry<false>(entry);
} else {
- push(obj);
+ push(entry);
}
}
}
}
< prev index next >