< prev index next >

src/hotspot/share/gc/cms/cmsCardTable.cpp

Print this page




  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 "gc/cms/cmsCardTable.hpp"
  27 #include "gc/cms/cmsHeap.hpp"
  28 #include "gc/shared/cardTableBarrierSet.hpp"
  29 #include "gc/shared/cardTableRS.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "gc/shared/space.inline.hpp"
  32 #include "memory/allocation.inline.hpp"
  33 #include "memory/virtualspace.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "runtime/java.hpp"
  36 #include "runtime/mutexLocker.hpp"
  37 #include "runtime/orderAccess.inline.hpp"
  38 #include "runtime/vmThread.hpp"
  39 
  40 CMSCardTable::CMSCardTable(MemRegion whole_heap) :
  41     CardTableRS(whole_heap, CMSPrecleaningEnabled /* scanned_concurrently */) {
  42 }
  43 
  44 // Returns the number of chunks necessary to cover "mr".
  45 size_t CMSCardTable::chunks_to_cover(MemRegion mr) {
  46   return (size_t)(addr_to_chunk_index(mr.last()) -
  47                   addr_to_chunk_index(mr.start()) + 1);
  48 }
  49 
  50 // Returns the index of the chunk in a stride which
  51 // covers the given address.
  52 uintptr_t CMSCardTable::addr_to_chunk_index(const void* addr) {
  53   uintptr_t card = (uintptr_t) byte_for(addr);
  54   return card / ParGCCardsPerStrideChunk;
  55 }
  56 
  57 void CMSCardTable::




  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 "gc/cms/cmsCardTable.hpp"
  27 #include "gc/cms/cmsHeap.hpp"
  28 #include "gc/shared/cardTableBarrierSet.hpp"
  29 #include "gc/shared/cardTableRS.hpp"
  30 #include "gc/shared/collectedHeap.hpp"
  31 #include "gc/shared/space.inline.hpp"
  32 #include "memory/allocation.inline.hpp"
  33 #include "memory/virtualspace.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "runtime/java.hpp"
  36 #include "runtime/mutexLocker.hpp"
  37 #include "runtime/orderAccess.hpp"
  38 #include "runtime/vmThread.hpp"
  39 
  40 CMSCardTable::CMSCardTable(MemRegion whole_heap) :
  41     CardTableRS(whole_heap, CMSPrecleaningEnabled /* scanned_concurrently */) {
  42 }
  43 
  44 // Returns the number of chunks necessary to cover "mr".
  45 size_t CMSCardTable::chunks_to_cover(MemRegion mr) {
  46   return (size_t)(addr_to_chunk_index(mr.last()) -
  47                   addr_to_chunk_index(mr.start()) + 1);
  48 }
  49 
  50 // Returns the index of the chunk in a stride which
  51 // covers the given address.
  52 uintptr_t CMSCardTable::addr_to_chunk_index(const void* addr) {
  53   uintptr_t card = (uintptr_t) byte_for(addr);
  54   return card / ParGCCardsPerStrideChunk;
  55 }
  56 
  57 void CMSCardTable::


< prev index next >