src/share/vm/gc_implementation/g1/concurrentMark.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/_concurrentMark.cpp.incl"













  27 
  28 //
  29 // CMS Bit Map Wrapper
  30 
  31 CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter):
  32   _bm((uintptr_t*)NULL,0),
  33   _shifter(shifter) {
  34   _bmStartWord = (HeapWord*)(rs.base());
  35   _bmWordSize  = rs.size()/HeapWordSize;    // rs.size() is in bytes
  36   ReservedSpace brs(ReservedSpace::allocation_align_size_up(
  37                      (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
  38 
  39   guarantee(brs.is_reserved(), "couldn't allocate CMS bit map");
  40   // For now we'll just commit all of the bit map up fromt.
  41   // Later on we'll try to be more parsimonious with swap.
  42   guarantee(_virtual_space.initialize(brs, brs.size()),
  43             "couldn't reseve backing store for CMS bit map");
  44   assert(_virtual_space.committed_size() == brs.size(),
  45          "didn't reserve backing store for all of CMS bit map?");
  46   _bm.set_map((uintptr_t*)_virtual_space.low());




   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/symbolTable.hpp"
  27 #include "gc_implementation/g1/concurrentMark.hpp"
  28 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
  29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  30 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  31 #include "gc_implementation/g1/g1RemSet.hpp"
  32 #include "gc_implementation/g1/heapRegionRemSet.hpp"
  33 #include "gc_implementation/g1/heapRegionSeq.inline.hpp"
  34 #include "memory/genOopClosures.inline.hpp"
  35 #include "memory/referencePolicy.hpp"
  36 #include "memory/resourceArea.hpp"
  37 #include "oops/oop.inline.hpp"
  38 #include "runtime/handles.inline.hpp"
  39 #include "runtime/java.hpp"
  40 
  41 //
  42 // CMS Bit Map Wrapper
  43 
  44 CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter):
  45   _bm((uintptr_t*)NULL,0),
  46   _shifter(shifter) {
  47   _bmStartWord = (HeapWord*)(rs.base());
  48   _bmWordSize  = rs.size()/HeapWordSize;    // rs.size() is in bytes
  49   ReservedSpace brs(ReservedSpace::allocation_align_size_up(
  50                      (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
  51 
  52   guarantee(brs.is_reserved(), "couldn't allocate CMS bit map");
  53   // For now we'll just commit all of the bit map up fromt.
  54   // Later on we'll try to be more parsimonious with swap.
  55   guarantee(_virtual_space.initialize(brs, brs.size()),
  56             "couldn't reseve backing store for CMS bit map");
  57   assert(_virtual_space.committed_size() == brs.size(),
  58          "didn't reserve backing store for all of CMS bit map?");
  59   _bm.set_map((uintptr_t*)_virtual_space.low());