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

Print this page




   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/_psTasks.cpp.incl"

















  27 
  28 //
  29 // ScavengeRootsTask
  30 //
  31 
  32 // Define before use
  33 class PSScavengeRootsClosure: public OopClosure {
  34  private:
  35   PSPromotionManager* _promotion_manager;
  36 
  37  protected:
  38   template <class T> void do_oop_work(T *p) {
  39     if (PSScavenge::should_scavenge(p)) {
  40       // We never card mark roots, maybe call a func without test?
  41       PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p);
  42     }
  43   }
  44  public:
  45   PSScavengeRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { }
  46   void do_oop(oop* p)       { PSScavengeRootsClosure::do_oop_work(p); }




   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/cardTableExtension.hpp"
  29 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp"
  30 #include "gc_implementation/parallelScavenge/psMarkSweep.hpp"
  31 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
  32 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
  33 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
  34 #include "gc_implementation/parallelScavenge/psTasks.hpp"
  35 #include "memory/iterator.hpp"
  36 #include "memory/universe.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "oops/oop.psgc.inline.hpp"
  39 #include "runtime/fprofiler.hpp"
  40 #include "runtime/thread.hpp"
  41 #include "runtime/vmThread.hpp"
  42 #include "services/management.hpp"
  43 #include "utilities/taskqueue.hpp"
  44 
  45 //
  46 // ScavengeRootsTask
  47 //
  48 
  49 // Define before use
  50 class PSScavengeRootsClosure: public OopClosure {
  51  private:
  52   PSPromotionManager* _promotion_manager;
  53 
  54  protected:
  55   template <class T> void do_oop_work(T *p) {
  56     if (PSScavenge::should_scavenge(p)) {
  57       // We never card mark roots, maybe call a func without test?
  58       PSScavenge::copy_and_push_safe_barrier(_promotion_manager, p);
  59     }
  60   }
  61  public:
  62   PSScavengeRootsClosure(PSPromotionManager* pm) : _promotion_manager(pm) { }
  63   void do_oop(oop* p)       { PSScavengeRootsClosure::do_oop_work(p); }