提交 c5d6db2c 编写于 作者: J jmasa

8006537: Assert when dumping archive with default methods

Reviewed-by: coleenp
上级 7edd140a
......@@ -318,6 +318,7 @@ ClassLoaderData::~ClassLoaderData() {
}
Metaspace* ClassLoaderData::metaspace_non_null() {
assert(!DumpSharedSpaces, "wrong metaspace!");
// If the metaspace has not been allocated, create a new one. Might want
// to create smaller arena for Reflection class loaders also.
// The reason for the delayed allocation is because some class loaders are
......
......@@ -66,7 +66,11 @@ class MetadataFactory : AllStatic {
if (data != NULL) {
assert(loader_data != NULL, "shouldn't pass null");
int size = data->size();
loader_data->metaspace_non_null()->deallocate((MetaWord*)data, size, false);
if (DumpSharedSpaces) {
loader_data->ro_metaspace()->deallocate((MetaWord*)data, size, false);
} else {
loader_data->metaspace_non_null()->deallocate((MetaWord*)data, size, false);
}
}
}
......@@ -77,6 +81,7 @@ class MetadataFactory : AllStatic {
assert(loader_data != NULL, "shouldn't pass null");
int size = md->size();
// Call metadata's deallocate function which will call deallocate fields
assert(!DumpSharedSpaces, "cannot deallocate metadata when dumping CDS archive");
assert(!md->on_stack(), "can't deallocate things on stack");
md->deallocate_contents(loader_data);
loader_data->metaspace_non_null()->deallocate((MetaWord*)md, size, md->is_klass());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册