8072061: Automatically determine optimal sizes for the CDS regions

See new C++ class MetaspaceClosure.

Reviewed-by: coleenp, jiangli, mseledtsov
This commit is contained in:
Ioi Lam 2017-08-02 18:06:38 -07:00
parent 4b983a51fd
commit f7f193ae71
82 changed files with 2010 additions and 1622 deletions

View file

@ -74,7 +74,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
(SharedClassPathEntry*)FileMapInfo::shared_classpath(path_index);
ClassFileStream* stream = new ClassFileStream(ptr,
end_ptr - ptr,
ent == NULL ? NULL : ent->_name,
ent == NULL ? NULL : ent->name(),
ClassFileStream::verify);
ClassFileParser parser(stream,
class_name,
@ -229,8 +229,7 @@ InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream,
len = stream->length();
bytes = stream->buffer();
}
p = (JvmtiCachedClassFileData*)MetaspaceShared::optional_data_space_alloc(
offset_of(JvmtiCachedClassFileData, data) + len);
p = (JvmtiCachedClassFileData*)os::malloc(offset_of(JvmtiCachedClassFileData, data) + len, mtInternal);
p->length = len;
memcpy(p->data, bytes, len);
result->set_archived_class_data(p);