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_implementation/parallelScavenge/parallelScavengeHeap.hpp"
29 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
30 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
31 #include "gc_implementation/shared/gcTimer.hpp"
32 #include "gc_implementation/shared/gcTraceTime.hpp"
33 #include "gc_interface/collectedHeap.hpp"
34 #include "memory/universe.hpp"
35 #include "oops/objArrayKlass.inline.hpp"
36 #include "oops/oop.inline.hpp"
37 #include "oops/oop.pcgc.inline.hpp"
38 #include "prims/jvmtiExport.hpp"
39 #include "runtime/fprofiler.hpp"
40 #include "runtime/jniHandles.hpp"
41 #include "runtime/thread.hpp"
42 #include "runtime/vmThread.hpp"
43 #include "services/management.hpp"
44
45 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
46
47 //
48 // ThreadRootsMarkingTask
49 //
50
51 void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
52 assert(Universe::heap()->is_gc_active(), "called outside gc");
53
54 ResourceMark rm;
55
56 NOT_PRODUCT(GCTraceTime tm("ThreadRootsMarkingTask",
57 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
204 //
205
206 StealMarkingTask::StealMarkingTask(ParallelTaskTerminator* t) :
207 _terminator(t) {}
208
209 void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
210 assert(Universe::heap()->is_gc_active(), "called outside gc");
211
212 NOT_PRODUCT(GCTraceTime tm("StealMarkingTask",
213 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
214
215 ParCompactionManager* cm =
216 ParCompactionManager::gc_thread_compaction_manager(which);
217 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
218
219 oop obj = NULL;
220 ObjArrayTask task;
221 int random_seed = 17;
222 do {
223 while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
224 ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass();
225 k->oop_follow_contents(cm, task.obj(), task.index());
226 cm->follow_marking_stacks();
227 }
228 while (ParCompactionManager::steal(which, &random_seed, obj)) {
229 obj->follow_contents(cm);
230 cm->follow_marking_stacks();
231 }
232 } while (!terminator()->offer_termination());
233 }
234
235 //
236 // StealRegionCompactionTask
237 //
238
239 StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
240 _terminator(t) {}
241
242 void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
243 assert(Universe::heap()->is_gc_active(), "called outside gc");
244
245 NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask",
246 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
247
248 ParCompactionManager* cm =
249 ParCompactionManager::gc_thread_compaction_manager(which);
|
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_implementation/parallelScavenge/parallelScavengeHeap.hpp"
29 #include "gc_implementation/parallelScavenge/pcTasks.hpp"
30 #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
31 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
32 #include "gc_implementation/shared/gcTimer.hpp"
33 #include "gc_implementation/shared/gcTraceTime.hpp"
34 #include "gc_interface/collectedHeap.hpp"
35 #include "memory/universe.hpp"
36 #include "oops/objArrayKlass.inline.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "prims/jvmtiExport.hpp"
39 #include "runtime/fprofiler.hpp"
40 #include "runtime/jniHandles.hpp"
41 #include "runtime/thread.hpp"
42 #include "runtime/vmThread.hpp"
43 #include "services/management.hpp"
44
45 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
46
47 //
48 // ThreadRootsMarkingTask
49 //
50
51 void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
52 assert(Universe::heap()->is_gc_active(), "called outside gc");
53
54 ResourceMark rm;
55
56 NOT_PRODUCT(GCTraceTime tm("ThreadRootsMarkingTask",
57 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
204 //
205
206 StealMarkingTask::StealMarkingTask(ParallelTaskTerminator* t) :
207 _terminator(t) {}
208
209 void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
210 assert(Universe::heap()->is_gc_active(), "called outside gc");
211
212 NOT_PRODUCT(GCTraceTime tm("StealMarkingTask",
213 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
214
215 ParCompactionManager* cm =
216 ParCompactionManager::gc_thread_compaction_manager(which);
217 PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
218
219 oop obj = NULL;
220 ObjArrayTask task;
221 int random_seed = 17;
222 do {
223 while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
224 cm->follow_contents((objArrayOop)task.obj(), task.index());
225 cm->follow_marking_stacks();
226 }
227 while (ParCompactionManager::steal(which, &random_seed, obj)) {
228 cm->follow_contents(obj);
229 cm->follow_marking_stacks();
230 }
231 } while (!terminator()->offer_termination());
232 }
233
234 //
235 // StealRegionCompactionTask
236 //
237
238 StealRegionCompactionTask::StealRegionCompactionTask(ParallelTaskTerminator* t):
239 _terminator(t) {}
240
241 void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) {
242 assert(Universe::heap()->is_gc_active(), "called outside gc");
243
244 NOT_PRODUCT(GCTraceTime tm("StealRegionCompactionTask",
245 PrintGCDetails && TraceParallelOldGCTasks, true, NULL, PSParallelCompact::gc_tracer()->gc_id()));
246
247 ParCompactionManager* cm =
248 ParCompactionManager::gc_thread_compaction_manager(which);
|