src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2008, 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 inline void CMSBitMap::clear_all() {
  26   assert_locked();
  27   // CMS bitmaps are usually cover large memory regions
  28   _bm.clear_large();
  29   return;
  30 }
  31 
  32 inline size_t CMSBitMap::heapWordToOffset(HeapWord* addr) const {
  33   return (pointer_delta(addr, _bmStartWord)) >> _shifter;
  34 }
  35 
  36 inline HeapWord* CMSBitMap::offsetToHeapWord(size_t offset) const {
  37   return _bmStartWord + (offset << _shifter);
  38 }
  39 
  40 inline size_t CMSBitMap::heapWordDiffToOffsetDiff(size_t diff) const {
  41   assert((diff & ((1 << _shifter) - 1)) == 0, "argument check");
  42   return diff >> _shifter;
  43 }
  44 


 488 }
 489 
 490 
 491 inline void ModUnionClosure::do_MemRegion(MemRegion mr) {
 492   // Align the end of mr so it's at a card boundary.
 493   // This is superfluous except at the end of the space;
 494   // we should do better than this XXX
 495   MemRegion mr2(mr.start(), (HeapWord*)round_to((intptr_t)mr.end(),
 496                  CardTableModRefBS::card_size /* bytes */));
 497   _t->mark_range(mr2);
 498 }
 499 
 500 inline void ModUnionClosurePar::do_MemRegion(MemRegion mr) {
 501   // Align the end of mr so it's at a card boundary.
 502   // This is superfluous except at the end of the space;
 503   // we should do better than this XXX
 504   MemRegion mr2(mr.start(), (HeapWord*)round_to((intptr_t)mr.end(),
 505                  CardTableModRefBS::card_size /* bytes */));
 506   _t->par_mark_range(mr2);
 507 }


   1 /*
   2  * Copyright (c) 2001, 2010, 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_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP
  27 
  28 #include "gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp"
  29 #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp"
  30 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
  31 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp"
  32 #include "gc_implementation/shared/gcUtil.hpp"
  33 #include "memory/defNewGeneration.hpp"
  34 
  35 inline void CMSBitMap::clear_all() {
  36   assert_locked();
  37   // CMS bitmaps are usually cover large memory regions
  38   _bm.clear_large();
  39   return;
  40 }
  41 
  42 inline size_t CMSBitMap::heapWordToOffset(HeapWord* addr) const {
  43   return (pointer_delta(addr, _bmStartWord)) >> _shifter;
  44 }
  45 
  46 inline HeapWord* CMSBitMap::offsetToHeapWord(size_t offset) const {
  47   return _bmStartWord + (offset << _shifter);
  48 }
  49 
  50 inline size_t CMSBitMap::heapWordDiffToOffsetDiff(size_t diff) const {
  51   assert((diff & ((1 << _shifter) - 1)) == 0, "argument check");
  52   return diff >> _shifter;
  53 }
  54 


 498 }
 499 
 500 
 501 inline void ModUnionClosure::do_MemRegion(MemRegion mr) {
 502   // Align the end of mr so it's at a card boundary.
 503   // This is superfluous except at the end of the space;
 504   // we should do better than this XXX
 505   MemRegion mr2(mr.start(), (HeapWord*)round_to((intptr_t)mr.end(),
 506                  CardTableModRefBS::card_size /* bytes */));
 507   _t->mark_range(mr2);
 508 }
 509 
 510 inline void ModUnionClosurePar::do_MemRegion(MemRegion mr) {
 511   // Align the end of mr so it's at a card boundary.
 512   // This is superfluous except at the end of the space;
 513   // we should do better than this XXX
 514   MemRegion mr2(mr.start(), (HeapWord*)round_to((intptr_t)mr.end(),
 515                  CardTableModRefBS::card_size /* bytes */));
 516   _t->par_mark_range(mr2);
 517 }
 518 
 519 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_CONCURRENTMARKSWEEPGENERATION_INLINE_HPP