< prev index next >

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

Print this page
rev 59945 : [mq]: 8247819-stefank-review


   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_GC_G1_G1ROOTPROCESSOR_HPP
  26 #define SHARE_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 G1ParScanThreadState;
  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   enum G1H_process_roots_tasks {
  54     G1RP_PS_Universe_oops_do,
  55     G1RP_PS_JNIHandles_oops_do,
  56     G1RP_PS_ObjectSynchronizer_oops_do,
  57     G1RP_PS_Management_oops_do,
  58     G1RP_PS_VMGlobal_oops_do,
  59     G1RP_PS_ClassLoaderDataGraph_oops_do,
  60     G1RP_PS_jvmti_oops_do,
  61     G1RP_PS_CodeCache_oops_do,
  62     AOT_ONLY(G1RP_PS_aot_oops_do COMMA)
  63     G1RP_PS_refProcessor_oops_do,
  64     // Leave this one last.
  65     G1RP_PS_NumElements
  66   };
  67 
  68   void process_java_roots(G1RootClosures* closures,
  69                           G1GCPhaseTimes* phase_times,
  70                           uint worker_id);
  71 
  72   void process_vm_roots(G1RootClosures* closures,
  73                         G1GCPhaseTimes* phase_times,
  74                         uint worker_id);
  75 
  76   void process_code_cache_roots(CodeBlobClosure* code_closure,
  77                                 G1GCPhaseTimes* phase_times,
  78                                 uint worker_id);




   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_GC_G1_G1ROOTPROCESSOR_HPP
  26 #define SHARE_GC_G1_G1ROOTPROCESSOR_HPP
  27 
  28 #include "gc/shared/oopStorageSetParState.hpp"
  29 #include "gc/shared/strongRootsScope.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "runtime/mutex.hpp"
  32 
  33 class CLDClosure;
  34 class CodeBlobClosure;
  35 class G1CollectedHeap;
  36 class G1EvacuationRootClosures;
  37 class G1GCPhaseTimes;
  38 class G1ParScanThreadState;
  39 class G1RootClosures;
  40 class Monitor;
  41 class OopClosure;
  42 class SubTasksDone;
  43 
  44 // Scoped object to assist in applying oop, CLD and code blob closures to
  45 // root locations. Handles claiming of different root scanning tasks
  46 // and takes care of global state for root scanning via a StrongRootsScope.
  47 // In the parallel case there is a shared G1RootProcessor object where all
  48 // worker thread call the process_roots methods.
  49 class G1RootProcessor : public StackObj {
  50   G1CollectedHeap* _g1h;
  51   SubTasksDone _process_strong_tasks;
  52   StrongRootsScope _srs;
  53   OopStorageSetStrongParState<false, false> _oop_storage_set_strong_par_state;
  54 
  55   enum G1H_process_roots_tasks {
  56     G1RP_PS_Universe_oops_do,

  57     G1RP_PS_ObjectSynchronizer_oops_do,
  58     G1RP_PS_Management_oops_do,

  59     G1RP_PS_ClassLoaderDataGraph_oops_do,
  60     G1RP_PS_jvmti_oops_do,
  61     G1RP_PS_CodeCache_oops_do,
  62     AOT_ONLY(G1RP_PS_aot_oops_do COMMA)
  63     G1RP_PS_refProcessor_oops_do,
  64     // Leave this one last.
  65     G1RP_PS_NumElements
  66   };
  67 
  68   void process_java_roots(G1RootClosures* closures,
  69                           G1GCPhaseTimes* phase_times,
  70                           uint worker_id);
  71 
  72   void process_vm_roots(G1RootClosures* closures,
  73                         G1GCPhaseTimes* phase_times,
  74                         uint worker_id);
  75 
  76   void process_code_cache_roots(CodeBlobClosure* code_closure,
  77                                 G1GCPhaseTimes* phase_times,
  78                                 uint worker_id);


< prev index next >