8267879: ClassLoaderMetaspace destructor asserts on !_frozen
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
ecf6112a21
commit
a8835b9c08
@ -478,13 +478,6 @@ char* VM_PopulateDumpSharedSpace::dump_read_only_tables() {
|
||||
void VM_PopulateDumpSharedSpace::doit() {
|
||||
HeapShared::run_full_gc_in_vm_thread();
|
||||
|
||||
// We should no longer allocate anything from the metaspace, so that:
|
||||
//
|
||||
// (1) Metaspace::allocate might trigger GC if we have run out of
|
||||
// committed metaspace, but we can't GC because we're running
|
||||
// in the VM thread.
|
||||
// (2) ArchiveBuilder needs to work with a stable set of MetaspaceObjs.
|
||||
Metaspace::freeze();
|
||||
DEBUG_ONLY(SystemDictionaryShared::NoClassLoadingMark nclm);
|
||||
|
||||
FileMapInfo::check_nonempty_dir_in_shared_path_table();
|
||||
|
@ -81,8 +81,6 @@ ClassLoaderMetaspace::ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType
|
||||
}
|
||||
|
||||
ClassLoaderMetaspace::~ClassLoaderMetaspace() {
|
||||
Metaspace::assert_not_frozen();
|
||||
|
||||
UL(debug, "dies.");
|
||||
|
||||
delete _non_class_space_arena;
|
||||
@ -92,7 +90,6 @@ ClassLoaderMetaspace::~ClassLoaderMetaspace() {
|
||||
|
||||
// Allocate word_size words from Metaspace.
|
||||
MetaWord* ClassLoaderMetaspace::allocate(size_t word_size, Metaspace::MetadataType mdType) {
|
||||
Metaspace::assert_not_frozen();
|
||||
if (Metaspace::is_class_space_allocation(mdType)) {
|
||||
return class_space_arena()->allocate(word_size);
|
||||
} else {
|
||||
@ -103,7 +100,6 @@ MetaWord* ClassLoaderMetaspace::allocate(size_t word_size, Metaspace::MetadataTy
|
||||
// Attempt to expand the GC threshold to be good for at least another word_size words
|
||||
// and allocate. Returns NULL if failure. Used during Metaspace GC.
|
||||
MetaWord* ClassLoaderMetaspace::expand_and_allocate(size_t word_size, Metaspace::MetadataType mdType) {
|
||||
Metaspace::assert_not_frozen();
|
||||
size_t delta_bytes = MetaspaceGC::delta_capacity_until_GC(word_size * BytesPerWord);
|
||||
assert(delta_bytes > 0, "Must be");
|
||||
|
||||
@ -135,7 +131,6 @@ MetaWord* ClassLoaderMetaspace::expand_and_allocate(size_t word_size, Metaspace:
|
||||
// Prematurely returns a metaspace allocation to the _block_freelists
|
||||
// because it is not needed anymore.
|
||||
void ClassLoaderMetaspace::deallocate(MetaWord* ptr, size_t word_size, bool is_class) {
|
||||
Metaspace::assert_not_frozen();
|
||||
if (Metaspace::using_class_space() && is_class) {
|
||||
class_space_arena()->deallocate(ptr, word_size);
|
||||
} else {
|
||||
|
@ -535,8 +535,6 @@ void MetaspaceGC::compute_new_size() {
|
||||
|
||||
const MetaspaceTracer* Metaspace::_tracer = NULL;
|
||||
|
||||
DEBUG_ONLY(bool Metaspace::_frozen = false;)
|
||||
|
||||
bool Metaspace::initialized() {
|
||||
return metaspace::MetaspaceContext::context_nonclass() != NULL
|
||||
LP64_ONLY(&& (using_class_space() ? Metaspace::class_space_is_initialized() : true));
|
||||
@ -851,7 +849,6 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
|
||||
MetaspaceObj::Type type) {
|
||||
assert(word_size <= Metaspace::max_allocation_word_size(),
|
||||
"allocation size too large (" SIZE_FORMAT ")", word_size);
|
||||
assert(!_frozen, "sanity");
|
||||
|
||||
assert(loader_data != NULL, "Should never pass around a NULL loader_data. "
|
||||
"ClassLoaderData::the_null_class_loader_data() should have been used.");
|
||||
|
@ -62,8 +62,6 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
DEBUG_ONLY(static bool _frozen;)
|
||||
|
||||
static const MetaspaceTracer* _tracer;
|
||||
|
||||
static bool _initialized;
|
||||
@ -71,13 +69,6 @@ private:
|
||||
public:
|
||||
|
||||
static const MetaspaceTracer* tracer() { return _tracer; }
|
||||
static void freeze() {
|
||||
assert(DumpSharedSpaces, "sanity");
|
||||
DEBUG_ONLY(_frozen = true;)
|
||||
}
|
||||
static void assert_not_frozen() {
|
||||
assert(!_frozen, "sanity");
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user