annotate src/hotspot/share/gc/shared/ageTable.hpp @ 49392:2956d0ece7a9

8199282: Remove ValueObj class for allocation subclassing for gc code Reviewed-by: stefank, kbarrett
author coleenp
date Wed, 14 Mar 2018 07:27:19 -0400
parents 71c04702a3d5
children 9807daeb47c4
rev   line source
duke@1 1 /*
coleenp@49392 2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
pliden@30764 25 #ifndef SHARE_VM_GC_SHARED_AGETABLE_HPP
pliden@30764 26 #define SHARE_VM_GC_SHARED_AGETABLE_HPP
stefank@7397 27
stefank@7397 28 #include "oops/markOop.hpp"
stefank@7397 29 #include "oops/oop.hpp"
stefank@7397 30 #include "runtime/perfData.hpp"
stefank@7397 31
coleenp@49392 32 /* Copyright (c) 1992, 2018, Oracle and/or its affiliates, and Stanford University.
duke@1 33 See the LICENSE file for license information. */
duke@1 34
duke@1 35 // Age table for adaptive feedback-mediated tenuring (scavenging)
duke@1 36 //
duke@1 37 // Note: all sizes are in oops
duke@1 38
coleenp@49392 39 class AgeTable {
duke@1 40 friend class VMStructs;
duke@1 41
duke@1 42 public:
duke@1 43 // constants
duke@1 44 enum { table_size = markOopDesc::max_age + 1 };
duke@1 45
duke@1 46 // instance variables
duke@1 47 size_t sizes[table_size];
duke@1 48
duke@1 49 // constructor. "global" indicates that this is the global age table
duke@1 50 // (as opposed to gc-thread-local)
david@35492 51 AgeTable(bool global = true);
duke@1 52
duke@1 53 // clear table
duke@1 54 void clear();
duke@1 55
duke@1 56 // add entry
goetz@35862 57 inline void add(oop p, size_t oop_size);
sfriberg@27682 58
sfriberg@27682 59 void add(uint age, size_t oop_size) {
duke@1 60 assert(age > 0 && age < table_size, "invalid age of object");
duke@1 61 sizes[age] += oop_size;
duke@1 62 }
duke@1 63
duke@1 64 // Merge another age table with the current one. Used
duke@1 65 // for parallel young generation gc.
david@35492 66 void merge(AgeTable* subTable);
duke@1 67
tschatzl@40914 68 // Calculate new tenuring threshold based on age information.
tschatzl@40914 69 uint compute_tenuring_threshold(size_t desired_survivor_size);
tschatzl@40914 70 void print_age_table(uint tenuring_threshold);
duke@1 71
duke@1 72 private:
tschatzl@40914 73
duke@1 74 PerfVariable* _perf_sizes[table_size];
duke@1 75 };
stefank@7397 76
pliden@30764 77 #endif // SHARE_VM_GC_SHARED_AGETABLE_HPP