< prev index next >

src/hotspot/share/gc/z/zMark.cpp

concurrent root iterator v2

concurrent root iterator

*** 580,589 **** --- 580,606 ---- // Free remaining stacks stacks->free(&_allocator); } + class ZMarkConcurrentRootsTask : public ZTask { + private: + ZMark* const _mark; + ZConcurrentRootsIterator _roots; + + public: + ZMarkConcurrentRootsTask(ZMark* mark) : + ZTask("ZMarkConcurrentRootsTask"), + _mark(mark), + _roots() {} + + virtual void work() { + ZMarkBarrierOopClosure<false /* finalizable */> cl; + _roots.oops_do(&cl); + } + }; + class ZMarkTask : public ZTask { private: ZMark* const _mark; const uint64_t _timeout_in_millis; ***************
*** 602,612 **** virtual void work() { _mark->work(_timeout_in_millis); } }; ! void ZMark::mark() { ZMarkTask task(this); _workers->run_concurrent(&task); } bool ZMark::try_complete() { --- 619,634 ---- virtual void work() { _mark->work(_timeout_in_millis); } }; ! void ZMark::mark(bool initial) { ! if (initial) { ! ZMarkConcurrentRootsTask task(this); ! _workers->run_concurrent(&task); ! } ! ZMarkTask task(this); _workers->run_concurrent(&task); } bool ZMark::try_complete() {
< prev index next >