1.1 --- a/src/share/vm/memory/binaryTreeDictionary.cpp Fri Jan 18 05:33:32 2013 -0800 1.2 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp Wed Jan 23 13:02:39 2013 -0500 1.3 @@ -23,6 +23,7 @@ 1.4 */ 1.5 1.6 #include "precompiled.hpp" 1.7 +#include "utilities/macros.hpp" 1.8 #include "gc_implementation/shared/allocationStats.hpp" 1.9 #include "memory/binaryTreeDictionary.hpp" 1.10 #include "memory/freeList.hpp" 1.11 @@ -31,12 +32,13 @@ 1.12 #include "memory/metachunk.hpp" 1.13 #include "runtime/globals.hpp" 1.14 #include "utilities/ostream.hpp" 1.15 -#ifndef SERIALGC 1.16 +#include "utilities/macros.hpp" 1.17 +#if INCLUDE_ALL_GCS 1.18 #include "gc_implementation/concurrentMarkSweep/adaptiveFreeList.hpp" 1.19 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" 1.20 #include "gc_implementation/shared/spaceDecorator.hpp" 1.21 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" 1.22 -#endif // SERIALGC 1.23 +#endif // INCLUDE_ALL_GCS 1.24 1.25 //////////////////////////////////////////////////////////////////////////////// 1.26 // A binary tree based search structure for free blocks. 1.27 @@ -118,7 +120,7 @@ 1.28 } 1.29 1.30 1.31 -#ifndef SERIALGC 1.32 +#if INCLUDE_ALL_GCS 1.33 // Specialize for AdaptiveFreeList which tries to avoid 1.34 // splitting a chunk of a size that is under populated in favor of 1.35 // an over populated size. The general get_better_list() just returns 1.36 @@ -160,7 +162,7 @@ 1.37 } 1.38 return curTL; 1.39 } 1.40 -#endif // SERIALGC 1.41 +#endif // INCLUDE_ALL_GCS 1.42 1.43 template <class Chunk_t, template <class> class FreeList_t> 1.44 TreeList<Chunk_t, FreeList_t>* 1.45 @@ -871,7 +873,7 @@ 1.46 template <class Chunk_t, template <class> class FreeList_t> 1.47 void BinaryTreeDictionary<Chunk_t, FreeList_t>::dict_census_update(size_t size, bool split, bool birth){} 1.48 1.49 -#ifndef SERIALGC 1.50 +#if INCLUDE_ALL_GCS 1.51 template <> 1.52 void BinaryTreeDictionary<FreeChunk, AdaptiveFreeList>::dict_census_update(size_t size, bool split, bool birth){ 1.53 TreeList<FreeChunk, AdaptiveFreeList>* nd = find_list(size); 1.54 @@ -900,7 +902,7 @@ 1.55 // This is a birth associated with a LinAB. The chunk 1.56 // for the LinAB is not in the dictionary. 1.57 } 1.58 -#endif // SERIALGC 1.59 +#endif // INCLUDE_ALL_GCS 1.60 1.61 template <class Chunk_t, template <class> class FreeList_t> 1.62 bool BinaryTreeDictionary<Chunk_t, FreeList_t>::coal_dict_over_populated(size_t size) { 1.63 @@ -909,7 +911,7 @@ 1.64 return true; 1.65 } 1.66 1.67 -#ifndef SERIALGC 1.68 +#if INCLUDE_ALL_GCS 1.69 template <> 1.70 bool BinaryTreeDictionary<FreeChunk, AdaptiveFreeList>::coal_dict_over_populated(size_t size) { 1.71 if (FLSAlwaysCoalesceLarge) return true; 1.72 @@ -919,7 +921,7 @@ 1.73 return list_of_size == NULL || list_of_size->coal_desired() <= 0 || 1.74 list_of_size->count() > list_of_size->coal_desired(); 1.75 } 1.76 -#endif // SERIALGC 1.77 +#endif // INCLUDE_ALL_GCS 1.78 1.79 // Closures for walking the binary tree. 1.80 // do_list() walks the free list in a node applying the closure 1.81 @@ -979,7 +981,7 @@ 1.82 1.83 void do_list(FreeList<Chunk_t>* fl) {} 1.84 1.85 -#ifndef SERIALGC 1.86 +#if INCLUDE_ALL_GCS 1.87 void do_list(AdaptiveFreeList<Chunk_t>* fl) { 1.88 double coalSurplusPercent = _percentage; 1.89 fl->compute_desired(_inter_sweep_current, _inter_sweep_estimate, _intra_sweep_estimate); 1.90 @@ -987,7 +989,7 @@ 1.91 fl->set_before_sweep(fl->count()); 1.92 fl->set_bfr_surp(fl->surplus()); 1.93 } 1.94 -#endif // SERIALGC 1.95 +#endif // INCLUDE_ALL_GCS 1.96 }; 1.97 1.98 // Used to search the tree until a condition is met. 1.99 @@ -1134,13 +1136,13 @@ 1.100 setTreeSurplusClosure(double v) { percentage = v; } 1.101 void do_list(FreeList<Chunk_t>* fl) {} 1.102 1.103 -#ifndef SERIALGC 1.104 +#if INCLUDE_ALL_GCS 1.105 void do_list(AdaptiveFreeList<Chunk_t>* fl) { 1.106 double splitSurplusPercent = percentage; 1.107 fl->set_surplus(fl->count() - 1.108 (ssize_t)((double)fl->desired() * splitSurplusPercent)); 1.109 } 1.110 -#endif // SERIALGC 1.111 +#endif // INCLUDE_ALL_GCS 1.112 }; 1.113 1.114 template <class Chunk_t, template <class> class FreeList_t> 1.115 @@ -1157,7 +1159,7 @@ 1.116 setTreeHintsClosure(size_t v) { hint = v; } 1.117 void do_list(FreeList<Chunk_t>* fl) {} 1.118 1.119 -#ifndef SERIALGC 1.120 +#if INCLUDE_ALL_GCS 1.121 void do_list(AdaptiveFreeList<Chunk_t>* fl) { 1.122 fl->set_hint(hint); 1.123 assert(fl->hint() == 0 || fl->hint() > fl->size(), 1.124 @@ -1166,7 +1168,7 @@ 1.125 hint = fl->size(); 1.126 } 1.127 } 1.128 -#endif // SERIALGC 1.129 +#endif // INCLUDE_ALL_GCS 1.130 }; 1.131 1.132 template <class Chunk_t, template <class> class FreeList_t> 1.133 @@ -1180,7 +1182,7 @@ 1.134 class clearTreeCensusClosure : public AscendTreeCensusClosure<Chunk_t, FreeList_t> { 1.135 void do_list(FreeList<Chunk_t>* fl) {} 1.136 1.137 -#ifndef SERIALGC 1.138 +#if INCLUDE_ALL_GCS 1.139 void do_list(AdaptiveFreeList<Chunk_t>* fl) { 1.140 fl->set_prev_sweep(fl->count()); 1.141 fl->set_coal_births(0); 1.142 @@ -1188,7 +1190,7 @@ 1.143 fl->set_split_births(0); 1.144 fl->set_split_deaths(0); 1.145 } 1.146 -#endif // SERIALGC 1.147 +#endif // INCLUDE_ALL_GCS 1.148 }; 1.149 1.150 template <class Chunk_t, template <class> class FreeList_t> 1.151 @@ -1252,7 +1254,7 @@ 1.152 total()->set_count( total()->count() + fl->count() ); 1.153 } 1.154 1.155 -#ifndef SERIALGC 1.156 +#if INCLUDE_ALL_GCS 1.157 void do_list(AdaptiveFreeList<Chunk_t>* fl) { 1.158 if (++_print_line >= 40) { 1.159 FreeList_t<Chunk_t>::print_labels_on(gclog_or_tty, "size"); 1.160 @@ -1271,7 +1273,7 @@ 1.161 total()->set_split_births(total()->split_births() + fl->split_births()); 1.162 total()->set_split_deaths(total()->split_deaths() + fl->split_deaths()); 1.163 } 1.164 -#endif // SERIALGC 1.165 +#endif // INCLUDE_ALL_GCS 1.166 }; 1.167 1.168 template <class Chunk_t, template <class> class FreeList_t> 1.169 @@ -1286,7 +1288,7 @@ 1.170 FreeList_t<Chunk_t>::print_labels_on(gclog_or_tty, " "); 1.171 } 1.172 1.173 -#ifndef SERIALGC 1.174 +#if INCLUDE_ALL_GCS 1.175 template <> 1.176 void BinaryTreeDictionary<FreeChunk, AdaptiveFreeList>::print_dict_census(void) const { 1.177 1.178 @@ -1308,7 +1310,7 @@ 1.179 (double)(total->desired() - total->count()) 1.180 /(total->desired() != 0 ? (double)total->desired() : 1.0)); 1.181 } 1.182 -#endif // SERIALGC 1.183 +#endif // INCLUDE_ALL_GCS 1.184 1.185 template <class Chunk_t, template <class> class FreeList_t> 1.186 class PrintFreeListsClosure : public AscendTreeCensusClosure<Chunk_t, FreeList_t> { 1.187 @@ -1414,10 +1416,10 @@ 1.188 template class TreeChunk<Metachunk, FreeList>; 1.189 1.190 1.191 -#ifndef SERIALGC 1.192 +#if INCLUDE_ALL_GCS 1.193 // Explicitly instantiate these types for FreeChunk. 1.194 template class TreeList<FreeChunk, AdaptiveFreeList>; 1.195 template class BinaryTreeDictionary<FreeChunk, AdaptiveFreeList>; 1.196 template class TreeChunk<FreeChunk, AdaptiveFreeList>; 1.197 1.198 -#endif // SERIALGC 1.199 +#endif // INCLUDE_ALL_GCS