# HG changeset patch # User shade # Date 1492613168 -7200 # Wed Apr 19 16:46:08 2017 +0200 # Node ID 3b2e6a63336f11891bf266ecff726d7b9eacd80a # Parent a9e9a19a0412b5c37eb272f942ccda9464ca235b Import from Shenandoah tag aarch64-shenandoah-jdk8u121-b14-shenandoah-merge-2017-03-23 diff --git a/src/share/vm/asm/assembler.cpp b/src/share/vm/asm/assembler.cpp --- a/src/share/vm/asm/assembler.cpp +++ b/src/share/vm/asm/assembler.cpp @@ -319,17 +319,13 @@ if (UseShenandoahGC) { #ifdef AARCH64 // AArch64 uses 48-bit addresses - const unsigned long address_bits = 0xfffffffffffful; + const uintptr_t address_bits = (uintptr_t)0xfffffffffffful; #elif defined(_LP64) -#ifdef _WINDOWS - const unsigned long long address_bits = 0xffffffffffffffffull; -#else - const unsigned long address_bits = 0xfffffffffffffffful; -#endif // _WINDOWS + const uintptr_t address_bits = ~(uintptr_t)0; #else // Shenandoah is not implemented on these platforms, make sure we build fine, // but also crash consistently at runtime. - const unsigned long address_bits = 0; + const uintptr_t address_bits = 0; ShouldNotReachHere(); #endif if ((offset & address_bits) == (BrooksPointer::byte_offset() & address_bits)) { diff --git a/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp b/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp --- a/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp +++ b/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp @@ -47,7 +47,7 @@ static int compare_by_garbage(RegionGarbage a, RegionGarbage b) { if (a.garbage > b.garbage) return -1; - else if (b.garbage < a.garbage) + else if (a.garbage < b.garbage) return 1; else return 0; } diff --git a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.hpp b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.hpp --- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.hpp +++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.hpp @@ -68,13 +68,13 @@ // Convert to jint with sanity checking inline static jint region_size_bytes_jint() { - assert (ShenandoahHeapRegion::RegionSizeBytes <= max_jint, "sanity"); + assert (ShenandoahHeapRegion::RegionSizeBytes <= (size_t)max_jint, "sanity"); return (jint)ShenandoahHeapRegion::RegionSizeBytes; } // Convert to jint with sanity checking inline static jint region_size_shift_jint() { - assert (ShenandoahHeapRegion::RegionSizeShift <= max_jint, "sanity"); + assert (ShenandoahHeapRegion::RegionSizeShift <= (size_t)max_jint, "sanity"); return (jint)ShenandoahHeapRegion::RegionSizeShift; } diff --git a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.inline.hpp b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.inline.hpp --- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.inline.hpp +++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.inline.hpp @@ -28,7 +28,7 @@ #include "runtime/atomic.hpp" inline void ShenandoahHeapRegion::increase_live_data_words(size_t s) { - assert (s <= max_jint, "sanity"); + assert (s <= (size_t)max_jint, "sanity"); increase_live_data_words((jint)s); }