6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/systemDictionary.hpp"
27 #include "code/codeCache.hpp"
28 #include "gc/parallel/cardTableExtension.hpp"
29 #include "gc/parallel/gcTaskManager.hpp"
30 #include "gc/parallel/psMarkSweep.hpp"
31 #include "gc/parallel/psPromotionManager.hpp"
32 #include "gc/parallel/psPromotionManager.inline.hpp"
33 #include "gc/parallel/psScavenge.inline.hpp"
34 #include "gc/parallel/psTasks.hpp"
35 #include "gc/shared/taskqueue.inline.hpp"
36 #include "memory/iterator.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "memory/universe.hpp"
39 #include "oops/oop.inline.hpp"
40 #include "runtime/fprofiler.hpp"
41 #include "runtime/thread.hpp"
42 #include "runtime/vmThread.hpp"
43 #include "services/management.hpp"
44
45 //
84 case class_loader_data:
85 {
86 PSScavengeKlassClosure klass_closure(pm);
87 ClassLoaderDataGraph::oops_do(&roots_closure, &klass_closure, false);
88 }
89 break;
90
91 case management:
92 Management::oops_do(&roots_closure);
93 break;
94
95 case jvmti:
96 JvmtiExport::oops_do(&roots_closure);
97 break;
98
99
100 case code_cache:
101 {
102 MarkingCodeBlobClosure each_scavengable_code_blob(&roots_to_old_closure, CodeBlobToOopClosure::FixRelocations);
103 CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
104 }
105 break;
106
107 default:
108 fatal("Unknown root type");
109 }
110
111 // Do the real work
112 pm->drain_stacks(false);
113 }
114
115 //
116 // ThreadRootsTask
117 //
118
119 void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
120 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
121
122 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
123 PSScavengeRootsClosure roots_closure(pm);
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "aot/aotLoader.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "code/codeCache.hpp"
29 #include "gc/parallel/cardTableExtension.hpp"
30 #include "gc/parallel/gcTaskManager.hpp"
31 #include "gc/parallel/psMarkSweep.hpp"
32 #include "gc/parallel/psPromotionManager.hpp"
33 #include "gc/parallel/psPromotionManager.inline.hpp"
34 #include "gc/parallel/psScavenge.inline.hpp"
35 #include "gc/parallel/psTasks.hpp"
36 #include "gc/shared/taskqueue.inline.hpp"
37 #include "memory/iterator.hpp"
38 #include "memory/resourceArea.hpp"
39 #include "memory/universe.hpp"
40 #include "oops/oop.inline.hpp"
41 #include "runtime/fprofiler.hpp"
42 #include "runtime/thread.hpp"
43 #include "runtime/vmThread.hpp"
44 #include "services/management.hpp"
45
46 //
85 case class_loader_data:
86 {
87 PSScavengeKlassClosure klass_closure(pm);
88 ClassLoaderDataGraph::oops_do(&roots_closure, &klass_closure, false);
89 }
90 break;
91
92 case management:
93 Management::oops_do(&roots_closure);
94 break;
95
96 case jvmti:
97 JvmtiExport::oops_do(&roots_closure);
98 break;
99
100
101 case code_cache:
102 {
103 MarkingCodeBlobClosure each_scavengable_code_blob(&roots_to_old_closure, CodeBlobToOopClosure::FixRelocations);
104 CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob);
105 AOTLoader::oops_do(&roots_closure);
106 }
107 break;
108
109 default:
110 fatal("Unknown root type");
111 }
112
113 // Do the real work
114 pm->drain_stacks(false);
115 }
116
117 //
118 // ThreadRootsTask
119 //
120
121 void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
122 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
123
124 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
125 PSScavengeRootsClosure roots_closure(pm);
|