src/hotspot/share/gc/g1/g1ConcurrentMark.hpp
changeset 49392 2956d0ece7a9
parent 48969 7eb296a8ce2c
child 49604 ca5978b8378b
equal deleted inserted replaced
49391:02076019c25d 49392:2956d0ece7a9
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    27 
    27 
    28 #include "gc/g1/g1ConcurrentMarkBitMap.hpp"
    28 #include "gc/g1/g1ConcurrentMarkBitMap.hpp"
    29 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.hpp"
    29 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.hpp"
    30 #include "gc/g1/heapRegionSet.hpp"
    30 #include "gc/g1/heapRegionSet.hpp"
    31 #include "gc/shared/taskqueue.hpp"
    31 #include "gc/shared/taskqueue.hpp"
       
    32 #include "memory/allocation.hpp"
    32 
    33 
    33 class ConcurrentGCTimer;
    34 class ConcurrentGCTimer;
    34 class ConcurrentMarkThread;
    35 class ConcurrentMarkThread;
    35 class G1CollectedHeap;
    36 class G1CollectedHeap;
    36 class G1CMTask;
    37 class G1CMTask;
    45 #pragma warning(disable:4522)
    46 #pragma warning(disable:4522)
    46 #endif
    47 #endif
    47 
    48 
    48 // This is a container class for either an oop or a continuation address for
    49 // This is a container class for either an oop or a continuation address for
    49 // mark stack entries. Both are pushed onto the mark stack.
    50 // mark stack entries. Both are pushed onto the mark stack.
    50 class G1TaskQueueEntry VALUE_OBJ_CLASS_SPEC {
    51 class G1TaskQueueEntry {
    51 private:
    52 private:
    52   void* _holder;
    53   void* _holder;
    53 
    54 
    54   static const uintptr_t ArraySliceBit = 1;
    55   static const uintptr_t ArraySliceBit = 1;
    55 
    56 
   125 // management. This wastes some space, but is negligible (< .1% with current sizing).
   126 // management. This wastes some space, but is negligible (< .1% with current sizing).
   126 //
   127 //
   127 // Memory management is done using a mix of tracking a high water-mark indicating
   128 // Memory management is done using a mix of tracking a high water-mark indicating
   128 // that all chunks at a lower address are valid chunks, and a singly linked free
   129 // that all chunks at a lower address are valid chunks, and a singly linked free
   129 // list connecting all empty chunks.
   130 // list connecting all empty chunks.
   130 class G1CMMarkStack VALUE_OBJ_CLASS_SPEC {
   131 class G1CMMarkStack {
   131 public:
   132 public:
   132   // Number of TaskQueueEntries that can fit in a single chunk.
   133   // Number of TaskQueueEntries that can fit in a single chunk.
   133   static const size_t EntriesPerChunk = 1024 - 1 /* One reference for the next pointer */;
   134   static const size_t EntriesPerChunk = 1024 - 1 /* One reference for the next pointer */;
   134 private:
   135 private:
   135   struct TaskQueueEntryChunk {
   136   struct TaskQueueEntryChunk {
   225 // root regions without having to mark them or do anything else to them.
   226 // root regions without having to mark them or do anything else to them.
   226 //
   227 //
   227 // Currently, we only support root region scanning once (at the start
   228 // Currently, we only support root region scanning once (at the start
   228 // of the marking cycle) and the root regions are all the survivor
   229 // of the marking cycle) and the root regions are all the survivor
   229 // regions populated during the initial-mark pause.
   230 // regions populated during the initial-mark pause.
   230 class G1CMRootRegions VALUE_OBJ_CLASS_SPEC {
   231 class G1CMRootRegions {
   231 private:
   232 private:
   232   const G1SurvivorRegions* _survivors;
   233   const G1SurvivorRegions* _survivors;
   233   G1ConcurrentMark*        _cm;
   234   G1ConcurrentMark*        _cm;
   234 
   235 
   235   volatile bool            _scan_in_progress;
   236   volatile bool            _scan_in_progress;