0N/A/*
1879N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP
1879N/A#define SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP
1879N/A
1879N/A#include "oops/markOop.hpp"
1879N/A#include "oops/oop.hpp"
1879N/A#include "runtime/perfData.hpp"
1879N/A
1472N/A/* Copyright (c) 1992-2009 Oracle and/or its affiliates, and Stanford University.
0N/A See the LICENSE file for license information. */
0N/A
0N/A// Age table for adaptive feedback-mediated tenuring (scavenging)
0N/A//
0N/A// Note: all sizes are in oops
0N/A
0N/Aclass ageTable VALUE_OBJ_CLASS_SPEC {
0N/A friend class VMStructs;
0N/A
0N/A public:
0N/A // constants
0N/A enum { table_size = markOopDesc::max_age + 1 };
0N/A
0N/A // instance variables
0N/A size_t sizes[table_size];
0N/A
0N/A // constructor. "global" indicates that this is the global age table
0N/A // (as opposed to gc-thread-local)
0N/A ageTable(bool global = true);
0N/A
0N/A // clear table
0N/A void clear();
0N/A
0N/A // add entry
0N/A void add(oop p, size_t oop_size) {
0N/A int age = p->age();
0N/A assert(age > 0 && age < table_size, "invalid age of object");
0N/A sizes[age] += oop_size;
0N/A }
0N/A
0N/A // Merge another age table with the current one. Used
0N/A // for parallel young generation gc.
0N/A void merge(ageTable* subTable);
545N/A void merge_par(ageTable* subTable);
0N/A
0N/A // calculate new tenuring threshold based on age information
0N/A int compute_tenuring_threshold(size_t survivor_capacity);
0N/A
0N/A private:
0N/A PerfVariable* _perf_sizes[table_size];
0N/A};
1879N/A
1879N/A#endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_AGETABLE_HPP