Skip to content

Instantly share code, notes, and snippets.

@jmiettinen
Created January 30, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmiettinen/1e1e8a0c71c2d1ae664335f1e875f227 to your computer and use it in GitHub Desktop.
Save jmiettinen/1e1e8a0c71c2d1ae664335f1e875f227 to your computer and use it in GitHub Desktop.
diff -r cc5c5ad8dd1c src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Tue Aug 15 14:03:52 2017 +0000
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Tue Jan 30 10:45:46 2018 +0200
@@ -364,7 +364,7 @@
"just checking");
}
-int** FromCardCache::_cache = NULL;
+long** FromCardCache::_cache = NULL;
uint FromCardCache::_max_regions = 0;
size_t FromCardCache::_static_mem_size = 0;
@@ -372,7 +372,7 @@
guarantee(_cache == NULL, "Should not call this multiple times");
_max_regions = max_num_regions;
- _cache = Padded2DArray<int, mtGC>::create_unfreeable(n_par_rs,
+ _cache = Padded2DArray<long, mtGC>::create_unfreeable(n_par_rs,
_max_regions,
&_static_mem_size);
@@ -396,7 +396,7 @@
void FromCardCache::print(outputStream* out) {
for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) {
for (uint j = 0; j < _max_regions; j++) {
- out->print_cr("_from_card_cache["UINT32_FORMAT"]["UINT32_FORMAT"] = "INT32_FORMAT".",
+ out->print_cr("_from_card_cache["UINT32_FORMAT"]["UINT32_FORMAT"] = "INT64_FORMAT".",
i, j, at(i, j));
}
}
@@ -433,10 +433,10 @@
: (void *)oopDesc::load_decode_heap_oop((oop*)from));
}
- int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift);
+ long from_card = ((long)from) >> CardTableModRefBS::card_shift;
if (G1TraceHeapRegionRememberedSet) {
- gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card %d (cache = "INT32_FORMAT")",
+ gclog_or_tty->print_cr("Table for [" PTR_FORMAT "...): card " INT64_FORMAT " (cache = "INT64_FORMAT")",
hr()->bottom(), from_card,
FromCardCache::at((uint)tid, cur_hrm_ind));
}
@@ -471,8 +471,8 @@
prt = find_region_table(ind, from_hr);
if (prt == NULL) {
- uintptr_t from_hr_bot_card_index =
- uintptr_t(from_hr->bottom())
+ long from_hr_bot_card_index =
+ ((long)from_hr->bottom())
>> CardTableModRefBS::card_shift;
CardIdx_t card_index = from_card - from_hr_bot_card_index;
assert(0 <= card_index && (size_t)card_index < HeapRegion::CardsPerRegion,
diff -r cc5c5ad8dd1c src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp
--- a/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Tue Aug 15 14:03:52 2017 +0000
+++ b/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp Tue Jan 30 10:45:46 2018 +0200
@@ -51,7 +51,7 @@
private:
// Array of card indices. Indexed by thread X and heap region to minimize
// thread contention.
- static int** _cache;
+ static long** _cache;
static uint _max_regions;
static size_t _static_mem_size;
@@ -64,8 +64,8 @@
// Returns true if the given card is in the cache at the given location, or
// replaces the card at that location and returns false.
- static bool contains_or_replace(uint worker_id, uint region_idx, int card) {
- int card_in_cache = at(worker_id, region_idx);
+ static bool contains_or_replace(uint worker_id, uint region_idx, long card) {
+ long card_in_cache = at(worker_id, region_idx);
if (card_in_cache == card) {
return true;
} else {
@@ -74,11 +74,11 @@
}
}
- static int at(uint worker_id, uint region_idx) {
+ static long at(uint worker_id, uint region_idx) {
return _cache[worker_id][region_idx];
}
- static void set(uint worker_id, uint region_idx, int val) {
+ static void set(uint worker_id, uint region_idx, long val) {
_cache[worker_id][region_idx] = val;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment