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

@ -37,6 +37,7 @@
#include "interpreter/oopMapCache.hpp"
#include "memory/heapInspection.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/metaspaceClosure.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
@ -79,7 +80,7 @@ Method* Method::allocate(ClassLoaderData* loader_data,
method_type,
CHECK_NULL);
int size = Method::size(access_flags.is_native());
return new (loader_data, size, false, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
return new (loader_data, size, MetaspaceObj::MethodType, THREAD) Method(cm, access_flags);
}
Method::Method(ConstMethod* xconst, AccessFlags access_flags) {
@ -305,6 +306,14 @@ Symbol* Method::klass_name() const {
}
void Method::metaspace_pointers_do(MetaspaceClosure* it) {
log_trace(cds)("Iter(Method): %p", this);
it->push(&_constMethod);
it->push(&_method_data);
it->push(&_method_counters);
}
// Attempt to return method oop to original state. Clear any pointers
// (to objects outside the shared spaces). We won't be able to predict
// where they should point in a new JVM. Further initialize some