--- a/hotspot/src/share/vm/oops/method.cpp Sat Jul 22 15:54:27 2017 -0400
+++ b/hotspot/src/share/vm/oops/method.cpp Wed Aug 02 18:06:38 2017 -0700
@@ -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_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 @@
}
+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