hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp
changeset 46618 d503911aa948
parent 42598 45562c0473fb
child 46619 a3919f5e8d2b
--- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Wed Apr 12 13:05:59 2017 +0200
+++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp	Wed Apr 12 17:53:18 2017 +0200
@@ -212,10 +212,8 @@
     }
     // Align the end up to a page size (starts are already aligned).
     jbyte* const new_end = byte_after(new_region.last());
-    HeapWord* new_end_aligned =
-      (HeapWord*) align_size_up((uintptr_t)new_end, _page_size);
-    assert(new_end_aligned >= (HeapWord*) new_end,
-           "align up, but less");
+    HeapWord* new_end_aligned = (HeapWord*) align_ptr_up(new_end, _page_size);
+    assert((void*)new_end_aligned >= (void*) new_end, "align up, but less");
     // Check the other regions (excludes "ind") to ensure that
     // the new_end_aligned does not intrude onto the committed
     // space of another region.
@@ -370,8 +368,8 @@
 
 
 void CardTableModRefBS::dirty_MemRegion(MemRegion mr) {
-  assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
-  assert((HeapWord*)align_size_up  ((uintptr_t)mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
+  assert(align_ptr_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
+  assert(align_ptr_up  (mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
   jbyte* cur  = byte_for(mr.start());
   jbyte* last = byte_after(mr.last());
   while (cur < last) {
@@ -381,8 +379,8 @@
 }
 
 void CardTableModRefBS::invalidate(MemRegion mr) {
-  assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
-  assert((HeapWord*)align_size_up  ((uintptr_t)mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
+  assert(align_ptr_down(mr.start(), HeapWordSize) == mr.start(), "Unaligned start");
+  assert(align_ptr_up  (mr.end(),   HeapWordSize) == mr.end(),   "Unaligned end"  );
   for (int i = 0; i < _cur_covered_regions; i++) {
     MemRegion mri = mr.intersection(_covered[i]);
     if (!mri.is_empty()) dirty_MemRegion(mri);