src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.hpp
changeset 49392 2956d0ece7a9
parent 47885 5caa1d5f74c1
child 49644 50a01910e00a
equal deleted inserted replaced
49391:02076019c25d 49392:2956d0ece7a9
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 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.
    24 
    24 
    25 #ifndef SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP
    25 #ifndef SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP
    26 #define SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP
    26 #define SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_HPP
    27 
    27 
    28 #include "gc/g1/g1RegionToSpaceMapper.hpp"
    28 #include "gc/g1/g1RegionToSpaceMapper.hpp"
    29 #include "memory/allocation.hpp"
       
    30 #include "memory/memRegion.hpp"
    29 #include "memory/memRegion.hpp"
    31 #include "oops/oopsHierarchy.hpp"
    30 #include "oops/oopsHierarchy.hpp"
    32 #include "utilities/bitMap.hpp"
    31 #include "utilities/bitMap.hpp"
    33 #include "utilities/globalDefinitions.hpp"
    32 #include "utilities/globalDefinitions.hpp"
    34 #include "utilities/macros.hpp"
    33 #include "utilities/macros.hpp"
    37 class G1CMTask;
    36 class G1CMTask;
    38 class G1ConcurrentMark;
    37 class G1ConcurrentMark;
    39 class HeapRegion;
    38 class HeapRegion;
    40 
    39 
    41 // Closure for iteration over bitmaps
    40 // Closure for iteration over bitmaps
    42 class G1CMBitMapClosure VALUE_OBJ_CLASS_SPEC {
    41 class G1CMBitMapClosure {
    43 private:
    42 private:
    44   G1ConcurrentMark* const _cm;
    43   G1ConcurrentMark* const _cm;
    45   G1CMTask* const _task;
    44   G1CMTask* const _task;
    46 public:
    45 public:
    47   G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _task(task), _cm(cm) { }
    46   G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _task(task), _cm(cm) { }
    60   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
    59   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
    61 };
    60 };
    62 
    61 
    63 // A generic mark bitmap for concurrent marking.  This is essentially a wrapper
    62 // A generic mark bitmap for concurrent marking.  This is essentially a wrapper
    64 // around the BitMap class that is based on HeapWords, with one bit per (1 << _shifter) HeapWords.
    63 // around the BitMap class that is based on HeapWords, with one bit per (1 << _shifter) HeapWords.
    65 class G1CMBitMap VALUE_OBJ_CLASS_SPEC {
    64 class G1CMBitMap {
    66 private:
    65 private:
    67   MemRegion _covered;    // The heap area covered by this bitmap.
    66   MemRegion _covered;    // The heap area covered by this bitmap.
    68 
    67 
    69   const int _shifter;    // Shift amount from heap index to bit index in the bitmap.
    68   const int _shifter;    // Shift amount from heap index to bit index in the bitmap.
    70 
    69