< prev index next >

src/share/vm/memory/binaryTreeDictionary.cpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:
   1 /*
   2  * Copyright (c) 2001, 2014, 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 #include "precompiled.hpp"
  26 #include "gc_implementation/shared/allocationStats.hpp"
  27 #include "gc_implementation/shared/spaceDecorator.hpp"
  28 #include "memory/binaryTreeDictionary.hpp"
  29 #include "memory/freeList.hpp"
  30 #include "memory/freeBlockDictionary.hpp"

  31 #include "memory/metachunk.hpp"
  32 #include "runtime/globals.hpp"
  33 #include "utilities/ostream.hpp"
  34 #include "utilities/macros.hpp"

  35 #if INCLUDE_ALL_GCS
  36 #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp"
  37 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
  38 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp"
  39 #endif // INCLUDE_ALL_GCS
  40 
  41 ////////////////////////////////////////////////////////////////////////////////
  42 // A binary tree based search structure for free blocks.
  43 // This is currently used in the Concurrent Mark&Sweep implementation.
  44 ////////////////////////////////////////////////////////////////////////////////
  45 
  46 template <class Chunk_t, class FreeList_t>
  47 size_t TreeChunk<Chunk_t, FreeList_t>::_min_tree_chunk_size = sizeof(TreeChunk<Chunk_t,  FreeList_t>)/HeapWordSize;
  48 
  49 template <class Chunk_t, class FreeList_t>
  50 TreeChunk<Chunk_t, FreeList_t>* TreeChunk<Chunk_t, FreeList_t>::as_TreeChunk(Chunk_t* fc) {
  51   // Do some assertion checking here.
  52   return (TreeChunk<Chunk_t, FreeList_t>*) fc;
  53 }
  54 
  55 template <class Chunk_t, class FreeList_t>
  56 void TreeChunk<Chunk_t, FreeList_t>::verify_tree_chunk_list() const {
  57   TreeChunk<Chunk_t, FreeList_t>* nextTC = (TreeChunk<Chunk_t, FreeList_t>*)next();
  58   if (prev() != NULL) { // interior list node shouldn't have tree fields


   1 /*
   2  * Copyright (c) 2001, 2015, 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 #include "precompiled.hpp"
  26 #include "gc/cms/allocationStats.hpp"
  27 #include "gc/shared/spaceDecorator.hpp"
  28 #include "memory/binaryTreeDictionary.hpp"

  29 #include "memory/freeBlockDictionary.hpp"
  30 #include "memory/freeList.hpp"
  31 #include "memory/metachunk.hpp"
  32 #include "runtime/globals.hpp"

  33 #include "utilities/macros.hpp"
  34 #include "utilities/ostream.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/cms/adaptiveFreeList.hpp"
  37 #include "gc/cms/freeChunk.hpp"

  38 #endif // INCLUDE_ALL_GCS
  39 
  40 ////////////////////////////////////////////////////////////////////////////////
  41 // A binary tree based search structure for free blocks.
  42 // This is currently used in the Concurrent Mark&Sweep implementation.
  43 ////////////////////////////////////////////////////////////////////////////////
  44 
  45 template <class Chunk_t, class FreeList_t>
  46 size_t TreeChunk<Chunk_t, FreeList_t>::_min_tree_chunk_size = sizeof(TreeChunk<Chunk_t,  FreeList_t>)/HeapWordSize;
  47 
  48 template <class Chunk_t, class FreeList_t>
  49 TreeChunk<Chunk_t, FreeList_t>* TreeChunk<Chunk_t, FreeList_t>::as_TreeChunk(Chunk_t* fc) {
  50   // Do some assertion checking here.
  51   return (TreeChunk<Chunk_t, FreeList_t>*) fc;
  52 }
  53 
  54 template <class Chunk_t, class FreeList_t>
  55 void TreeChunk<Chunk_t, FreeList_t>::verify_tree_chunk_list() const {
  56   TreeChunk<Chunk_t, FreeList_t>* nextTC = (TreeChunk<Chunk_t, FreeList_t>*)next();
  57   if (prev() != NULL) { // interior list node shouldn't have tree fields


< prev index next >