src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp
changeset 54264 41af8d0546bc
parent 53116 bb03098c4dde
child 59060 fce1fa1bdc91
equal deleted inserted replaced
54263:3cabb47758c9 54264:41af8d0546bc
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, 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.
   203                                                          size_t alloc_granularity,
   203                                                          size_t alloc_granularity,
   204                                                          size_t commit_factor,
   204                                                          size_t commit_factor,
   205                                                          MemoryType type) :
   205                                                          MemoryType type) :
   206   G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type),
   206   G1RegionToSpaceMapper(rs, actual_size, page_size, alloc_granularity, commit_factor, type),
   207   _rs(rs),
   207   _rs(rs),
       
   208   _dram_mapper(NULL),
   208   _num_committed_dram(0),
   209   _num_committed_dram(0),
   209   _num_committed_nvdimm(0),
   210   _num_committed_nvdimm(0),
       
   211   _start_index_of_dram(0),
   210   _page_size(page_size),
   212   _page_size(page_size),
   211   _commit_factor(commit_factor),
   213   _commit_factor(commit_factor),
   212   _type(type) {
   214   _type(type) {
   213   assert(actual_size == 2 * MaxHeapSize, "For 2-way heterogenuous heap, reserved space is two times MaxHeapSize");
   215   assert(actual_size == 2 * MaxHeapSize, "For 2-way heterogenuous heap, reserved space is two times MaxHeapSize");
   214 }
   216 }
   246     _dram_mapper = new G1RegionsLargerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
   248     _dram_mapper = new G1RegionsLargerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
   247   } else {
   249   } else {
   248     _dram_mapper = new G1RegionsSmallerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
   250     _dram_mapper = new G1RegionsSmallerThanCommitSizeMapper(rs_dram, rs_dram.size(), _page_size, _region_granularity, _commit_factor, _type);
   249   }
   251   }
   250 
   252 
   251   _start_index_of_nvdimm = 0;
       
   252   _start_index_of_dram = (uint)(rs_nvdimm.size() / _region_granularity);
   253   _start_index_of_dram = (uint)(rs_nvdimm.size() / _region_granularity);
   253   return true;
   254   return true;
   254 }
   255 }
   255 
   256 
   256 void G1RegionToHeteroSpaceMapper::commit_regions(uint start_idx, size_t num_regions, WorkGang* pretouch_gang) {
   257 void G1RegionToHeteroSpaceMapper::commit_regions(uint start_idx, size_t num_regions, WorkGang* pretouch_gang) {