src/hotspot/share/gc/g1/g1HotCardCache.cpp
changeset 53747 13acc8e38a29
parent 51332 c25572739e7c
child 54110 f4f0dce5d0bb
equal deleted inserted replaced
53746:bdccafc038a2 53747:13acc8e38a29
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 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.
    21  * questions.
    21  * questions.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "gc/g1/dirtyCardQueue.hpp"
       
    27 #include "gc/g1/g1CollectedHeap.inline.hpp"
    26 #include "gc/g1/g1CollectedHeap.inline.hpp"
       
    27 #include "gc/g1/g1DirtyCardQueue.hpp"
    28 #include "gc/g1/g1HotCardCache.hpp"
    28 #include "gc/g1/g1HotCardCache.hpp"
    29 #include "runtime/atomic.hpp"
    29 #include "runtime/atomic.hpp"
    30 
    30 
    31 G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
    31 G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
    32   _g1h(g1h), _use_cache(false), _card_counts(g1h),
    32   _g1h(g1h), _use_cache(false), _card_counts(g1h),
    81                                         &_hot_cache[masked_index],
    81                                         &_hot_cache[masked_index],
    82                                         current_ptr);
    82                                         current_ptr);
    83   return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
    83   return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
    84 }
    84 }
    85 
    85 
    86 void G1HotCardCache::drain(CardTableEntryClosure* cl, uint worker_i) {
    86 void G1HotCardCache::drain(G1CardTableEntryClosure* cl, uint worker_i) {
    87   assert(default_use_cache(), "Drain only necessary if we use the hot card cache.");
    87   assert(default_use_cache(), "Drain only necessary if we use the hot card cache.");
    88 
    88 
    89   assert(_hot_cache != NULL, "Logic");
    89   assert(_hot_cache != NULL, "Logic");
    90   assert(!use_cache(), "cache should be disabled");
    90   assert(!use_cache(), "cache should be disabled");
    91 
    91