src/share/vm/memory/freeBlockDictionary.hpp

Mon, 04 Jun 2012 09:21:53 +0200

author
mgerdin
date
Mon, 04 Jun 2012 09:21:53 +0200
changeset 3822
a297b0e14605
parent 3732
f69a5d43dc19
child 3900
d2a62e0f25eb
permissions
-rw-r--r--

7172226: HotSpot fails to build with GCC 4.7 because of stricter c++ argument dependent lookup
Summary: Add "using" keyword to import base class functions from FreeList<T> to fix template name lookup in gcc 4.7
Reviewed-by: brutisso, iveresov

duke@435 1 /*
jmasa@3730 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
jmasa@3730 25 #ifndef SHARE_VM_MEMORY_FREEBLOCKDICTIONARY_HPP
jmasa@3730 26 #define SHARE_VM_MEMORY_FREEBLOCKDICTIONARY_HPP
stefank@2314 27
stefank@2314 28 #include "memory/allocation.hpp"
stefank@2314 29 #include "runtime/mutex.hpp"
stefank@2314 30 #include "utilities/debug.hpp"
stefank@2314 31 #include "utilities/globalDefinitions.hpp"
stefank@2314 32 #include "utilities/ostream.hpp"
stefank@2314 33
duke@435 34 // A FreeBlockDictionary is an abstract superclass that will allow
duke@435 35 // a number of alternative implementations in the future.
jmasa@3730 36 template <class Chunk>
duke@435 37 class FreeBlockDictionary: public CHeapObj {
duke@435 38 public:
duke@435 39 enum Dither {
duke@435 40 atLeast,
duke@435 41 exactly,
duke@435 42 roughly
duke@435 43 };
duke@435 44 enum DictionaryChoice {
duke@435 45 dictionaryBinaryTree = 0,
duke@435 46 dictionarySplayTree = 1,
duke@435 47 dictionarySkipList = 2
duke@435 48 };
duke@435 49
duke@435 50 private:
duke@435 51 NOT_PRODUCT(Mutex* _lock;)
duke@435 52
duke@435 53 public:
jmasa@3732 54 virtual void remove_chunk(Chunk* fc) = 0;
jmasa@3732 55 virtual Chunk* get_chunk(size_t size, Dither dither = atLeast) = 0;
jmasa@3732 56 virtual void return_chunk(Chunk* chunk) = 0;
jmasa@3732 57 virtual size_t total_chunk_size(debug_only(const Mutex* lock)) const = 0;
jmasa@3732 58 virtual size_t max_chunk_size() const = 0;
jmasa@3732 59 virtual size_t min_size() const = 0;
duke@435 60 // Reset the dictionary to the initial conditions for a single
duke@435 61 // block.
duke@435 62 virtual void reset(HeapWord* addr, size_t size) = 0;
duke@435 63 virtual void reset() = 0;
duke@435 64
jmasa@3732 65 virtual void dict_census_udpate(size_t size, bool split, bool birth) = 0;
jmasa@3732 66 virtual bool coal_dict_over_populated(size_t size) = 0;
jmasa@3732 67 virtual void begin_sweep_dict_census(double coalSurplusPercent,
ysr@1580 68 float inter_sweep_current, float inter_sweep_estimate,
ysr@1580 69 float intra__sweep_current) = 0;
jmasa@3732 70 virtual void end_sweep_dict_census(double splitSurplusPercent) = 0;
jmasa@3732 71 virtual Chunk* find_largest_dict() const = 0;
duke@435 72 // verify that the given chunk is in the dictionary.
jmasa@3732 73 virtual bool verify_chunk_in_free_list(Chunk* tc) const = 0;
duke@435 74
duke@435 75 // Sigma_{all_free_blocks} (block_size^2)
duke@435 76 virtual double sum_of_squared_block_sizes() const = 0;
duke@435 77
jmasa@3730 78 virtual Chunk* find_chunk_ends_at(HeapWord* target) const = 0;
jmasa@3732 79 virtual void inc_total_size(size_t v) = 0;
jmasa@3732 80 virtual void dec_total_size(size_t v) = 0;
duke@435 81
duke@435 82 NOT_PRODUCT (
jmasa@3732 83 virtual size_t sum_dict_returned_bytes() = 0;
jmasa@3732 84 virtual void initialize_dict_returned_bytes() = 0;
jmasa@3732 85 virtual size_t total_count() = 0;
duke@435 86 )
duke@435 87
jmasa@3732 88 virtual void report_statistics() const {
duke@435 89 gclog_or_tty->print("No statistics available");
duke@435 90 }
duke@435 91
jmasa@3732 92 virtual void print_dict_census() const = 0;
ysr@1580 93 virtual void print_free_lists(outputStream* st) const = 0;
duke@435 94
duke@435 95 virtual void verify() const = 0;
duke@435 96
duke@435 97 Mutex* par_lock() const PRODUCT_RETURN0;
duke@435 98 void set_par_lock(Mutex* lock) PRODUCT_RETURN;
duke@435 99 void verify_par_locked() const PRODUCT_RETURN;
duke@435 100 };
stefank@2314 101
jmasa@3730 102 #endif // SHARE_VM_MEMORY_FREEBLOCKDICTIONARY_HPP

mercurial