--- old/src/share/vm/gc/parallel/asPSYoungGen.cpp 2017-06-22 11:12:05.068661575 +0200 +++ new/src/share/vm/gc/parallel/asPSYoungGen.cpp 2017-06-22 11:12:04.880655546 +0200 @@ -419,9 +419,9 @@ "from start moved to the right"); guarantee((HeapWord*)from_end >= from_space()->top(), "from end moved into live data"); - assert(is_object_aligned((intptr_t)eden_start), "checking alignment"); - assert(is_object_aligned((intptr_t)from_start), "checking alignment"); - assert(is_object_aligned((intptr_t)to_start), "checking alignment"); + assert(is_ptr_object_aligned(eden_start), "checking alignment"); + assert(is_ptr_object_aligned(from_start), "checking alignment"); + assert(is_ptr_object_aligned(to_start), "checking alignment"); MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end); MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end); --- old/src/share/vm/gc/parallel/mutableSpace.cpp 2017-06-22 11:12:05.328669914 +0200 +++ new/src/share/vm/gc/parallel/mutableSpace.cpp 2017-06-22 11:12:05.156664398 +0200 @@ -177,7 +177,7 @@ if (pointer_delta(end(), obj) >= size) { HeapWord* new_top = obj + size; set_top(new_top); - assert(is_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top), + assert(is_ptr_object_aligned(obj) && is_ptr_object_aligned(new_top), "checking alignment"); return obj; } else { @@ -198,7 +198,7 @@ if (result != obj) { continue; // another thread beat us to the allocation, try again } - assert(is_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top), + assert(is_ptr_object_aligned(obj) && is_ptr_object_aligned(new_top), "checking alignment"); return obj; } else { --- old/src/share/vm/gc/parallel/psParallelCompact.inline.hpp 2017-06-22 11:12:05.564677483 +0200 +++ new/src/share/vm/gc/parallel/psParallelCompact.inline.hpp 2017-06-22 11:12:05.404672352 +0200 @@ -88,7 +88,7 @@ inline void PSParallelCompact::check_new_location(HeapWord* old_addr, HeapWord* new_addr) { assert(old_addr >= new_addr || space_id(old_addr) != space_id(new_addr), "must move left or to a different space"); - assert(is_object_aligned((intptr_t)old_addr) && is_object_aligned((intptr_t)new_addr), + assert(is_ptr_object_aligned(old_addr) && is_ptr_object_aligned(new_addr), "checking alignment"); } #endif // ASSERT --- old/src/share/vm/gc/parallel/psPromotionLAB.hpp 2017-06-22 11:12:05.780684411 +0200 +++ new/src/share/vm/gc/parallel/psPromotionLAB.hpp 2017-06-22 11:12:05.624679408 +0200 @@ -122,7 +122,7 @@ // The 'new_top>obj' check is needed to detect overflow of obj+size. if (new_top > obj && new_top <= end()) { set_top(new_top); - assert(is_object_aligned((intptr_t)obj) && is_object_aligned((intptr_t)new_top), + assert(is_ptr_object_aligned(obj) && is_ptr_object_aligned(new_top), "checking alignment"); _start_array->allocate_block(obj); return obj; --- old/src/share/vm/gc/parallel/psPromotionLAB.inline.hpp 2017-06-22 11:12:06.008691724 +0200 +++ new/src/share/vm/gc/parallel/psPromotionLAB.inline.hpp 2017-06-22 11:12:05.844686464 +0200 @@ -40,7 +40,7 @@ // The 'new_top>obj' check is needed to detect overflow of obj+size. if (new_top > obj && new_top <= end()) { set_top(new_top); - assert(is_ptr_aligned(obj, SurvivorAlignmentInBytes) && is_object_aligned((intptr_t)new_top), + assert(is_ptr_aligned(obj, SurvivorAlignmentInBytes) && is_ptr_object_aligned(new_top), "checking alignment"); return obj; } else { --- old/src/share/vm/gc/parallel/psYoungGen.cpp 2017-06-22 11:12:06.240699164 +0200 +++ new/src/share/vm/gc/parallel/psYoungGen.cpp 2017-06-22 11:12:06.076693904 +0200 @@ -193,9 +193,9 @@ char *from_end = from_start + survivor_size; assert(from_end == virtual_space()->high(), "just checking"); - assert(is_object_aligned((intptr_t)eden_start), "checking alignment"); - assert(is_object_aligned((intptr_t)to_start), "checking alignment"); - assert(is_object_aligned((intptr_t)from_start), "checking alignment"); + assert(is_ptr_object_aligned(eden_start), "checking alignment"); + assert(is_ptr_object_aligned(to_start), "checking alignment"); + assert(is_ptr_object_aligned(from_start), "checking alignment"); MemRegion eden_mr((HeapWord*)eden_start, (HeapWord*)to_start); MemRegion to_mr ((HeapWord*)to_start, (HeapWord*)from_start); @@ -611,9 +611,9 @@ "from start moved to the right"); guarantee((HeapWord*)from_end >= from_space()->top(), "from end moved into live data"); - assert(is_object_aligned((intptr_t)eden_start), "checking alignment"); - assert(is_object_aligned((intptr_t)from_start), "checking alignment"); - assert(is_object_aligned((intptr_t)to_start), "checking alignment"); + assert(is_ptr_object_aligned(eden_start), "checking alignment"); + assert(is_ptr_object_aligned(from_start), "checking alignment"); + assert(is_ptr_object_aligned(to_start), "checking alignment"); MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end); MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end); --- old/src/share/vm/utilities/globalDefinitions.hpp 2017-06-22 11:12:06.508707760 +0200 +++ new/src/share/vm/utilities/globalDefinitions.hpp 2017-06-22 11:12:06.336702244 +0200 @@ -528,6 +528,10 @@ return addr == align_object_size(addr); } +inline bool is_ptr_object_aligned(const void* addr) { + return is_ptr_aligned(addr, MinObjAlignmentInBytes); +} + // Pad out certain offsets to jlong alignment, in HeapWord units. inline intptr_t align_object_offset(intptr_t offset) {