< prev index next >

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

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

*** 37,37 ***
  };
  
  class ShenandoahCollectorPolicy : public CHeapObj<mtGC> {
  private:
    size_t _success_concurrent_gcs;
    size_t _success_degenerated_gcs;
    // Written by control thread, read by mutators
    volatile size_t _success_full_gcs;
    size_t _alloc_failure_degenerated;
    size_t _alloc_failure_degenerated_upgrade_to_full;
    size_t _alloc_failure_full;
    size_t _explicit_concurrent;
    size_t _explicit_full;
    size_t _implicit_concurrent;
    size_t _implicit_full;
    size_t _degen_points[ShenandoahGC::_DEGENERATED_LIMIT];
  
    ShenandoahSharedFlag _in_shutdown;
- 
    ShenandoahTracer* _tracer;
  
-   size_t _cycle_counter;
  
  public:
    ShenandoahCollectorPolicy();
  
    // TODO: This is different from gc_end: that one encompasses one VM operation.
    // These two encompass the entire cycle.
    void record_cycle_start();
  
!   void record_success_concurrent();
!   void record_success_degenerated();
    void record_success_full();
    void record_alloc_failure_to_degenerated(ShenandoahGC::ShenandoahDegenPoint point);
    void record_alloc_failure_to_full();
    void record_degenerated_upgrade_to_full();
    void record_explicit_to_concurrent();
--- 38,47 ---
  };
  
  class ShenandoahCollectorPolicy : public CHeapObj<mtGC> {
  private:
    size_t _success_concurrent_gcs;
+   size_t _mixed_gcs;
+   size_t _abbreviated_concurrent_gcs;
+   size_t _abbreviated_degenerated_gcs;
+   size_t _success_old_gcs;
+   size_t _interrupted_old_gcs;
    size_t _success_degenerated_gcs;
    // Written by control thread, read by mutators
    volatile size_t _success_full_gcs;
+   volatile size_t _consecutive_young_gcs;
+   uint _consecutive_degenerated_gcs;
    size_t _alloc_failure_degenerated;
    size_t _alloc_failure_degenerated_upgrade_to_full;
    size_t _alloc_failure_full;
    size_t _explicit_concurrent;
    size_t _explicit_full;
    size_t _implicit_concurrent;
    size_t _implicit_full;
+   size_t _cycle_counter;
    size_t _degen_points[ShenandoahGC::_DEGENERATED_LIMIT];
  
    ShenandoahSharedFlag _in_shutdown;
    ShenandoahTracer* _tracer;
  
  
  public:
    ShenandoahCollectorPolicy();
  
    // TODO: This is different from gc_end: that one encompasses one VM operation.
    // These two encompass the entire cycle.
    void record_cycle_start();
  
!   void record_mixed_cycle();
! 
+   void record_success_concurrent(bool is_young, bool is_abbreviated);
+   void record_success_old();
+   void record_interrupted_old();
+   void record_success_degenerated(bool is_young, bool is_abbreviated);
    void record_success_full();
    void record_alloc_failure_to_degenerated(ShenandoahGC::ShenandoahDegenPoint point);
    void record_alloc_failure_to_full();
    void record_degenerated_upgrade_to_full();
    void record_explicit_to_concurrent();

*** 85,8 ***
--- 96,19 ---
    void print_gc_stats(outputStream* out) const;
  
    size_t full_gc_count() const {
      return _success_full_gcs + _alloc_failure_degenerated_upgrade_to_full;
    }
+ 
+   inline size_t consecutive_young_gc_count() const {
+     return _consecutive_young_gcs;
+   }
+ 
+   inline size_t consecutive_degenerated_gc_count() const {
+     return _consecutive_degenerated_gcs;
+   }
+ 
+ private:
+   void update_young(bool is_young);
  };
  
  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHCOLLECTORPOLICY_HPP
< prev index next >