annotate hotspot/src/share/vm/gc/shared/ageTable.hpp @ 35862:411842d0c882

8146395: Add inline qualifier in oop.hpp and fix inlining in gc files Summary: Fix remaining issues after 8146401. Also fix windows VS2010 linkage problem (g1OopClosures.hpp). Reviewed-by: stefank, mgerdin
author goetz
date Mon, 18 Jan 2016 10:25:41 +0100
parents c8c0273e6b91
children 90c87069b39c
rev   line source
duke@1 1 /*
goetz@35862 2 * Copyright (c) 1997, 2016, 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
brutisso@30147 32 class GCPolicyCounters;
brutisso@30147 33
goetz@35862 34 /* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University.
duke@1 35 See the LICENSE file for license information. */
duke@1 36
duke@1 37 // Age table for adaptive feedback-mediated tenuring (scavenging)
duke@1 38 //
duke@1 39 // Note: all sizes are in oops
duke@1 40
david@35492 41 class AgeTable VALUE_OBJ_CLASS_SPEC {
duke@1 42 friend class VMStructs;
duke@1 43
duke@1 44 public:
duke@1 45 // constants
duke@1 46 enum { table_size = markOopDesc::max_age + 1 };
duke@1 47
duke@1 48 // instance variables
duke@1 49 size_t sizes[table_size];
duke@1 50
duke@1 51 // constructor. "global" indicates that this is the global age table
duke@1 52 // (as opposed to gc-thread-local)
david@35492 53 AgeTable(bool global = true);
duke@1 54
duke@1 55 // clear table
duke@1 56 void clear();
duke@1 57
duke@1 58 // add entry
goetz@35862 59 inline void add(oop p, size_t oop_size);
sfriberg@27682 60
sfriberg@27682 61 void add(uint age, size_t oop_size) {
duke@1 62 assert(age > 0 && age < table_size, "invalid age of object");
duke@1 63 sizes[age] += oop_size;
duke@1 64 }
duke@1 65
duke@1 66 // Merge another age table with the current one. Used
duke@1 67 // for parallel young generation gc.
david@35492 68 void merge(AgeTable* subTable);
duke@1 69
duke@1 70 // calculate new tenuring threshold based on age information
brutisso@30147 71 uint compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters);
duke@1 72
duke@1 73 private:
duke@1 74 PerfVariable* _perf_sizes[table_size];
duke@1 75 };
stefank@7397 76
pliden@30764 77 #endif // SHARE_VM_GC_SHARED_AGETABLE_HPP