--- old/src/share/vm/oops/constMethod.cpp 2017-06-29 15:57:39.212492572 -0700 +++ new/src/share/vm/oops/constMethod.cpp 2017-06-29 15:57:39.024485345 -0700 @@ -27,6 +27,7 @@ #include "interpreter/interpreter.hpp" #include "memory/heapInspection.hpp" #include "memory/metadataFactory.hpp" +#include "memory/metaspaceClosure.hpp" #include "memory/resourceArea.hpp" #include "oops/constMethod.hpp" #include "oops/method.hpp" @@ -41,7 +42,7 @@ MethodType method_type, TRAPS) { int size = ConstMethod::size(byte_code_size, sizes); - return new (loader_data, size, true, MetaspaceObj::ConstMethodType, THREAD) ConstMethod( + return new (loader_data, size, MetaspaceObj::ConstMethodType, THREAD) ConstMethod( byte_code_size, sizes, method_type, size); } @@ -401,6 +402,25 @@ } } +void ConstMethod::metaspace_pointers_do(MetaspaceClosure* it) { + log_trace(cds)("Iter(ConstMethod): %p", this); + + it->push(&_constants); + it->push(&_stackmap_data); + if (has_method_annotations()) { + it->push(method_annotations_addr()); + } + if (has_parameter_annotations()) { + it->push(parameter_annotations_addr()); + } + if (has_type_annotations()) { + it->push(type_annotations_addr()); + } + if (has_default_annotations()) { + it->push(default_annotations_addr()); + } +} + // Printing void ConstMethod::print_on(outputStream* st) const {