hotspot/src/share/vm/oops/objArrayKlass.inline.hpp
template <class T>
void objArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
int index) {
{- -------------------------------------------
(1) PSParallelCompact::mark_and_push() で marking_stack にプッシュするのは,
最大で ObjArrayMarkingStride 個まで.
それ以上の部分は ParCompactionManager::push_objarray() で objarray に入れて, いったん pending にしておく.
---------------------------------------- -}
objArrayOop a = objArrayOop(obj);
const size_t len = size_t(a->length());
const size_t beg_index = size_t(index);
assert(beg_index < len || len == 0, "index too large");
const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
const size_t end_index = beg_index + stride;
T* const base = (T*)a->base();
T* const beg = base + beg_index;
T* const end = base + end_index;
// Push the non-NULL elements of the next stride on the marking stack.
for (T* e = beg; e < end; e++) {
PSParallelCompact::mark_and_push<T>(cm, e);
}
if (end_index < len) {
cm->push_objarray(a, end_index); // Push the continuation.
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.