< prev index next >

src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2017, 2022, 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) 2017, 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.

*** 30,10 ***
--- 30,11 ---
  #include "gc/g1/g1Allocator.inline.hpp"
  #include "gc/g1/g1FullCollector.inline.hpp"
  #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  #include "gc/g1/g1FullGCMarker.inline.hpp"
  #include "gc/g1/heapRegionRemSet.inline.hpp"
+ #include "gc/shared/slidingForwarding.inline.hpp"
  #include "memory/iterator.inline.hpp"
  #include "memory/universe.hpp"
  #include "oops/access.inline.hpp"
  #include "oops/compressedOops.inline.hpp"
  #include "oops/oop.inline.hpp"

*** 49,11 ***
  
  inline void G1MarkAndPushClosure::do_oop(narrowOop* p) {
    do_oop_work(p);
  }
  
! template <class T> inline void G1AdjustClosure::adjust_pointer(T* p) {
    T heap_oop = RawAccess<>::oop_load(p);
    if (CompressedOops::is_null(heap_oop)) {
      return;
    }
  
--- 50,12 ---
  
  inline void G1MarkAndPushClosure::do_oop(narrowOop* p) {
    do_oop_work(p);
  }
  
! template <bool ALT_FWD>
+ template <class T> inline void G1AdjustClosure<ALT_FWD>::adjust_pointer(T* p) {
    T heap_oop = RawAccess<>::oop_load(p);
    if (CompressedOops::is_null(heap_oop)) {
      return;
    }
  

*** 63,21 ***
      // We never forward objects in non-compacting regions so there is no need to
      // process them further.
      return;
    }
  
!   if (obj->is_forwarded()) {
!     oop forwardee = obj->forwardee();
      // Forwarded, just update.
      assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
      RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
    }
  
  }
  
! inline void G1AdjustClosure::do_oop(oop* p)       { do_oop_work(p); }
! inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); }
  
  inline bool G1IsAliveClosure::do_object_b(oop p) {
    return _bitmap->is_marked(p);
  }
  
--- 65,23 ---
      // We never forward objects in non-compacting regions so there is no need to
      // process them further.
      return;
    }
  
!   if (SlidingForwarding::is_forwarded(obj)) {
!     oop forwardee = SlidingForwarding::forwardee<ALT_FWD>(obj);
      // Forwarded, just update.
      assert(G1CollectedHeap::heap()->is_in_reserved(forwardee), "should be in object space");
      RawAccess<IS_NOT_NULL>::oop_store(p, forwardee);
    }
  
  }
  
! template <bool ALT_FWD>
! inline void G1AdjustClosure<ALT_FWD>::do_oop(oop* p)       { do_oop_work(p); }
+ template <bool ALT_FWD>
+ inline void G1AdjustClosure<ALT_FWD>::do_oop(narrowOop* p) { do_oop_work(p); }
  
  inline bool G1IsAliveClosure::do_object_b(oop p) {
    return _bitmap->is_marked(p);
  }
  
< prev index next >