< prev index next >

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

Print this page
rev 49290 : [mq]: JDK-8199735.01.patch


 264     return handle_evacuation_failure_par(old, old_mark);
 265   }
 266 #endif // !PRODUCT
 267 
 268   // We're going to allocate linearly, so might as well prefetch ahead.
 269   Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
 270 
 271   const oop obj = oop(obj_ptr);
 272   const oop forward_ptr = old->forward_to_atomic(obj);
 273   if (forward_ptr == NULL) {
 274     Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
 275 
 276     if (dest_state.is_young()) {
 277       if (age < markOopDesc::max_age) {
 278         age++;
 279       }
 280       if (old_mark->has_displaced_mark_helper()) {
 281         // In this case, we have to install the mark word first,
 282         // otherwise obj looks to be forwarded (the old mark word,
 283         // which contains the forward pointer, was copied)
 284         obj->set_mark(old_mark);
 285         markOop new_mark = old_mark->displaced_mark_helper()->set_age(age);
 286         old_mark->set_displaced_mark_helper(new_mark);
 287       } else {
 288         obj->set_mark(old_mark->set_age(age));
 289       }
 290       _age_table.add(age, word_sz);
 291     } else {
 292       obj->set_mark(old_mark);
 293     }
 294 
 295     if (G1StringDedup::is_enabled()) {
 296       const bool is_from_young = state.is_young();
 297       const bool is_to_young = dest_state.is_young();
 298       assert(is_from_young == _g1h->heap_region_containing(old)->is_young(),
 299              "sanity");
 300       assert(is_to_young == _g1h->heap_region_containing(obj)->is_young(),
 301              "sanity");
 302       G1StringDedup::enqueue_from_evacuation(is_from_young,
 303                                              is_to_young,
 304                                              _worker_id,
 305                                              obj);
 306     }
 307 
 308     _surviving_young_words[young_index] += word_sz;
 309 
 310     if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) {
 311       // We keep track of the next start index in the length field of
 312       // the to-space object. The actual length can be found in the




 264     return handle_evacuation_failure_par(old, old_mark);
 265   }
 266 #endif // !PRODUCT
 267 
 268   // We're going to allocate linearly, so might as well prefetch ahead.
 269   Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes);
 270 
 271   const oop obj = oop(obj_ptr);
 272   const oop forward_ptr = old->forward_to_atomic(obj);
 273   if (forward_ptr == NULL) {
 274     Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz);
 275 
 276     if (dest_state.is_young()) {
 277       if (age < markOopDesc::max_age) {
 278         age++;
 279       }
 280       if (old_mark->has_displaced_mark_helper()) {
 281         // In this case, we have to install the mark word first,
 282         // otherwise obj looks to be forwarded (the old mark word,
 283         // which contains the forward pointer, was copied)
 284         obj->set_mark_raw(old_mark);
 285         markOop new_mark = old_mark->displaced_mark_helper()->set_age(age);
 286         old_mark->set_displaced_mark_helper(new_mark);
 287       } else {
 288         obj->set_mark_raw(old_mark->set_age(age));
 289       }
 290       _age_table.add(age, word_sz);
 291     } else {
 292       obj->set_mark_raw(old_mark);
 293     }
 294 
 295     if (G1StringDedup::is_enabled()) {
 296       const bool is_from_young = state.is_young();
 297       const bool is_to_young = dest_state.is_young();
 298       assert(is_from_young == _g1h->heap_region_containing(old)->is_young(),
 299              "sanity");
 300       assert(is_to_young == _g1h->heap_region_containing(obj)->is_young(),
 301              "sanity");
 302       G1StringDedup::enqueue_from_evacuation(is_from_young,
 303                                              is_to_young,
 304                                              _worker_id,
 305                                              obj);
 306     }
 307 
 308     _surviving_young_words[young_index] += word_sz;
 309 
 310     if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) {
 311       // We keep track of the next start index in the length field of
 312       // the to-space object. The actual length can be found in the


< prev index next >