< prev index next >

src/share/vm/gc/g1/g1RootProcessor.hpp

Print this page
rev 13135 : imported patch 8175554-improve-g1updatersorpushrefclosure
rev 13136 : imported patch 8175554-kim-review
   1 /*
   2  * Copyright (c) 2015, 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 #ifndef SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
  26 #define SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
  27 
  28 #include "gc/shared/strongRootsScope.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/mutex.hpp"
  31 
  32 class CLDClosure;
  33 class CodeBlobClosure;
  34 class G1CollectedHeap;
  35 class G1EvacuationRootClosures;
  36 class G1GCPhaseTimes;
  37 class G1ParPushHeapRSClosure;
  38 class G1RootClosures;
  39 class Monitor;
  40 class OopClosure;
  41 class SubTasksDone;
  42 
  43 // Scoped object to assist in applying oop, CLD and code blob closures to
  44 // root locations. Handles claiming of different root scanning tasks
  45 // and takes care of global state for root scanning via a StrongRootsScope.
  46 // In the parallel case there is a shared G1RootProcessor object where all
  47 // worker thread call the process_roots methods.
  48 class G1RootProcessor : public StackObj {
  49   G1CollectedHeap* _g1h;
  50   SubTasksDone _process_strong_tasks;
  51   StrongRootsScope _srs;
  52 
  53   // Used to implement the Thread work barrier.
  54   Monitor _lock;
  55   volatile jint _n_workers_discovered_strong_classes;
  56 
  57   enum G1H_process_roots_tasks {


   1 /*
   2  * Copyright (c) 2015, 2017, 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 #ifndef SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
  26 #define SHARE_VM_GC_G1_G1ROOTPROCESSOR_HPP
  27 
  28 #include "gc/shared/strongRootsScope.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/mutex.hpp"
  31 
  32 class CLDClosure;
  33 class CodeBlobClosure;
  34 class G1CollectedHeap;
  35 class G1EvacuationRootClosures;
  36 class G1GCPhaseTimes;

  37 class G1RootClosures;
  38 class Monitor;
  39 class OopClosure;
  40 class SubTasksDone;
  41 
  42 // Scoped object to assist in applying oop, CLD and code blob closures to
  43 // root locations. Handles claiming of different root scanning tasks
  44 // and takes care of global state for root scanning via a StrongRootsScope.
  45 // In the parallel case there is a shared G1RootProcessor object where all
  46 // worker thread call the process_roots methods.
  47 class G1RootProcessor : public StackObj {
  48   G1CollectedHeap* _g1h;
  49   SubTasksDone _process_strong_tasks;
  50   StrongRootsScope _srs;
  51 
  52   // Used to implement the Thread work barrier.
  53   Monitor _lock;
  54   volatile jint _n_workers_discovered_strong_classes;
  55 
  56   enum G1H_process_roots_tasks {


< prev index next >