< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2015, 2022, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. 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.

*** 40,19 ***
  };
  
  class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure {
  private:
    ShenandoahObjToScanQueue* _queue;
    ShenandoahMarkingContext* const _mark_context;
    bool _weak;
  
  protected:
!   template <class T>
    void work(T *p);
  
  public:
!   ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp);
  
    bool is_weak() const {
      return _weak;
    }
  
--- 41,20 ---
  };
  
  class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure {
  private:
    ShenandoahObjToScanQueue* _queue;
+   ShenandoahObjToScanQueue* _old_queue;
    ShenandoahMarkingContext* const _mark_context;
    bool _weak;
  
  protected:
!   template <class T, ShenandoahGenerationType GENERATION>
    void work(T *p);
  
  public:
!   ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q);
  
    bool is_weak() const {
      return _weak;
    }
  

*** 68,48 ***
  
  class ShenandoahMarkUpdateRefsSuperClosure : public ShenandoahMarkRefsSuperClosure {
  protected:
    ShenandoahHeap* const _heap;
  
!   template <class T>
    inline void work(T* p);
  
  public:
!   ShenandoahMarkUpdateRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
!     ShenandoahMarkRefsSuperClosure(q, rp),
      _heap(ShenandoahHeap::heap()) {
      assert(_heap->is_stw_gc_in_progress(), "Can only be used for STW GC");
    };
  };
  
  class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkUpdateRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T>(p); }
  
  public:
!   ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
!     ShenandoahMarkUpdateRefsSuperClosure(q, rp) {}
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
  };
  
  class ShenandoahMarkRefsClosure : public ShenandoahMarkRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T>(p); }
  
  public:
!   ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) :
!     ShenandoahMarkRefsSuperClosure(q, rp) {};
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
  };
  
- 
  class ShenandoahUpdateRefsSuperClosure : public ShenandoahOopClosureBase {
  protected:
    ShenandoahHeap* _heap;
  
  public:
--- 70,49 ---
  
  class ShenandoahMarkUpdateRefsSuperClosure : public ShenandoahMarkRefsSuperClosure {
  protected:
    ShenandoahHeap* const _heap;
  
!   template <class T, ShenandoahGenerationType GENERATION>
    inline void work(T* p);
  
  public:
!   ShenandoahMarkUpdateRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q) :
!     ShenandoahMarkRefsSuperClosure(q, rp, old_q),
      _heap(ShenandoahHeap::heap()) {
      assert(_heap->is_stw_gc_in_progress(), "Can only be used for STW GC");
    };
  };
  
+ template <ShenandoahGenerationType GENERATION>
  class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkUpdateRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T, GENERATION>(p); }
  
  public:
!   ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q) :
!     ShenandoahMarkUpdateRefsSuperClosure(q, rp, old_q) {}
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
  };
  
+ template <ShenandoahGenerationType GENERATION>
  class ShenandoahMarkRefsClosure : public ShenandoahMarkRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T, GENERATION>(p); }
  
  public:
!   ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old_q) :
!     ShenandoahMarkRefsSuperClosure(q, rp, old_q) {};
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
  };
  
  class ShenandoahUpdateRefsSuperClosure : public ShenandoahOopClosureBase {
  protected:
    ShenandoahHeap* _heap;
  
  public:

*** 140,6 ***
--- 143,23 ---
  
    virtual void do_oop(narrowOop* p) { work(p); }
    virtual void do_oop(oop* p)       { work(p); }
  };
  
+ class ShenandoahSetRememberedCardsToDirtyClosure : public BasicOopIterateClosure {
+ protected:
+   ShenandoahHeap*    const _heap;
+   RememberedScanner* const _scanner;
+ 
+ public:
+   ShenandoahSetRememberedCardsToDirtyClosure() :
+       _heap(ShenandoahHeap::heap()),
+       _scanner(_heap->card_scan()) {}
+ 
+   template<class T>
+   inline void work(T* p);
+ 
+   virtual void do_oop(narrowOop* p) { work(p); }
+   virtual void do_oop(oop* p)       { work(p); }
+ };
+ 
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHOOPCLOSURES_HPP
< prev index next >