src/hotspot/share/memory/metaspace/chunkAllocSequence.cpp
branchstuefe-new-metaspace-branch
changeset 58881 24152dbf6c78
parent 58807 3863dfd99d8e
equal deleted inserted replaced
58880:e18d2d9d1515 58881:24152dbf6c78
    93     // .. repeat last
    93     // .. repeat last
    94 };
    94 };
    95 
    95 
    96 static const chklvl_t g_sequ_refl_class[] = {
    96 static const chklvl_t g_sequ_refl_class[] = {
    97     chklvl::CHUNK_LEVEL_1K,
    97     chklvl::CHUNK_LEVEL_1K,
       
    98     // .. repeat last
       
    99 };
       
   100 
       
   101 // Boot class loader: give it large chunks: beyond commit granule size
       
   102 // (typically 64K) the costs for large chunks largely diminishes since
       
   103 // they are committed on the fly.
       
   104 static const chklvl_t g_sequ_boot_non_class[] = {
       
   105     chklvl::CHUNK_LEVEL_4M,
       
   106     chklvl::CHUNK_LEVEL_1M
       
   107     // .. repeat last
       
   108 };
       
   109 
       
   110 static const chklvl_t g_sequ_boot_class[] = {
       
   111     chklvl::CHUNK_LEVEL_1M,
       
   112     chklvl::CHUNK_LEVEL_256K
    98     // .. repeat last
   113     // .. repeat last
    99 };
   114 };
   100 
   115 
   101 #define DEFINE_CLASS_FOR_ARRAY(what) \
   116 #define DEFINE_CLASS_FOR_ARRAY(what) \
   102   static ConstantChunkAllocSequence g_chunk_alloc_sequence_##what (g_sequ_##what, sizeof(g_sequ_##what)/sizeof(chklvl_t));
   117   static ConstantChunkAllocSequence g_chunk_alloc_sequence_##what (g_sequ_##what, sizeof(g_sequ_##what)/sizeof(chklvl_t));
   105 DEFINE_CLASS_FOR_ARRAY(standard_class)
   120 DEFINE_CLASS_FOR_ARRAY(standard_class)
   106 DEFINE_CLASS_FOR_ARRAY(anon_non_class)
   121 DEFINE_CLASS_FOR_ARRAY(anon_non_class)
   107 DEFINE_CLASS_FOR_ARRAY(anon_class)
   122 DEFINE_CLASS_FOR_ARRAY(anon_class)
   108 DEFINE_CLASS_FOR_ARRAY(refl_non_class)
   123 DEFINE_CLASS_FOR_ARRAY(refl_non_class)
   109 DEFINE_CLASS_FOR_ARRAY(refl_class)
   124 DEFINE_CLASS_FOR_ARRAY(refl_class)
   110 
   125 DEFINE_CLASS_FOR_ARRAY(boot_non_class)
   111 
   126 DEFINE_CLASS_FOR_ARRAY(boot_class)
       
   127 
       
   128 /*
   112 class BootLoaderChunkAllocSequence : public ChunkAllocSequence {
   129 class BootLoaderChunkAllocSequence : public ChunkAllocSequence {
   113 
   130 
   114   // For now, this mirrors what the old code did
   131   // For now, this mirrors what the old code did
   115   // (see SpaceManager::get_initial_chunk_size() and SpaceManager::calc_chunk_size).
   132   // (see SpaceManager::get_initial_chunk_size() and SpaceManager::calc_chunk_size).
   116 
   133 
   155 
   172 
   156 };
   173 };
   157 
   174 
   158 static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_non_class(false);
   175 static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_non_class(false);
   159 static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_class(true);
   176 static BootLoaderChunkAllocSequence g_chunk_alloc_sequence_boot_class(true);
   160 
   177 */
   161 
   178 
   162 const ChunkAllocSequence* ChunkAllocSequence::alloc_sequence_by_space_type(MetaspaceType space_type, bool is_class) {
   179 const ChunkAllocSequence* ChunkAllocSequence::alloc_sequence_by_space_type(MetaspaceType space_type, bool is_class) {
   163 
   180 
   164   if (is_class) {
   181   if (is_class) {
   165     switch(space_type) {
   182     switch(space_type) {