hotspot/src/share/vm/gc/shared/ageTable.hpp
changeset 35862 411842d0c882
parent 35492 c8c0273e6b91
child 40914 90c87069b39c
equal deleted inserted replaced
35853:9cffac525e28 35862:411842d0c882
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    29 #include "oops/oop.hpp"
    29 #include "oops/oop.hpp"
    30 #include "runtime/perfData.hpp"
    30 #include "runtime/perfData.hpp"
    31 
    31 
    32 class GCPolicyCounters;
    32 class GCPolicyCounters;
    33 
    33 
    34 /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University.
    34 /* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University.
    35    See the LICENSE file for license information. */
    35    See the LICENSE file for license information. */
    36 
    36 
    37 // Age table for adaptive feedback-mediated tenuring (scavenging)
    37 // Age table for adaptive feedback-mediated tenuring (scavenging)
    38 //
    38 //
    39 // Note: all sizes are in oops
    39 // Note: all sizes are in oops
    54 
    54 
    55   // clear table
    55   // clear table
    56   void clear();
    56   void clear();
    57 
    57 
    58   // add entry
    58   // add entry
    59   void add(oop p, size_t oop_size) {
    59   inline void add(oop p, size_t oop_size);
    60     add(p->age(), oop_size);
       
    61   }
       
    62 
    60 
    63   void add(uint age, size_t oop_size) {
    61   void add(uint age, size_t oop_size) {
    64     assert(age > 0 && age < table_size, "invalid age of object");
    62     assert(age > 0 && age < table_size, "invalid age of object");
    65     sizes[age] += oop_size;
    63     sizes[age] += oop_size;
    66   }
    64   }