Skip to content

Commit

Permalink
Also remove ZRelocateRootTask and ZRootsIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
stefank committed Oct 12, 2020
1 parent 4616945 commit 12274fc
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 55 deletions.
2 changes: 0 additions & 2 deletions src/hotspot/share/gc/z/zHeapIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ ZHeapIterator::ZHeapIterator(uint nworkers, bool visit_weaks) :
_bitmaps_lock(),
_queues(nworkers),
_array_queues(nworkers),
_roots(),
_concurrent_roots(),
_weak_roots(),
_concurrent_weak_roots(),
Expand Down Expand Up @@ -341,7 +340,6 @@ void ZHeapIterator::drain_and_steal(const ZHeapIteratorContext& context, ObjectC

template <bool VisitWeaks>
void ZHeapIterator::object_iterate_inner(const ZHeapIteratorContext& context, ObjectClosure* cl) {
push_roots<false /* Concurrent */, false /* Weak */>(context, _roots);
push_roots<true /* Concurrent */, false /* Weak */>(context, _concurrent_roots);
if (VisitWeaks) {
push_roots<false /* Concurrent */, true /* Weak */>(context, _weak_roots);
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/z/zHeapIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class ZHeapIterator : public ParallelObjectIterator {
ZLock _bitmaps_lock;
ZHeapIteratorQueues _queues;
ZHeapIteratorArrayQueues _array_queues;
ZRootsIterator _roots;
ZConcurrentRootsIteratorClaimOther _concurrent_roots;
ZWeakRootsIterator _weak_roots;
ZConcurrentWeakRootsIterator _concurrent_weak_roots;
Expand Down
23 changes: 3 additions & 20 deletions src/hotspot/share/gc/z/zRelocate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const ZStatCounter ZCounterRelocationContention("Contention", "Relocation
ZRelocate::ZRelocate(ZWorkers* workers) :
_workers(workers) {}

class ZRelocateRootsIteratorClosure : public ZRootsIteratorClosure {
class ZRelocateRootsIteratorClosure : public OopClosure {
public:
virtual void do_oop(oop* p) {
ZBarrier::relocate_barrier_on_root_oop_field(p);
Expand All @@ -54,26 +54,9 @@ class ZRelocateRootsIteratorClosure : public ZRootsIteratorClosure {
}
};

class ZRelocateRootsTask : public ZTask {
private:
ZRootsIterator _roots;
ZRelocateRootsIteratorClosure _cl;

public:
ZRelocateRootsTask() :
ZTask("ZRelocateRootsTask"),
_roots(true /* visit_jvmti_weak_export */) {}

virtual void work() {
// During relocation we need to visit the JVMTI
// export weak roots to rehash the JVMTI tag map
_roots.oops_do(&_cl);
}
};

void ZRelocate::start() {
ZRelocateRootsTask task;
_workers->run_parallel(&task);
ZRelocateRootsIteratorClosure cl;
ZRelocateRoots::oops_do(&cl);
}

uintptr_t ZRelocate::relocate_object_inner(ZForwarding* forwarding, uintptr_t from_index, uintptr_t from_offset) const {
Expand Down
16 changes: 1 addition & 15 deletions src/hotspot/share/gc/z/zRootsIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include "runtime/vmThread.hpp"
#include "utilities/debug.hpp"

static const ZStatSubPhase ZSubPhasePauseRoots("Pause Roots");
static const ZStatSubPhase ZSubPhasePauseRootsJVMTIWeakExport("Pause Roots JVMTIWeakExport");

static const ZStatSubPhase ZSubPhaseConcurrentRootsSetup("Concurrent Roots Setup");
Expand Down Expand Up @@ -141,25 +140,12 @@ void ZJavaThreadsIterator::threads_do(ThreadClosure* cl) {
}
}

ZRootsIterator::ZRootsIterator(bool visit_jvmti_weak_export) :
_visit_jvmti_weak_export(visit_jvmti_weak_export),
_jvmti_weak_export(this) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
}

void ZRootsIterator::do_jvmti_weak_export(ZRootsIteratorClosure* cl) {
void ZRelocateRoots::oops_do(OopClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRootsJVMTIWeakExport);
AlwaysTrueClosure always_alive;
JvmtiExport::weak_oops_do(&always_alive, cl);
}

void ZRootsIterator::oops_do(ZRootsIteratorClosure* cl) {
ZStatTimer timer(ZSubPhasePauseRoots);
if (_visit_jvmti_weak_export) {
_jvmti_weak_export.oops_do(cl);
}
}

ZConcurrentRootsIterator::ZConcurrentRootsIterator(int cld_claim) :
_oop_storage_set_iter(),
_java_threads_iter(),
Expand Down
13 changes: 2 additions & 11 deletions src/hotspot/share/gc/z/zRootsIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,9 @@ class ZJavaThreadsIterator {
void threads_do(ThreadClosure* cl);
};

class ZRootsIterator {
private:
const bool _visit_jvmti_weak_export;

void do_jvmti_weak_export(ZRootsIteratorClosure* cl);

ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;

class ZRelocateRoots : public AllStatic {
public:
ZRootsIterator(bool visit_jvmti_weak_export = false);

void oops_do(ZRootsIteratorClosure* cl);
static void oops_do(OopClosure* cl);
};

class ZConcurrentRootsIterator {
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/gc/z/zVerify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,6 @@ void ZVerify::roots(bool verify_fixed) {
}
}

void ZVerify::roots_strong() {
roots<ZRootsIterator>(true /* verify_fixed */);
}

void ZVerify::roots_weak() {
roots<ZWeakRootsIterator>(true /* verify_fixed */);
}
Expand All @@ -246,7 +242,6 @@ void ZVerify::roots_concurrent_weak() {
}

void ZVerify::roots(bool verify_concurrent_strong, bool verify_weaks) {
roots_strong();
roots_concurrent_strong(verify_concurrent_strong);
if (verify_weaks) {
roots_weak();
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/z/zVerify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ZVerify : public AllStatic {
private:
template <typename RootsIterator> static void roots(bool verify_fixed);

static void roots_strong();
static void roots_weak();
static void roots_concurrent_strong(bool verify_fixed);
static void roots_concurrent_weak();
Expand Down

0 comments on commit 12274fc

Please sign in to comment.