changeset 7434:d0c408606d42

Update references in collection set when evacuation has been cancelled.
author Roman Kennke <rkennke@redhat.com>
date Fri, 05 Dec 2014 19:10:36 +0100
parents 5db692ef0ed9
children b0eed0b189c3
files src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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);