< prev index next >

src/hotspot/share/gc/g1/g1HotCardCache.cpp

Print this page




   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 "gc/g1/g1CardTableEntryClosure.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/g1DirtyCardQueue.hpp"
  29 #include "gc/g1/g1HotCardCache.hpp"
  30 #include "runtime/atomic.hpp"
  31 
  32 G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
  33   _g1h(g1h), _use_cache(false), _card_counts(g1h),
  34   _hot_cache(NULL), _hot_cache_size(0), _hot_cache_par_chunk_size(0),
  35   _hot_cache_idx(0), _hot_cache_par_claimed_idx(0)
  36 {}
  37 
  38 void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
  39   if (default_use_cache()) {
  40     _use_cache = true;
  41 
  42     _hot_cache_size = (size_t)1 << G1ConcRSLogCacheSize;
  43     _hot_cache = ArrayAllocator<CardValue*>::allocate(_hot_cache_size, mtGC);
  44 
  45     reset_hot_cache_internal();
  46 




   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 "gc/g1/g1CollectedHeap.inline.hpp"
  27 #include "gc/g1/g1DirtyCardQueue.hpp"
  28 #include "gc/g1/g1HotCardCache.hpp"
  29 #include "runtime/atomic.hpp"
  30 
  31 G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
  32   _g1h(g1h), _use_cache(false), _card_counts(g1h),
  33   _hot_cache(NULL), _hot_cache_size(0), _hot_cache_par_chunk_size(0),
  34   _hot_cache_idx(0), _hot_cache_par_claimed_idx(0)
  35 {}
  36 
  37 void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
  38   if (default_use_cache()) {
  39     _use_cache = true;
  40 
  41     _hot_cache_size = (size_t)1 << G1ConcRSLogCacheSize;
  42     _hot_cache = ArrayAllocator<CardValue*>::allocate(_hot_cache_size, mtGC);
  43 
  44     reset_hot_cache_internal();
  45 


< prev index next >