annotate src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # include "incls/_precompiled.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # include "incls/_pcTasks.cpp.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 //
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // ThreadRootsMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
30 //
a61af66fc99e Initial load
duke
parents:
diff changeset
31
a61af66fc99e Initial load
duke
parents:
diff changeset
32 void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
33 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 NOT_PRODUCT(TraceTime tm("ThreadRootsMarkingTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
38 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
39 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
40 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
41 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 if (_java_thread != NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
44 _java_thread->oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 if (_vm_thread != NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _vm_thread->oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Do the real work
a61af66fc99e Initial load
duke
parents:
diff changeset
50 cm->drain_marking_stacks(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 }
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
55 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 NOT_PRODUCT(TraceTime tm("MarkFromRootsTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
58 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
60 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // cm->allocate_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
62 assert(cm->stacks_have_been_allocated(),
a61af66fc99e Initial load
duke
parents:
diff changeset
63 "Stack space has not been allocated");
a61af66fc99e Initial load
duke
parents:
diff changeset
64 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 switch (_root_type) {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 case universe:
a61af66fc99e Initial load
duke
parents:
diff changeset
68 Universe::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
69 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 case reference_processing:
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ReferenceProcessor::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 case jni_handles:
a61af66fc99e Initial load
duke
parents:
diff changeset
76 JNIHandles::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
77 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 case threads:
a61af66fc99e Initial load
duke
parents:
diff changeset
80 {
a61af66fc99e Initial load
duke
parents:
diff changeset
81 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 Threads::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 case object_synchronizer:
a61af66fc99e Initial load
duke
parents:
diff changeset
87 ObjectSynchronizer::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 case flat_profiler:
a61af66fc99e Initial load
duke
parents:
diff changeset
91 FlatProfiler::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 case management:
a61af66fc99e Initial load
duke
parents:
diff changeset
95 Management::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 case jvmti:
a61af66fc99e Initial load
duke
parents:
diff changeset
99 JvmtiExport::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
100 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 case system_dictionary:
a61af66fc99e Initial load
duke
parents:
diff changeset
103 SystemDictionary::always_strong_oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 case vm_symbols:
a61af66fc99e Initial load
duke
parents:
diff changeset
107 vmSymbols::oops_do(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
111 fatal("Unknown root type");
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // Do the real work
a61af66fc99e Initial load
duke
parents:
diff changeset
115 cm->drain_marking_stacks(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // cm->deallocate_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 //
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // RefProcTaskProxy
a61af66fc99e Initial load
duke
parents:
diff changeset
122 //
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 void RefProcTaskProxy::do_it(GCTaskManager* manager, uint which)
a61af66fc99e Initial load
duke
parents:
diff changeset
125 {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
127
a61af66fc99e Initial load
duke
parents:
diff changeset
128 NOT_PRODUCT(TraceTime tm("RefProcTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
129 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
130 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
131 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // cm->allocate_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
133 assert(cm->stacks_have_been_allocated(),
a61af66fc99e Initial load
duke
parents:
diff changeset
134 "Stack space has not been allocated");
a61af66fc99e Initial load
duke
parents:
diff changeset
135 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
136 PSParallelCompact::FollowStackClosure follow_stack_closure(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _rp_task.work(_work_id, *PSParallelCompact::is_alive_closure(),
a61af66fc99e Initial load
duke
parents:
diff changeset
138 mark_and_push_closure, follow_stack_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 //
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // RefProcTaskExecutor
a61af66fc99e Initial load
duke
parents:
diff changeset
143 //
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void RefProcTaskExecutor::execute(ProcessTask& task)
a61af66fc99e Initial load
duke
parents:
diff changeset
146 {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 ParallelScavengeHeap* heap = PSParallelCompact::gc_heap();
a61af66fc99e Initial load
duke
parents:
diff changeset
148 uint parallel_gc_threads = heap->gc_task_manager()->workers();
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
149 ChunkTaskQueueSet* qset = ParCompactionManager::chunk_array();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
150 ParallelTaskTerminator terminator(parallel_gc_threads, qset);
a61af66fc99e Initial load
duke
parents:
diff changeset
151 GCTaskQueue* q = GCTaskQueue::create();
a61af66fc99e Initial load
duke
parents:
diff changeset
152 for(uint i=0; i<parallel_gc_threads; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 q->enqueue(new RefProcTaskProxy(task, i));
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
a61af66fc99e Initial load
duke
parents:
diff changeset
155 if (task.marks_oops_alive()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 if (parallel_gc_threads>1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 for (uint j=0; j<parallel_gc_threads; j++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 q->enqueue(new StealMarkingTask(&terminator));
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160 }
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 PSParallelCompact::gc_task_manager()->execute_and_wait(q);
a61af66fc99e Initial load
duke
parents:
diff changeset
163 }
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 void RefProcTaskExecutor::execute(EnqueueTask& task)
a61af66fc99e Initial load
duke
parents:
diff changeset
166 {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 ParallelScavengeHeap* heap = PSParallelCompact::gc_heap();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 uint parallel_gc_threads = heap->gc_task_manager()->workers();
a61af66fc99e Initial load
duke
parents:
diff changeset
169 GCTaskQueue* q = GCTaskQueue::create();
a61af66fc99e Initial load
duke
parents:
diff changeset
170 for(uint i=0; i<parallel_gc_threads; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 q->enqueue(new RefEnqueueTaskProxy(task, i));
a61af66fc99e Initial load
duke
parents:
diff changeset
172 }
a61af66fc99e Initial load
duke
parents:
diff changeset
173 PSParallelCompact::gc_task_manager()->execute_and_wait(q);
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 //
a61af66fc99e Initial load
duke
parents:
diff changeset
177 // StealMarkingTask
a61af66fc99e Initial load
duke
parents:
diff changeset
178 //
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 StealMarkingTask::StealMarkingTask(ParallelTaskTerminator* t) :
a61af66fc99e Initial load
duke
parents:
diff changeset
181 _terminator(t) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 NOT_PRODUCT(TraceTime tm("StealMarkingTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
187 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
190 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
191 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 oop obj = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 int random_seed = 17;
a61af66fc99e Initial load
duke
parents:
diff changeset
195 while(true) {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 if (ParCompactionManager::steal(which, &random_seed, obj)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
197 obj->follow_contents(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
198 cm->drain_marking_stacks(&mark_and_push_closure);
a61af66fc99e Initial load
duke
parents:
diff changeset
199 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 if (terminator()->offer_termination()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
201 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 }
a61af66fc99e Initial load
duke
parents:
diff changeset
203 }
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 //
a61af66fc99e Initial load
duke
parents:
diff changeset
208 // StealChunkCompactionTask
a61af66fc99e Initial load
duke
parents:
diff changeset
209 //
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 StealChunkCompactionTask::StealChunkCompactionTask(ParallelTaskTerminator* t) :
a61af66fc99e Initial load
duke
parents:
diff changeset
213 _terminator(t) {};
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 void StealChunkCompactionTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 NOT_PRODUCT(TraceTime tm("StealChunkCompactionTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
219 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
222 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // Has to drain stacks first because there may be chunks on
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // preloaded onto the stack and this thread may never have
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // done a draining task. Are the draining tasks needed?
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 cm->drain_chunk_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 size_t chunk_index = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
231 int random_seed = 17;
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 // If we're the termination task, try 10 rounds of stealing before
a61af66fc99e Initial load
duke
parents:
diff changeset
234 // setting the termination flag
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 while(true) {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 if (ParCompactionManager::steal(which, &random_seed, chunk_index)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
238 PSParallelCompact::fill_and_update_chunk(cm, chunk_index);
a61af66fc99e Initial load
duke
parents:
diff changeset
239 cm->drain_chunk_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
240 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
241 if (terminator()->offer_termination()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
243 }
a61af66fc99e Initial load
duke
parents:
diff changeset
244 // Go around again.
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 }
a61af66fc99e Initial load
duke
parents:
diff changeset
247 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
248 }
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 UpdateDensePrefixTask::UpdateDensePrefixTask(
a61af66fc99e Initial load
duke
parents:
diff changeset
251 PSParallelCompact::SpaceId space_id,
a61af66fc99e Initial load
duke
parents:
diff changeset
252 size_t chunk_index_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
253 size_t chunk_index_end) :
a61af66fc99e Initial load
duke
parents:
diff changeset
254 _space_id(space_id), _chunk_index_start(chunk_index_start),
a61af66fc99e Initial load
duke
parents:
diff changeset
255 _chunk_index_end(chunk_index_end)
a61af66fc99e Initial load
duke
parents:
diff changeset
256 {}
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 void UpdateDensePrefixTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
259
a61af66fc99e Initial load
duke
parents:
diff changeset
260 NOT_PRODUCT(TraceTime tm("UpdateDensePrefixTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
261 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
264 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 PSParallelCompact::update_and_deadwood_in_dense_prefix(cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
267 _space_id,
a61af66fc99e Initial load
duke
parents:
diff changeset
268 _chunk_index_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 _chunk_index_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) {
a61af66fc99e Initial load
duke
parents:
diff changeset
273 assert(Universe::heap()->is_gc_active(), "called outside gc");
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 NOT_PRODUCT(TraceTime tm("DrainStacksCompactionTask",
a61af66fc99e Initial load
duke
parents:
diff changeset
276 PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 ParCompactionManager* cm =
a61af66fc99e Initial load
duke
parents:
diff changeset
279 ParCompactionManager::gc_thread_compaction_manager(which);
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 // Process any chunks already in the compaction managers stacks.
a61af66fc99e Initial load
duke
parents:
diff changeset
282 cm->drain_chunk_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
283 }