< prev index next >

src/hotspot/share/gc/shared/preservedMarks.cpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 22,10 ***
--- 22,11 ---
   *
   */
  
  #include "precompiled.hpp"
  #include "gc/shared/preservedMarks.inline.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
  #include "gc/shared/workerThread.hpp"
  #include "gc/shared/workerUtils.hpp"
  #include "memory/allocation.inline.hpp"
  #include "memory/resourceArea.hpp"
  #include "oops/oop.inline.hpp"

*** 38,22 ***
      elem.set_mark();
    }
    assert_empty();
  }
  
! void PreservedMarks::adjust_preserved_mark(PreservedMark* elem) {
!   oop obj = elem->get_oop();
!   if (obj->is_forwarded()) {
!     elem->set_oop(obj->forwardee());
    }
  }
  
  void PreservedMarks::adjust_during_full_gc() {
!   StackIterator<PreservedMark, mtGC> iter(_stack);
!   while (!iter.is_empty()) {
!     PreservedMark* elem = iter.next_addr();
!     adjust_preserved_mark(elem);
    }
  }
  
  void PreservedMarks::restore_and_increment(volatile size_t* const total_size_addr) {
    const size_t stack_size = size();
--- 39,24 ---
      elem.set_mark();
    }
    assert_empty();
  }
  
! template <bool ALT_FWD>
! void PreservedMarks::adjust_during_full_gc_impl() {
!   StackIterator<PreservedMark, mtGC> iter(_stack);
!   while (!iter.is_empty()) {
+     PreservedMark* elem = iter.next_addr();
+     adjust_preserved_mark<ALT_FWD>(elem);
    }
  }
  
  void PreservedMarks::adjust_during_full_gc() {
!   if (UseAltGCForwarding) {
!     adjust_during_full_gc_impl<true>();
!   } else {
!     adjust_during_full_gc_impl<false>();
    }
  }
  
  void PreservedMarks::restore_and_increment(volatile size_t* const total_size_addr) {
    const size_t stack_size = size();
< prev index next >