1 /*
2 * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /*
26 * A binary tree based search structure for free blocks.
27 * This is currently used in the Concurrent Mark&Sweep implementation.
28 */
29
30 // A TreeList is a FreeList which can be used to maintain a
31 // binary tree of free lists.
32
33 class TreeChunk;
34 class BinaryTreeDictionary;
35 class AscendTreeCensusClosure;
36 class DescendTreeCensusClosure;
37 class DescendTreeSearchClosure;
38
39 class TreeList: public FreeList {
40 friend class TreeChunk;
41 friend class BinaryTreeDictionary;
42 friend class AscendTreeCensusClosure;
43 friend class DescendTreeCensusClosure;
44 friend class DescendTreeSearchClosure;
269 void setTreeHints(void);
270 // Reset statistics for all the lists in the tree.
271 void clearTreeCensus(void);
272 // Print the statistcis for all the lists in the tree. Also may
273 // print out summaries.
274 void printDictCensus(void) const;
275 void print_free_lists(outputStream* st) const;
276
277 // For debugging. Returns the sum of the _returnedBytes for
278 // all lists in the tree.
279 size_t sumDictReturnedBytes() PRODUCT_RETURN0;
280 // Sets the _returnedBytes for all the lists in the tree to zero.
281 void initializeDictReturnedBytes() PRODUCT_RETURN;
282 // For debugging. Return the total number of chunks in the dictionary.
283 size_t totalCount() PRODUCT_RETURN0;
284
285 void reportStatistics() const;
286
287 void verify() const;
288 };
|
1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
27
28 #include "gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp"
29 #include "gc_implementation/concurrentMarkSweep/freeList.hpp"
30
31 /*
32 * A binary tree based search structure for free blocks.
33 * This is currently used in the Concurrent Mark&Sweep implementation.
34 */
35
36 // A TreeList is a FreeList which can be used to maintain a
37 // binary tree of free lists.
38
39 class TreeChunk;
40 class BinaryTreeDictionary;
41 class AscendTreeCensusClosure;
42 class DescendTreeCensusClosure;
43 class DescendTreeSearchClosure;
44
45 class TreeList: public FreeList {
46 friend class TreeChunk;
47 friend class BinaryTreeDictionary;
48 friend class AscendTreeCensusClosure;
49 friend class DescendTreeCensusClosure;
50 friend class DescendTreeSearchClosure;
275 void setTreeHints(void);
276 // Reset statistics for all the lists in the tree.
277 void clearTreeCensus(void);
278 // Print the statistcis for all the lists in the tree. Also may
279 // print out summaries.
280 void printDictCensus(void) const;
281 void print_free_lists(outputStream* st) const;
282
283 // For debugging. Returns the sum of the _returnedBytes for
284 // all lists in the tree.
285 size_t sumDictReturnedBytes() PRODUCT_RETURN0;
286 // Sets the _returnedBytes for all the lists in the tree to zero.
287 void initializeDictReturnedBytes() PRODUCT_RETURN;
288 // For debugging. Return the total number of chunks in the dictionary.
289 size_t totalCount() PRODUCT_RETURN0;
290
291 void reportStatistics() const;
292
293 void verify() const;
294 };
295
296 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_BINARYTREEDICTIONARY_HPP
|