< prev index next >
src/share/vm/gc/shared/space.cpp
Print this page
rev 8961 : [mq]: diff-shenandoah.patch
@@ -390,11 +390,11 @@
compaction_max_size = pointer_delta(cp->space->end(), compact_top);
}
// 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
// mark and handle it specially later on.
q->init_mark();
@@ -629,12 +629,15 @@
}
}
// 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) {
HeapWord* new_top = obj + size;
set_top(new_top);
< prev index next >