--- old/src/share/vm/gc/shared/space.cpp 2015-10-08 22:15:44.878370626 +0200 +++ new/src/share/vm/gc/shared/space.cpp 2015-10-08 22:15:44.828371820 +0200 @@ -392,7 +392,7 @@ // store the forwarding pointer into the mark word if ((HeapWord*)q != compact_top) { - q->forward_to(oop(compact_top)); + q->forward_to(compact_oop(compact_top)); assert(q->is_gc_marked(), "encoding the pointer should preserve the mark"); } else { // if the object isn't moving we can just set the mark to the default @@ -631,8 +631,11 @@ // This version requires locking. inline HeapWord* ContiguousSpace::allocate_impl(size_t size) { + // Shenandoah is currently partitioning by region so this assertion + // is too strong. If we move to a smaller granularity we will + // need to revisit this. assert(Heap_lock->owned_by_self() || - (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread()), + (SafepointSynchronize::is_at_safepoint() && (Thread::current()->is_VM_thread() || UseShenandoahGC)), "not locked"); HeapWord* obj = top(); if (pointer_delta(end(), obj) >= size) {