提交 83cb737c 编写于 作者: G goetz

8034171: Remove use of template template parameters from binaryTreeDictionary.

Reviewed-by: mgerdin, jmasa
Contributed-by: matthias.baesken@sap.com
上级 10043d0a
......@@ -1704,8 +1704,8 @@ CompactibleFreeListSpace::returnChunkToDictionary(FreeChunk* chunk) {
_dictionary->return_chunk(chunk);
#ifndef PRODUCT
if (CMSCollector::abstract_state() != CMSCollector::Sweeping) {
TreeChunk<FreeChunk, AdaptiveFreeList>* tc = TreeChunk<FreeChunk, AdaptiveFreeList>::as_TreeChunk(chunk);
TreeList<FreeChunk, AdaptiveFreeList>* tl = tc->list();
TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >* tc = TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::as_TreeChunk(chunk);
TreeList<FreeChunk, AdaptiveFreeList<FreeChunk> >* tl = tc->list();
tl->verify_stats();
}
#endif // PRODUCT
......@@ -2515,10 +2515,10 @@ void CompactibleFreeListSpace::verifyIndexedFreeList(size_t size) const {
#ifndef PRODUCT
void CompactibleFreeListSpace::check_free_list_consistency() const {
assert((TreeChunk<FreeChunk, AdaptiveFreeList>::min_size() <= IndexSetSize),
assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size() <= IndexSetSize),
"Some sizes can't be allocated without recourse to"
" linear allocation buffers");
assert((TreeChunk<FreeChunk, AdaptiveFreeList>::min_size()*HeapWordSize == sizeof(TreeChunk<FreeChunk, AdaptiveFreeList>)),
assert((TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >::min_size()*HeapWordSize == sizeof(TreeChunk<FreeChunk, AdaptiveFreeList<FreeChunk> >)),
"else MIN_TREE_CHUNK_SIZE is wrong");
assert(IndexSetStart != 0, "IndexSetStart not initialized");
assert(IndexSetStride != 0, "IndexSetStride not initialized");
......
......@@ -37,18 +37,18 @@
// A TreeList is a FreeList which can be used to maintain a
// binary tree of free lists.
template <class Chunk_t, template <class> class FreeList_t> class TreeChunk;
template <class Chunk_t, template <class> class FreeList_t> class BinaryTreeDictionary;
template <class Chunk_t, template <class> class FreeList_t> class AscendTreeCensusClosure;
template <class Chunk_t, template <class> class FreeList_t> class DescendTreeCensusClosure;
template <class Chunk_t, template <class> class FreeList_t> class DescendTreeSearchClosure;
template <class Chunk_t, class FreeList_t> class TreeChunk;
template <class Chunk_t, class FreeList_t> class BinaryTreeDictionary;
template <class Chunk_t, class FreeList_t> class AscendTreeCensusClosure;
template <class Chunk_t, class FreeList_t> class DescendTreeCensusClosure;
template <class Chunk_t, class FreeList_t> class DescendTreeSearchClosure;
class FreeChunk;
template <class> class AdaptiveFreeList;
typedef BinaryTreeDictionary<FreeChunk, AdaptiveFreeList> AFLBinaryTreeDictionary;
typedef BinaryTreeDictionary<FreeChunk, AdaptiveFreeList<FreeChunk> > AFLBinaryTreeDictionary;
template <class Chunk_t, template <class> class FreeList_t>
class TreeList : public FreeList_t<Chunk_t> {
template <class Chunk_t, class FreeList_t>
class TreeList : public FreeList_t {
friend class TreeChunk<Chunk_t, FreeList_t>;
friend class BinaryTreeDictionary<Chunk_t, FreeList_t>;
friend class AscendTreeCensusClosure<Chunk_t, FreeList_t>;
......@@ -66,12 +66,12 @@ class TreeList : public FreeList_t<Chunk_t> {
TreeList<Chunk_t, FreeList_t>* right() const { return _right; }
// Wrapper on call to base class, to get the template to compile.
Chunk_t* head() const { return FreeList_t<Chunk_t>::head(); }
Chunk_t* tail() const { return FreeList_t<Chunk_t>::tail(); }
void set_head(Chunk_t* head) { FreeList_t<Chunk_t>::set_head(head); }
void set_tail(Chunk_t* tail) { FreeList_t<Chunk_t>::set_tail(tail); }
Chunk_t* head() const { return FreeList_t::head(); }
Chunk_t* tail() const { return FreeList_t::tail(); }
void set_head(Chunk_t* head) { FreeList_t::set_head(head); }
void set_tail(Chunk_t* tail) { FreeList_t::set_tail(tail); }
size_t size() const { return FreeList_t<Chunk_t>::size(); }
size_t size() const { return FreeList_t::size(); }
// Accessors for links in tree.
......@@ -90,7 +90,7 @@ class TreeList : public FreeList_t<Chunk_t> {
void clear_left() { _left = NULL; }
void clear_right() { _right = NULL; }
void clear_parent() { _parent = NULL; }
void initialize() { clear_left(); clear_right(), clear_parent(); FreeList_t<Chunk_t>::initialize(); }
void initialize() { clear_left(); clear_right(), clear_parent(); FreeList_t::initialize(); }
// For constructing a TreeList from a Tree chunk or
// address and size.
......@@ -139,7 +139,7 @@ class TreeList : public FreeList_t<Chunk_t> {
// on the free list for a node in the tree and is only removed if
// it is the last chunk on the free list.
template <class Chunk_t, template <class> class FreeList_t>
template <class Chunk_t, class FreeList_t>
class TreeChunk : public Chunk_t {
friend class TreeList<Chunk_t, FreeList_t>;
TreeList<Chunk_t, FreeList_t>* _list;
......@@ -173,7 +173,7 @@ class TreeChunk : public Chunk_t {
};
template <class Chunk_t, template <class> class FreeList_t>
template <class Chunk_t, class FreeList_t>
class BinaryTreeDictionary: public FreeBlockDictionary<Chunk_t> {
friend class VMStructs;
size_t _total_size;
......
......@@ -46,8 +46,8 @@
#include "utilities/copy.hpp"
#include "utilities/debug.hpp"
typedef BinaryTreeDictionary<Metablock, FreeList> BlockTreeDictionary;
typedef BinaryTreeDictionary<Metachunk, FreeList> ChunkTreeDictionary;
typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > BlockTreeDictionary;
typedef BinaryTreeDictionary<Metachunk, FreeList<Metachunk> > ChunkTreeDictionary;
// Set this constant to enable slow integrity checking of the free chunk lists
const bool metaspace_slow_verify = false;
......@@ -790,7 +790,7 @@ MetaWord* BlockFreelist::get_block(size_t word_size) {
return NULL;
}
if (word_size < TreeChunk<Metablock, FreeList>::min_size()) {
if (word_size < TreeChunk<Metablock, FreeList<Metablock> >::min_size()) {
// Dark matter. Too small for dictionary.
return NULL;
}
......@@ -810,7 +810,7 @@ MetaWord* BlockFreelist::get_block(size_t word_size) {
MetaWord* new_block = (MetaWord*)free_block;
assert(block_size >= word_size, "Incorrect size of block from freelist");
const size_t unused = block_size - word_size;
if (unused >= TreeChunk<Metablock, FreeList>::min_size()) {
if (unused >= TreeChunk<Metablock, FreeList<Metablock> >::min_size()) {
return_block(new_block + word_size, unused);
}
......@@ -2239,7 +2239,7 @@ ChunkIndex ChunkManager::list_index(size_t size) {
void SpaceManager::deallocate(MetaWord* p, size_t word_size) {
assert_lock_strong(_lock);
size_t raw_word_size = get_raw_word_size(word_size);
size_t min_size = TreeChunk<Metablock, FreeList>::min_size();
size_t min_size = TreeChunk<Metablock, FreeList<Metablock> >::min_size();
assert(raw_word_size >= min_size,
err_msg("Should not deallocate dark matter " SIZE_FORMAT "<" SIZE_FORMAT, word_size, min_size));
block_freelists()->return_block(p, raw_word_size);
......@@ -2295,7 +2295,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
void SpaceManager::retire_current_chunk() {
if (current_chunk() != NULL) {
size_t remaining_words = current_chunk()->free_word_size();
if (remaining_words >= TreeChunk<Metablock, FreeList>::min_size()) {
if (remaining_words >= TreeChunk<Metablock, FreeList<Metablock> >::min_size()) {
block_freelists()->return_block(current_chunk()->allocate(remaining_words), remaining_words);
inc_used_metrics(remaining_words);
}
......@@ -3278,7 +3278,7 @@ void Metaspace::deallocate(MetaWord* ptr, size_t word_size, bool is_class) {
assert(Thread::current()->is_VM_thread(), "should be the VM thread");
// Don't take Heap_lock
MutexLockerEx ml(vsm()->lock(), Mutex::_no_safepoint_check_flag);
if (word_size < TreeChunk<Metablock, FreeList>::min_size()) {
if (word_size < TreeChunk<Metablock, FreeList<Metablock> >::min_size()) {
// Dark matter. Too small for dictionary.
#ifdef ASSERT
Copy::fill_to_words((HeapWord*)ptr, word_size, 0xf5f5f5f5);
......@@ -3293,7 +3293,7 @@ void Metaspace::deallocate(MetaWord* ptr, size_t word_size, bool is_class) {
} else {
MutexLockerEx ml(vsm()->lock(), Mutex::_no_safepoint_check_flag);
if (word_size < TreeChunk<Metablock, FreeList>::min_size()) {
if (word_size < TreeChunk<Metablock, FreeList<Metablock> >::min_size()) {
// Dark matter. Too small for dictionary.
#ifdef ASSERT
Copy::fill_to_words((HeapWord*)ptr, word_size, 0xf5f5f5f5);
......
......@@ -242,7 +242,7 @@ typedef TwoOopHashtable<Klass*, mtClass> KlassTwoOopHashtable;
typedef Hashtable<Klass*, mtClass> KlassHashtable;
typedef HashtableEntry<Klass*, mtClass> KlassHashtableEntry;
typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
typedef BinaryTreeDictionary<Metablock, FreeList<Metablock> > MetablockTreeDictionary;
//--------------------------------------------------------------------------------
// VM_STRUCTS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册