< prev index next >

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

Print this page
*** 39,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;
    }
  
--- 39,20 ---
  };
  
  class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure {
  private:
    ShenandoahObjToScanQueue* _queue;
+   ShenandoahObjToScanQueue* _old_queue;
    ShenandoahMarkingContext* const _mark_context;
    bool _weak;
  
  protected:
!   template <class T, GenerationMode GENERATION>
    void work(T *p);
  
  public:
!   ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp,  ShenandoahObjToScanQueue* old_queue = NULL);
  
    bool is_weak() const {
      return _weak;
    }
  

*** 62,73 ***
  
  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); }
    virtual bool do_metadata()        { return false; }
  };
  
  class ShenandoahMarkUpdateRefsMetadataClosure : public ShenandoahMarkUpdateRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T>(p); }
  
  public:
!   ShenandoahMarkUpdateRefsMetadataClosure(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); }
    virtual bool do_metadata()        { return true; }
  };
  
! 
  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); }
    virtual bool do_metadata()        { return false; }
  };
  
! 
  class ShenandoahMarkRefsMetadataClosure : public ShenandoahMarkRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T>(p); }
  
  public:
!   ShenandoahMarkRefsMetadataClosure(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); }
    virtual bool do_metadata()        { return true; }
  };
--- 63,75 ---
  
  class ShenandoahMarkUpdateRefsSuperClosure : public ShenandoahMarkRefsSuperClosure {
  protected:
    ShenandoahHeap* const _heap;
  
!   template <class T, GenerationMode GENERATION>
    inline void work(T* p);
  
  public:
!   ShenandoahMarkUpdateRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old = NULL) :
!     ShenandoahMarkRefsSuperClosure(q, rp, old),
      _heap(ShenandoahHeap::heap()) {
      assert(_heap->is_stw_gc_in_progress(), "Can only be used for STW GC");
    };
  };
  
+ template <GenerationMode 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 = NULL) :
!     ShenandoahMarkUpdateRefsSuperClosure(q, rp, old) {}
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
    virtual bool do_metadata()        { return false; }
  };
  
+ template <GenerationMode GENERATION>
  class ShenandoahMarkUpdateRefsMetadataClosure : public ShenandoahMarkUpdateRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T, GENERATION>(p); }
  
  public:
!   ShenandoahMarkUpdateRefsMetadataClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old = NULL) :
!     ShenandoahMarkUpdateRefsSuperClosure(q, rp, old) {}
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
    virtual bool do_metadata()        { return true; }
  };
  
! template <GenerationMode 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 = NULL) :
!     ShenandoahMarkRefsSuperClosure(q, rp, old) {};
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
    virtual bool do_metadata()        { return false; }
  };
  
! template <GenerationMode GENERATION>
  class ShenandoahMarkRefsMetadataClosure : public ShenandoahMarkRefsSuperClosure {
  private:
    template <class T>
!   inline void do_oop_work(T* p)     { work<T, GENERATION>(p); }
  
  public:
!   ShenandoahMarkRefsMetadataClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp, ShenandoahObjToScanQueue* old = NULL) :
!     ShenandoahMarkRefsSuperClosure(q, rp, old) {};
  
    virtual void do_oop(narrowOop* p) { do_oop_work(p); }
    virtual void do_oop(oop* p)       { do_oop_work(p); }
    virtual bool do_metadata()        { return true; }
  };

*** 165,6 ***
--- 168,44 ---
  
    virtual void do_oop(narrowOop* p) { work(p); }
    virtual void do_oop(oop* p)       { work(p); }
  };
  
+ class ShenandoahVerifyRemSetClosure : public BasicOopIterateClosure {
+   protected:
+   bool _init_mark;
+   ShenandoahHeap* _heap;
+   RememberedScanner* _scanner;
+ 
+   public:
+ // Argument distinguishes between initial mark or start of update refs verification.
+   ShenandoahVerifyRemSetClosure(bool init_mark) :
+       _init_mark(init_mark),
+       _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); }
+ };
+ 
+ class ShenandoahSetRememberedCardsToDirtyClosure : public BasicOopIterateClosure {
+ 
+ protected:
+   ShenandoahHeap* _heap;
+   RememberedScanner* _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 >