src/hotspot/share/memory/metaspace.cpp
changeset 49386 d89e98d85841
parent 49372 3bb8b00832d0
child 49389 9ef2eee8ca7c
equal deleted inserted replaced
49385:1517b9220e64 49386:d89e98d85841
  1692   occupancy_map()->set_chunk_starts_at_address((MetaWord*)result, true);
  1692   occupancy_map()->set_chunk_starts_at_address((MetaWord*)result, true);
  1693   do_update_in_use_info_for_chunk(result, true);
  1693   do_update_in_use_info_for_chunk(result, true);
  1694 
  1694 
  1695   inc_container_count();
  1695   inc_container_count();
  1696 
  1696 
  1697   DEBUG_ONLY(chunk_manager->locked_verify());
  1697   if (metaspace_slow_verify) {
  1698   DEBUG_ONLY(this->verify());
  1698     DEBUG_ONLY(chunk_manager->locked_verify());
       
  1699     DEBUG_ONLY(this->verify());
       
  1700   }
       
  1701 
  1699   DEBUG_ONLY(do_verify_chunk(result));
  1702   DEBUG_ONLY(do_verify_chunk(result));
  1700 
  1703 
  1701   result->inc_use_count();
  1704   result->inc_use_count();
  1702 
  1705 
  1703   return result;
  1706   return result;
  1944   // VirtualSpaceNode::container_count does not have to be modified:
  1947   // VirtualSpaceNode::container_count does not have to be modified:
  1945   // it means "number of active (non-free) chunks", so merging free chunks
  1948   // it means "number of active (non-free) chunks", so merging free chunks
  1946   // should not affect that count.
  1949   // should not affect that count.
  1947 
  1950 
  1948   // At the end of a chunk merge, run verification tests.
  1951   // At the end of a chunk merge, run verification tests.
  1949   DEBUG_ONLY(this->locked_verify());
  1952   if (metaspace_slow_verify) {
  1950   DEBUG_ONLY(vsn->verify());
  1953     DEBUG_ONLY(this->locked_verify());
       
  1954     DEBUG_ONLY(vsn->verify());
       
  1955   }
  1951 
  1956 
  1952   return true;
  1957   return true;
  1953 }
  1958 }
  1954 
  1959 
  1955 // Remove all chunks in the given area - the chunks are supposed to be free -
  1960 // Remove all chunks in the given area - the chunks are supposed to be free -
  2964   chunk->set_next(NULL);
  2969   chunk->set_next(NULL);
  2965   chunk->set_prev(NULL);
  2970   chunk->set_prev(NULL);
  2966 
  2971 
  2967   // Run some verifications (some more if we did a chunk split)
  2972   // Run some verifications (some more if we did a chunk split)
  2968 #ifdef ASSERT
  2973 #ifdef ASSERT
  2969   locked_verify();
  2974   if (metaspace_slow_verify) {
  2970   VirtualSpaceNode* const vsn = chunk->container();
  2975     locked_verify();
  2971   vsn->verify();
  2976     VirtualSpaceNode* const vsn = chunk->container();
  2972   if (we_did_split_a_chunk) {
  2977     vsn->verify();
  2973     vsn->verify_free_chunks_are_ideally_merged();
  2978     if (we_did_split_a_chunk) {
       
  2979       vsn->verify_free_chunks_are_ideally_merged();
       
  2980     }
  2974   }
  2981   }
  2975 #endif
  2982 #endif
  2976 
  2983 
  2977   return chunk;
  2984   return chunk;
  2978 }
  2985 }