--- old/src/share/vm/memory/metaspace.hpp 2017-11-16 00:47:41.246546184 -0800 +++ new/src/share/vm/memory/metaspace.hpp 2017-11-16 00:47:41.155538051 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,14 +104,15 @@ }; private: + static void verify_global_initialization(); + void initialize(Mutex* lock, MetaspaceType type); - // Get the first chunk for a Metaspace. Used for + // Initialize the first chunk for a Metaspace. Used for // special cases such as the boot class loader, reflection // class loader and anonymous class loader. - Metachunk* get_initialization_chunk(MetadataType mdtype, - size_t chunk_word_size, - size_t chunk_bunch); + void initialize_first_chunk(MetaspaceType type, MetadataType mdtype); + Metachunk* get_initialization_chunk(MetaspaceType type, MetadataType mdtype); // Align up the word size to the allocation word size static size_t align_word_size_up(size_t); @@ -138,6 +139,10 @@ SpaceManager* _class_vsm; SpaceManager* class_vsm() const { return _class_vsm; } + SpaceManager* get_space_manager(MetadataType mdtype) { + assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype"); + return mdtype == ClassType ? class_vsm() : vsm(); + } // Allocate space for metadata of type mdtype. This is space // within a Metachunk and is used by