< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.cpp

Print this page
*** 845,11 ***
      // when a promotion failure has occurred.  In that
      // case there can be live objects in to-space
      // as a result of a partial evacuation of eden
      // and from-space.
      swap_spaces();   // For uniformity wrt ParNewGeneration.
!     from()->set_next_compaction_space(to());
      heap->set_incremental_collection_failed();
  
      // Inform the next generation that a promotion failure occurred.
      _old_gen->promotion_failure_occurred();
      _gc_tracer->report_promotion_failed(_promotion_failed_info);
--- 845,20 ---
      // when a promotion failure has occurred.  In that
      // case there can be live objects in to-space
      // as a result of a partial evacuation of eden
      // and from-space.
      swap_spaces();   // For uniformity wrt ParNewGeneration.
!     // Ensure that compaction spaces are in address-order.
+     if (from()->bottom() < to()->bottom()) {
+       eden()->set_next_compaction_space(from());
+       from()->set_next_compaction_space(to());
+       to()->set_next_compaction_space(nullptr);
+     } else {
+       eden()->set_next_compaction_space(to());
+       to()->set_next_compaction_space(from());
+       from()->set_next_compaction_space(nullptr);
+     }
      heap->set_incremental_collection_failed();
  
      // Inform the next generation that a promotion failure occurred.
      _old_gen->promotion_failure_occurred();
      _gc_tracer->report_promotion_failed(_promotion_failed_info);

*** 880,11 ***
    // of objs in young-gen so that no objs are marked (forwarded) when Full GC
    // starts. (The mark word is overloaded: `is_marked()` == `is_forwarded()`.)
    struct ResetForwardedMarkWord : ObjectClosure {
      void do_object(oop obj) override {
        if (obj->is_forwarded()) {
!         obj->init_mark();
        }
      }
    } cl;
    eden()->object_iterate(&cl);
    from()->object_iterate(&cl);
--- 889,25 ---
    // of objs in young-gen so that no objs are marked (forwarded) when Full GC
    // starts. (The mark word is overloaded: `is_marked()` == `is_forwarded()`.)
    struct ResetForwardedMarkWord : ObjectClosure {
      void do_object(oop obj) override {
        if (obj->is_forwarded()) {
! #ifdef _LP64
+         if (UseCompactObjectHeaders) {
+           oop forwardee = obj->forwardee();
+           markWord header = forwardee->mark();
+           if (header.has_displaced_mark_helper()) {
+             header = header.displaced_mark_helper();
+           }
+           assert(UseCompressedClassPointers, "assume +UseCompressedClassPointers");
+           narrowKlass nklass = header.narrow_klass();
+           obj->set_mark(markWord::prototype().set_narrow_klass(nklass));
+         } else
+ #endif
+         {
+           obj->init_mark();
+         }
        }
      }
    } cl;
    eden()->object_iterate(&cl);
    from()->object_iterate(&cl);

*** 904,11 ***
    _preserved_marks_set.get()->push_if_necessary(old, old->mark());
  
    ContinuationGCSupport::transform_stack_chunk(old);
  
    // forward to self
!   old->forward_to(old);
  
    _promo_failure_scan_stack.push(old);
  
    if (!_promo_failure_drain_in_progress) {
      // prevent recursion in copy_to_survivor_space()
--- 927,11 ---
    _preserved_marks_set.get()->push_if_necessary(old, old->mark());
  
    ContinuationGCSupport::transform_stack_chunk(old);
  
    // forward to self
!   old->forward_to_self();
  
    _promo_failure_scan_stack.push(old);
  
    if (!_promo_failure_drain_in_progress) {
      // prevent recursion in copy_to_survivor_space()
< prev index next >