< prev index next >

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

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

*** 28,10 ***
--- 29,12 ---
  #include "gc/shared/gcCause.hpp"
  #include "gc/shenandoah/shenandoahConcurrentMark.hpp"
  #include "gc/shenandoah/shenandoahGC.hpp"
  #include "gc/shenandoah/shenandoahHeap.hpp"
  
+ class ShenandoahGeneration;
+ 
  class VM_ShenandoahInitMark;
  class VM_ShenandoahFinalMarkStartEvac;
  class VM_ShenandoahInitUpdateRefs;
  class VM_ShenandoahFinalUpdateRefs;
  

*** 40,29 ***
    friend class VM_ShenandoahFinalMarkStartEvac;
    friend class VM_ShenandoahInitUpdateRefs;
    friend class VM_ShenandoahFinalUpdateRefs;
    friend class VM_ShenandoahFinalRoots;
  
  private:
!   ShenandoahConcurrentMark  _mark;
!   ShenandoahDegenPoint      _degen_point;
  
  public:
!   ShenandoahConcurrentGC();
!   bool collect(GCCause::Cause cause);
    ShenandoahDegenPoint degen_point() const;
  
!   // Cancel ongoing concurrent GC
!   static void cancel();
  private:
    // Entry points to STW GC operations, these cause a related safepoint, that then
    // call the entry method below
    void vmop_entry_init_mark();
    void vmop_entry_final_mark();
    void vmop_entry_init_updaterefs();
    void vmop_entry_final_updaterefs();
-   void vmop_entry_final_roots();
  
    // Entry methods to normally STW GC operations. These set up logging, monitoring
    // and workers for net VM operation
    void entry_init_mark();
    void entry_final_mark();
--- 43,41 ---
    friend class VM_ShenandoahFinalMarkStartEvac;
    friend class VM_ShenandoahInitUpdateRefs;
    friend class VM_ShenandoahFinalUpdateRefs;
    friend class VM_ShenandoahFinalRoots;
  
+ protected:
+   ShenandoahConcurrentMark    _mark;
+ 
  private:
!   ShenandoahDegenPoint        _degen_point;
!   bool                        _abbreviated;
+   const bool                  _do_old_gc_bootstrap;
+ 
+ protected:
+   ShenandoahGeneration* const _generation;
  
  public:
!   ShenandoahConcurrentGC(ShenandoahGeneration* generation, bool do_old_gc_bootstrap);
!   bool collect(GCCause::Cause cause) override;
    ShenandoahDegenPoint degen_point() const;
  
!   // Return true if this cycle found enough immediate garbage to skip evacuation
!   bool abbreviated() const { return _abbreviated; }
+ 
  private:
    // Entry points to STW GC operations, these cause a related safepoint, that then
    // call the entry method below
    void vmop_entry_init_mark();
+ 
+ protected:
    void vmop_entry_final_mark();
+   void vmop_entry_final_roots();
+ 
+ private:
    void vmop_entry_init_updaterefs();
    void vmop_entry_final_updaterefs();
  
    // Entry methods to normally STW GC operations. These set up logging, monitoring
    // and workers for net VM operation
    void entry_init_mark();
    void entry_final_mark();

*** 72,28 ***
  
    // Entry methods to normally concurrent GC operations. These set up logging, monitoring
    // for concurrent operation.
    void entry_reset();
    void entry_mark_roots();
    void entry_mark();
    void entry_thread_roots();
    void entry_weak_refs();
    void entry_weak_roots();
    void entry_class_unloading();
    void entry_strong_roots();
    void entry_cleanup_early();
    void entry_evacuate();
    void entry_update_thread_roots();
    void entry_updaterefs();
    void entry_cleanup_complete();
  
    // Actual work for the phases
    void op_reset();
    void op_init_mark();
    void op_mark_roots();
    void op_mark();
-   void op_final_mark();
    void op_thread_roots();
    void op_weak_refs();
    void op_weak_roots();
    void op_class_unloading();
    void op_strong_roots();
--- 87,36 ---
  
    // Entry methods to normally concurrent GC operations. These set up logging, monitoring
    // for concurrent operation.
    void entry_reset();
    void entry_mark_roots();
+   void entry_scan_remembered_set();
+ 
+ protected:
    void entry_mark();
    void entry_thread_roots();
    void entry_weak_refs();
    void entry_weak_roots();
    void entry_class_unloading();
    void entry_strong_roots();
    void entry_cleanup_early();
+ 
+ private:
    void entry_evacuate();
    void entry_update_thread_roots();
    void entry_updaterefs();
+ 
    void entry_cleanup_complete();
  
+   // Called when the collection set is empty, but the generational mode has regions to promote in place
+   void entry_promote_in_place();
+ 
    // Actual work for the phases
    void op_reset();
    void op_init_mark();
    void op_mark_roots();
    void op_mark();
    void op_thread_roots();
    void op_weak_refs();
    void op_weak_roots();
    void op_class_unloading();
    void op_strong_roots();

*** 102,20 ***
--- 125,33 ---
    void op_init_updaterefs();
    void op_updaterefs();
    void op_update_thread_roots();
    void op_final_updaterefs();
    void op_final_roots();
+ 
    void op_cleanup_complete();
  
+ protected:
+   virtual void op_final_mark();
+ 
+ private:
    void start_mark();
  
+   static bool has_in_place_promotions(ShenandoahHeap* heap) ;
+ 
    // Messages for GC trace events, they have to be immortal for
    // passing around the logging/tracing systems
    const char* init_mark_event_message() const;
    const char* final_mark_event_message() const;
+   const char* final_roots_event_message() const;
    const char* conc_mark_event_message() const;
+   const char* conc_reset_event_message() const;
+   const char* conc_weak_refs_event_message() const;
+   const char* conc_weak_roots_event_message() const;
+   const char* conc_cleanup_event_message() const;
  
+ protected:
    // Check GC cancellation and abort concurrent GC
    bool check_cancellation_and_abort(ShenandoahDegenPoint point);
  };
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHCONCURRENTGC_HPP
< prev index next >