< prev index next >

src/hotspot/share/gc/shared/ageTable.hpp

Print this page
*** 23,10 ***
--- 23,11 ---
   */
  
  #ifndef SHARE_GC_SHARED_AGETABLE_HPP
  #define SHARE_GC_SHARED_AGETABLE_HPP
  
+ #include "memory/allocation.hpp"
  #include "oops/markWord.hpp"
  #include "oops/oop.hpp"
  #include "runtime/perfDataTypes.hpp"
  
  /* Copyright (c) 1992, 2021, Oracle and/or its affiliates, and Stanford University.

*** 34,11 ***
  
  // Age table for adaptive feedback-mediated tenuring (scavenging)
  //
  // Note: all sizes are in oops
  
! class AgeTable {
    friend class VMStructs;
  
   public:
    // constants
    enum { table_size = markWord::max_age + 1 };
--- 35,11 ---
  
  // Age table for adaptive feedback-mediated tenuring (scavenging)
  //
  // Note: all sizes are in oops
  
! class AgeTable: public CHeapObj<mtGC> {
    friend class VMStructs;
  
   public:
    // constants
    enum { table_size = markWord::max_age + 1 };

*** 51,20 ***
    AgeTable(bool global = true);
  
    // clear table
    void clear();
  
    // add entry
    inline void add(oop p, size_t oop_size);
  
    void add(uint age, size_t oop_size) {
!     assert(age > 0 && age < table_size, "invalid age of object");
      sizes[age] += oop_size;
    }
  
!   // Merge another age table with the current one.  Used
-   // for parallel young generation gc.
    void merge(const AgeTable* subTable);
  
    // Calculate new tenuring threshold based on age information.
    uint compute_tenuring_threshold(size_t desired_survivor_size);
    void print_age_table(uint tenuring_threshold);
--- 52,24 ---
    AgeTable(bool global = true);
  
    // clear table
    void clear();
  
+ #ifndef PRODUCT
+   // check whether it's clear
+   bool is_clear() const;
+ #endif // !PRODUCT
+ 
    // add entry
    inline void add(oop p, size_t oop_size);
  
    void add(uint age, size_t oop_size) {
!     assert(age < table_size, "invalid age of object");
      sizes[age] += oop_size;
    }
  
!   // Merge another age table with the current one.
    void merge(const AgeTable* subTable);
  
    // Calculate new tenuring threshold based on age information.
    uint compute_tenuring_threshold(size_t desired_survivor_size);
    void print_age_table(uint tenuring_threshold);
< prev index next >