src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp

Wed, 02 Jul 2008 12:55:16 -0700

author
xdono
date
Wed, 02 Jul 2008 12:55:16 -0700
changeset 631
d1605aabd0a1
parent 622
790e66e5fbac
child 704
850fdf70db2b
permissions
-rw-r--r--

6719955: Update copyright year
Summary: Update copyright year for files that have been modified in 2008
Reviewed-by: ohair, tbell

duke@435 1 /*
xdono@631 2 * Copyright 2001-2008 Sun Microsystems, Inc. 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 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25
duke@435 26 // A FreeBlockDictionary is an abstract superclass that will allow
duke@435 27 // a number of alternative implementations in the future.
duke@435 28 class FreeBlockDictionary: public CHeapObj {
duke@435 29 public:
duke@435 30 enum Dither {
duke@435 31 atLeast,
duke@435 32 exactly,
duke@435 33 roughly
duke@435 34 };
duke@435 35 enum DictionaryChoice {
duke@435 36 dictionaryBinaryTree = 0,
duke@435 37 dictionarySplayTree = 1,
duke@435 38 dictionarySkipList = 2
duke@435 39 };
duke@435 40
duke@435 41 private:
duke@435 42 NOT_PRODUCT(Mutex* _lock;)
duke@435 43
duke@435 44 public:
duke@435 45 virtual void removeChunk(FreeChunk* fc) = 0;
duke@435 46 virtual FreeChunk* getChunk(size_t size, Dither dither = atLeast) = 0;
duke@435 47 virtual void returnChunk(FreeChunk* chunk) = 0;
duke@435 48 virtual size_t totalChunkSize(debug_only(const Mutex* lock)) const = 0;
duke@435 49 virtual size_t maxChunkSize() const = 0;
duke@435 50 virtual size_t minSize() const = 0;
duke@435 51 // Reset the dictionary to the initial conditions for a single
duke@435 52 // block.
duke@435 53 virtual void reset(HeapWord* addr, size_t size) = 0;
duke@435 54 virtual void reset() = 0;
duke@435 55
duke@435 56 virtual void dictCensusUpdate(size_t size, bool split, bool birth) = 0;
duke@435 57 virtual bool coalDictOverPopulated(size_t size) = 0;
duke@435 58 virtual void beginSweepDictCensus(double coalSurplusPercent,
duke@435 59 float sweep_current, float sweep_ewstimate) = 0;
duke@435 60 virtual void endSweepDictCensus(double splitSurplusPercent) = 0;
duke@435 61 virtual FreeChunk* findLargestDict() const = 0;
duke@435 62 // verify that the given chunk is in the dictionary.
duke@435 63 virtual bool verifyChunkInFreeLists(FreeChunk* tc) const = 0;
duke@435 64
duke@435 65 // Sigma_{all_free_blocks} (block_size^2)
duke@435 66 virtual double sum_of_squared_block_sizes() const = 0;
duke@435 67
duke@435 68 virtual FreeChunk* find_chunk_ends_at(HeapWord* target) const = 0;
duke@435 69 virtual void inc_totalSize(size_t v) = 0;
duke@435 70 virtual void dec_totalSize(size_t v) = 0;
duke@435 71
duke@435 72 NOT_PRODUCT (
duke@435 73 virtual size_t sumDictReturnedBytes() = 0;
duke@435 74 virtual void initializeDictReturnedBytes() = 0;
duke@435 75 virtual size_t totalCount() = 0;
duke@435 76 )
duke@435 77
duke@435 78 virtual void reportStatistics() const {
duke@435 79 gclog_or_tty->print("No statistics available");
duke@435 80 }
duke@435 81
duke@435 82 virtual void printDictCensus() const = 0;
duke@435 83
duke@435 84 virtual void verify() const = 0;
duke@435 85
duke@435 86 Mutex* par_lock() const PRODUCT_RETURN0;
duke@435 87 void set_par_lock(Mutex* lock) PRODUCT_RETURN;
duke@435 88 void verify_par_locked() const PRODUCT_RETURN;
duke@435 89 };

mercurial