8145671: Rename FromCardCache to G1FromCardCache

Reviewed-by: jmasa, mgerdin
This commit is contained in:
Thomas Schatzl 2015-12-21 12:04:32 +01:00
parent 8188ad75a7
commit 5e297b4308
4 changed files with 15 additions and 15 deletions

View File

@ -28,11 +28,11 @@
#include "memory/padded.inline.hpp" #include "memory/padded.inline.hpp"
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
int** FromCardCache::_cache = NULL; int** G1FromCardCache::_cache = NULL;
uint FromCardCache::_max_regions = 0; uint G1FromCardCache::_max_regions = 0;
size_t FromCardCache::_static_mem_size = 0; size_t G1FromCardCache::_static_mem_size = 0;
void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { void G1FromCardCache::initialize(uint n_par_rs, uint max_num_regions) {
guarantee(_cache == NULL, "Should not call this multiple times"); guarantee(_cache == NULL, "Should not call this multiple times");
_max_regions = max_num_regions; _max_regions = max_num_regions;
@ -43,7 +43,7 @@ void FromCardCache::initialize(uint n_par_rs, uint max_num_regions) {
invalidate(0, _max_regions); invalidate(0, _max_regions);
} }
void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
guarantee((size_t)start_idx + new_num_regions <= max_uintx, guarantee((size_t)start_idx + new_num_regions <= max_uintx,
"Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT,
start_idx, new_num_regions); start_idx, new_num_regions);
@ -57,7 +57,7 @@ void FromCardCache::invalidate(uint start_idx, size_t new_num_regions) {
} }
#ifndef PRODUCT #ifndef PRODUCT
void FromCardCache::print(outputStream* out) { void G1FromCardCache::print(outputStream* out) {
for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) {
for (uint j = 0; j < _max_regions; j++) { for (uint j = 0; j < _max_regions; j++) {
out->print_cr("_from_card_cache[%u][%u] = %d.", out->print_cr("_from_card_cache[%u][%u] = %d.",
@ -67,7 +67,7 @@ void FromCardCache::print(outputStream* out) {
} }
#endif #endif
void FromCardCache::clear(uint region_idx) { void G1FromCardCache::clear(uint region_idx) {
uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets();
for (uint i = 0; i < num_par_remsets; i++) { for (uint i = 0; i < num_par_remsets; i++) {
set(i, region_idx, InvalidCard); set(i, region_idx, InvalidCard);

View File

@ -28,9 +28,9 @@
#include "memory/allocation.hpp" #include "memory/allocation.hpp"
#include "utilities/ostream.hpp" #include "utilities/ostream.hpp"
// The FromCardCache remembers the most recently processed card on the heap on // G1FromCardCache remembers the most recently processed card on the heap on
// a per-region and per-thread basis. // a per-region and per-thread basis.
class FromCardCache : public AllStatic { class G1FromCardCache : public AllStatic {
private: private:
// Array of card indices. Indexed by thread X and heap region to minimize // Array of card indices. Indexed by thread X and heap region to minimize
// thread contention. // thread contention.

View File

@ -356,7 +356,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) {
int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift);
if (FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) { if (G1FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) {
assert(contains_reference(from), "We just added it!"); assert(contains_reference(from), "We just added it!");
return; return;
} }
@ -622,7 +622,7 @@ size_t OtherRegionsTable::mem_size() const {
} }
size_t OtherRegionsTable::static_mem_size() { size_t OtherRegionsTable::static_mem_size() {
return FromCardCache::static_mem_size(); return G1FromCardCache::static_mem_size();
} }
size_t OtherRegionsTable::fl_mem_size() { size_t OtherRegionsTable::fl_mem_size() {
@ -630,7 +630,7 @@ size_t OtherRegionsTable::fl_mem_size() {
} }
void OtherRegionsTable::clear_fcc() { void OtherRegionsTable::clear_fcc() {
FromCardCache::clear(_hr->hrm_index()); G1FromCardCache::clear(_hr->hrm_index());
} }
void OtherRegionsTable::clear() { void OtherRegionsTable::clear() {

View File

@ -324,16 +324,16 @@ public:
// Declare the heap size (in # of regions) to the HeapRegionRemSet(s). // Declare the heap size (in # of regions) to the HeapRegionRemSet(s).
// (Uses it to initialize from_card_cache). // (Uses it to initialize from_card_cache).
static void init_heap(uint max_regions) { static void init_heap(uint max_regions) {
FromCardCache::initialize(num_par_rem_sets(), max_regions); G1FromCardCache::initialize(num_par_rem_sets(), max_regions);
} }
static void invalidate_from_card_cache(uint start_idx, size_t num_regions) { static void invalidate_from_card_cache(uint start_idx, size_t num_regions) {
FromCardCache::invalidate(start_idx, num_regions); G1FromCardCache::invalidate(start_idx, num_regions);
} }
#ifndef PRODUCT #ifndef PRODUCT
static void print_from_card_cache() { static void print_from_card_cache() {
FromCardCache::print(); G1FromCardCache::print();
} }
#endif #endif