# HG changeset patch # User Roman Kennke # Date 1417803036 -3600 # Node ID d0c408606d420a1ff486f6b7ba632c7dd765d866 # Parent 5db692ef0ed9fc9da61f3f84f60d4a96ca5692e9 Update references in collection set when evacuation has been cancelled. diff -r 5db692ef0ed9 -r d0c408606d42 src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp --- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp Fri Dec 05 16:49:07 2014 +0100 +++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp Fri Dec 05 19:10:36 2014 +0100 @@ -1123,9 +1123,9 @@ void work(uint worker_id) { ShenandoahUpdateObjectsClosure update_refs_cl; ShenandoahHeapRegion* region = _regions->claim_next(); - + ShenandoahHeap* heap = ShenandoahHeap::heap(); while (region != NULL) { - if (! (region->is_in_collection_set() || region->is_humonguous_continuation())) { + if (! ((region->is_in_collection_set() && ! heap->cancelled_evacuation()) || region->is_humonguous_continuation())) { HeapWord* failed = region->object_iterate_careful(&update_refs_cl); assert(failed == NULL, "careful iteration is implemented safe for now in Shenandaoh"); } @@ -1444,7 +1444,8 @@ oop ShenandoahHeap::maybe_update_oop_ref(oop* p) { - assert((! is_in(p)) || (! heap_region_containing(p)->is_in_collection_set()), "never update refs in from-space"); + assert((! is_in(p)) || (! heap_region_containing(p)->is_in_collection_set()) || cancelled_evacuation(), + "never update refs in from-space, unless evacuation has been cancelled"); oop heap_oop = *p; // read p if (! oopDesc::is_null(heap_oop)) { @@ -1457,7 +1458,7 @@ } #endif assert(is_in(heap_oop), "only ever call this on objects in the heap"); - assert(! (is_in(p) && heap_region_containing(p)->is_in_collection_set()), "we don't want to update references in from-space"); + assert((! (is_in(p) && heap_region_containing(p)->is_in_collection_set())) || cancelled_evacuation(), "we don't want to update references in from-space"); oop forwarded_oop = ShenandoahBarrierSet::resolve_oop_static_not_null(heap_oop); // read brooks ptr if (forwarded_oop != heap_oop) { // tty->print_cr("updating old ref: %p pointing to %p to new ref: %p", p, heap_oop, forwarded_oop);