< prev index next >

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

Print this page
*** 28,33 ***
  #include "gc/shared/stringdedup/stringDedup.hpp"
  #include "gc/shared/taskTerminator.hpp"
  #include "gc/shenandoah/shenandoahOopClosures.hpp"
  #include "gc/shenandoah/shenandoahTaskqueue.hpp"
  
- class ShenandoahCMDrainMarkingStackClosure;
- 
  // Base class for mark
  // Mark class does not maintain states. Instead, mark states are
  // maintained by task queues, mark bitmap and SATB buffers (concurrent mark)
  class ShenandoahMark: public StackObj {
-   friend class ShenandoahCMDrainMarkingStackClosure;
  
  protected:
    ShenandoahObjToScanQueueSet* const _task_queues;
  
  protected:
!   ShenandoahMark();
  
  public:
!   template<class T>
!   static inline void mark_through_ref(T* p, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context, bool weak);
- 
-   static void clear();
  
    // Helpers
    inline ShenandoahObjToScanQueueSet* task_queues() const;
    inline ShenandoahObjToScanQueue* get_queue(uint index) const;
  
  // ---------- Marking loop and tasks
  private:
    template <class T, StringDedupMode STRING_DEDUP>
    inline void do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveData* live_data, StringDedup::Requests* const req, ShenandoahMarkTask* task);
--- 28,37 ---
  #include "gc/shared/stringdedup/stringDedup.hpp"
  #include "gc/shared/taskTerminator.hpp"
  #include "gc/shenandoah/shenandoahOopClosures.hpp"
  #include "gc/shenandoah/shenandoahTaskqueue.hpp"
  
  // Base class for mark
  // Mark class does not maintain states. Instead, mark states are
  // maintained by task queues, mark bitmap and SATB buffers (concurrent mark)
  class ShenandoahMark: public StackObj {
  
  protected:
+   ShenandoahGeneration* const _generation;
    ShenandoahObjToScanQueueSet* const _task_queues;
+   ShenandoahObjToScanQueueSet* const _old_gen_task_queues;
  
  protected:
!   ShenandoahMark(ShenandoahGeneration* generation);
  
  public:
!   template<class T, GenerationMode GENERATION>
!   static inline void mark_through_ref(T* p, ShenandoahObjToScanQueue* q, ShenandoahObjToScanQueue* old, ShenandoahMarkingContext* const mark_context, bool weak);
  
    // Helpers
    inline ShenandoahObjToScanQueueSet* task_queues() const;
+   ShenandoahObjToScanQueueSet* old_task_queues() {
+     return _old_gen_task_queues;
+   }
+ 
    inline ShenandoahObjToScanQueue* get_queue(uint index) const;
+   inline ShenandoahObjToScanQueue* get_old_queue(uint index) const;
+ 
+   inline ShenandoahGeneration* generation() { return _generation; };
  
  // ---------- Marking loop and tasks
  private:
    template <class T, StringDedupMode STRING_DEDUP>
    inline void do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveData* live_data, StringDedup::Requests* const req, ShenandoahMarkTask* task);

*** 65,20 ***
    template <class T>
    inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow, bool weak);
  
    inline void count_liveness(ShenandoahLiveData* live_data, oop obj);
  
!   template <class T, bool CANCELLABLE,StringDedupMode STRING_DEDUP>
    void mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, TaskTerminator *t, StringDedup::Requests* const req);
  
!   template <bool CANCELLABLE, StringDedupMode STRING_DEDUP>
!   void mark_loop_prework(uint worker_id, TaskTerminator *terminator, ShenandoahReferenceProcessor *rp, StringDedup::Requests* const req);
  
    template <StringDedupMode STRING_DEDUP>
    inline void dedup_string(oop obj, StringDedup::Requests* const req);
  protected:
!   void mark_loop(uint worker_id, TaskTerminator* terminator, ShenandoahReferenceProcessor *rp,
                   bool cancellable, StringDedupMode dedup_mode, StringDedup::Requests* const req);
  };
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARK_HPP
  
--- 69,31 ---
    template <class T>
    inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow, bool weak);
  
    inline void count_liveness(ShenandoahLiveData* live_data, oop obj);
  
!   template <class T, GenerationMode GENERATION, bool CANCELLABLE, StringDedupMode STRING_DEDUP>
    void mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, TaskTerminator *t, StringDedup::Requests* const req);
  
!   template <GenerationMode GENERATION, bool CANCELLABLE, StringDedupMode STRING_DEDUP>
!   void mark_loop_prework(uint worker_id, TaskTerminator *terminator, ShenandoahReferenceProcessor *rp, StringDedup::Requests* const req, bool update_refs);
+ 
+   template <GenerationMode GENERATION>
+   static bool in_generation(oop obj);
+ 
+   static void mark_ref(ShenandoahObjToScanQueue* q,
+                        ShenandoahMarkingContext* const mark_context,
+                        bool weak, oop obj);
  
    template <StringDedupMode STRING_DEDUP>
    inline void dedup_string(oop obj, StringDedup::Requests* const req);
  protected:
!   template<bool CANCELLABLE, StringDedupMode STRING_DEDUP>
+   void mark_loop(GenerationMode generation, uint worker_id, TaskTerminator* terminator, ShenandoahReferenceProcessor *rp,
+                  StringDedup::Requests* const req);
+ 
+   void mark_loop(GenerationMode generation, uint worker_id, TaskTerminator* terminator, ShenandoahReferenceProcessor *rp,
                   bool cancellable, StringDedupMode dedup_mode, StringDedup::Requests* const req);
  };
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARK_HPP
  
< prev index next >