< prev index next >

src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

Print this page
*** 476,11 ***
    assert(!old_mark.is_forwarded(), "precondition");
    Klass* klass = UseCompactObjectHeaders
        ? old_mark.klass()
        : old->klass();
  
!   const size_t word_sz = old->size_given_klass(klass);
  
    // JNI only allows pinning of typeArrays, so we only need to keep those in place.
    if (region_attr.is_pinned() && klass->is_typeArray_klass()) {
      return handle_evacuation_failure_par(old, old_mark, word_sz, true /* cause_pinned */);
    }
--- 476,12 ---
    assert(!old_mark.is_forwarded(), "precondition");
    Klass* klass = UseCompactObjectHeaders
        ? old_mark.klass()
        : old->klass();
  
!   const size_t old_size = old->size_given_mark_and_klass(old_mark, klass);
+   const size_t word_sz = old->copy_size(old_size, old_mark);
  
    // JNI only allows pinning of typeArrays, so we only need to keep those in place.
    if (region_attr.is_pinned() && klass->is_typeArray_klass()) {
      return handle_evacuation_failure_par(old, old_mark, word_sz, true /* cause_pinned */);
    }

*** 514,11 ***
      return handle_evacuation_failure_par(old, old_mark, word_sz, false /* cause_pinned */);
    }
  
    // We're going to allocate linearly, so might as well prefetch ahead.
    Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
!   Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, word_sz);
  
    const oop obj = cast_to_oop(obj_ptr);
    // Because the forwarding is done with memory_order_relaxed there is no
    // ordering with the above copy.  Clients that get the forwardee must not
    // examine its contents without other synchronization, since the contents
--- 515,11 ---
      return handle_evacuation_failure_par(old, old_mark, word_sz, false /* cause_pinned */);
    }
  
    // We're going to allocate linearly, so might as well prefetch ahead.
    Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
!   Copy::aligned_disjoint_words(cast_from_oop<HeapWord*>(old), obj_ptr, old_size);
  
    const oop obj = cast_to_oop(obj_ptr);
    // Because the forwarding is done with memory_order_relaxed there is no
    // ordering with the above copy.  Clients that get the forwardee must not
    // examine its contents without other synchronization, since the contents

*** 531,10 ***
--- 532,12 ---
        assert((from_region->is_young() && young_index >  0) ||
               (!from_region->is_young() && young_index == 0), "invariant" );
        _surviving_young_words[young_index] += word_sz;
      }
  
+     obj->initialize_hash_if_necessary(old);
+ 
      if (dest_attr.is_young()) {
        if (age < markWord::max_age) {
          age++;
          obj->incr_age();
        }
< prev index next >