src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp

Print this page


   1 /*
   2  * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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 "incls/_precompiled.incl"
  26 # include "incls/_pcTasks.cpp.incl"














  27 
  28 //
  29 // ThreadRootsMarkingTask
  30 //
  31 
  32 void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
  33   assert(Universe::heap()->is_gc_active(), "called outside gc");
  34 
  35   ResourceMark rm;
  36 
  37   NOT_PRODUCT(TraceTime tm("ThreadRootsMarkingTask",
  38     PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
  39   ParCompactionManager* cm =
  40     ParCompactionManager::gc_thread_compaction_manager(which);
  41   PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
  42   CodeBlobToOopClosure mark_and_push_in_blobs(&mark_and_push_closure, /*do_marking=*/ true);
  43 
  44   if (_java_thread != NULL)
  45     _java_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
  46 


   1 /*
   2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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_implementation/parallelScavenge/pcTasks.hpp"
  29 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
  30 #include "gc_interface/collectedHeap.hpp"
  31 #include "memory/universe.hpp"
  32 #include "oops/objArrayKlass.inline.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "oops/oop.pcgc.inline.hpp"
  35 #include "prims/jvmtiExport.hpp"
  36 #include "runtime/fprofiler.hpp"
  37 #include "runtime/jniHandles.hpp"
  38 #include "runtime/thread.hpp"
  39 #include "runtime/vmThread.hpp"
  40 #include "services/management.hpp"
  41 
  42 //
  43 // ThreadRootsMarkingTask
  44 //
  45 
  46 void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
  47   assert(Universe::heap()->is_gc_active(), "called outside gc");
  48 
  49   ResourceMark rm;
  50 
  51   NOT_PRODUCT(TraceTime tm("ThreadRootsMarkingTask",
  52     PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
  53   ParCompactionManager* cm =
  54     ParCompactionManager::gc_thread_compaction_manager(which);
  55   PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
  56   CodeBlobToOopClosure mark_and_push_in_blobs(&mark_and_push_closure, /*do_marking=*/ true);
  57 
  58   if (_java_thread != NULL)
  59     _java_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
  60