Concurrent class unloading
23 #include "precompiled.hpp"
24 #include "gc/z/zHeap.hpp"
25 #include "gc/z/zOopClosures.inline.hpp"
26 #include "gc/z/zPage.hpp"
27 #include "gc/z/zRelocate.hpp"
28 #include "gc/z/zRelocationSet.inline.hpp"
29 #include "gc/z/zRootsIterator.hpp"
30 #include "gc/z/zTask.hpp"
31 #include "gc/z/zWorkers.hpp"
32
33 ZRelocate::ZRelocate(ZWorkers* workers) :
34 _workers(workers) {}
35
36 class ZRelocateRootsTask : public ZTask {
37 private:
38 ZRootsIterator _roots;
39
40 public:
41 ZRelocateRootsTask() :
42 ZTask("ZRelocateRootsTask"),
43 _roots() {}
44
45 virtual void work() {
46 // During relocation we need to visit the JVMTI
47 // export weak roots to rehash the JVMTI tag map
48 ZRelocateRootOopClosure cl;
49 _roots.oops_do(&cl, true /* visit_jvmti_weak_export */);
50 }
51 };
52
53 void ZRelocate::start() {
54 ZRelocateRootsTask task;
55 _workers->run_parallel(&task);
56 }
57
58 class ZRelocateObjectClosure : public ObjectClosure {
59 private:
60 ZPage* const _page;
61
62 public:
|
23 #include "precompiled.hpp"
24 #include "gc/z/zHeap.hpp"
25 #include "gc/z/zOopClosures.inline.hpp"
26 #include "gc/z/zPage.hpp"
27 #include "gc/z/zRelocate.hpp"
28 #include "gc/z/zRelocationSet.inline.hpp"
29 #include "gc/z/zRootsIterator.hpp"
30 #include "gc/z/zTask.hpp"
31 #include "gc/z/zWorkers.hpp"
32
33 ZRelocate::ZRelocate(ZWorkers* workers) :
34 _workers(workers) {}
35
36 class ZRelocateRootsTask : public ZTask {
37 private:
38 ZRootsIterator _roots;
39
40 public:
41 ZRelocateRootsTask() :
42 ZTask("ZRelocateRootsTask"),
43 _roots(false) {}
44
45 virtual void work() {
46 // During relocation we need to visit the JVMTI
47 // export weak roots to rehash the JVMTI tag map
48 ZRelocateRootOopClosure cl;
49 _roots.oops_do(&cl, true /* visit_jvmti_weak_export */);
50 }
51 };
52
53 void ZRelocate::start() {
54 ZRelocateRootsTask task;
55 _workers->run_parallel(&task);
56 }
57
58 class ZRelocateObjectClosure : public ObjectClosure {
59 private:
60 ZPage* const _page;
61
62 public:
|