< prev index next > src/hotspot/share/gc/z/zMark.cpp
concurrent root iterator v2
concurrent root iterator
// 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;
virtual void work() {
_mark->work(_timeout_in_millis);
}
};
-void ZMark::mark() {
+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 >