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

@@ -50,21 +51,22 @@
    // (as opposed to gc-thread-local)
    AgeTable(bool global = true);
  
    // clear table
    void clear();
+   // check whether it's clear
+   bool is_clear() PRODUCT_RETURN0;
  
    // 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");
+     assert(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.
+   // 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 >