/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "memory/allocation.hpp"
#include "runtime/virtualspace.hpp"
#include "utilities/globalDefinitions.hpp"
class CardTableModRefBS;
class G1CollectedHeap;
class HeapRegion;
// Table to track the number of times a card has been refined. Once
// a card has been refined a certain number of times, it is
// considered 'hot' and its refinement is delayed by inserting the
// card into the hot card cache. The card will then be refined when
// it is evicted from the hot card cache, or when the hot card cache
// is 'drained' during the next evacuation pause.
// The table of counts
// Max capacity of the reserved space for the counts table
// Max capacity of the committed space for the counts table
// Size of committed space for the counts table
// CardTable bottom.
// Barrier set
// The virtual memory backing the counts table
// Returns true if the card counts table has been reserved.
// Returns true if the card counts table has been reserved and committed.
bool has_count_table() {
return has_reserved_count_table() && _committed_max_card_num > 0;
}
}
err_msg("Inavalied card pointer: "
"_ct_bot: " PTR_FORMAT,
return card_num;
}
}
// Helper routine.
// Returns the number of cards that can be counted by the given committed
// table size, with a maximum of the number of cards spanned by the max
// capacity of the heap.
}
// Clear the counts table for the given (exclusive) index range.
public:
~G1CardCounts();
void initialize();
// Resize the committed space for the card counts table in
// response to a resize of the committed space for the heap.
// Increments the refinement count for the given card.
// Returns the pre-increment count value.
// Returns true if the given count is high enough to be considered
// 'hot'; false otherwise.
// Clears the card counts for the cards spanned by the region
// Clear the entire card counts table during GC.
// Updates the policy stats with the duration.
void clear_all();
};
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1CARDCOUNTS_HPP