< prev index next >
src/share/vm/oops/annotations.cpp
Print this page
*** 22,41 ****
*
*/
#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "memory/heapInspection.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/oopFactory.hpp"
#include "oops/annotations.hpp"
#include "oops/instanceKlass.hpp"
#include "utilities/ostream.hpp"
// Allocate annotations in metadata area
Annotations* Annotations::allocate(ClassLoaderData* loader_data, TRAPS) {
! return new (loader_data, size(), true, MetaspaceObj::AnnotationType, THREAD) Annotations();
}
// helper
void Annotations::free_contents(ClassLoaderData* loader_data, Array<AnnotationArray*>* p) {
if (p != NULL) {
--- 22,43 ----
*
*/
#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
+ #include "logging/log.hpp"
#include "memory/heapInspection.hpp"
#include "memory/metadataFactory.hpp"
+ #include "memory/metaspaceClosure.hpp"
#include "memory/oopFactory.hpp"
#include "oops/annotations.hpp"
#include "oops/instanceKlass.hpp"
#include "utilities/ostream.hpp"
// Allocate annotations in metadata area
Annotations* Annotations::allocate(ClassLoaderData* loader_data, TRAPS) {
! return new (loader_data, size(), MetaspaceObj::AnnotationsType, THREAD) Annotations();
}
// helper
void Annotations::free_contents(ClassLoaderData* loader_data, Array<AnnotationArray*>* p) {
if (p != NULL) {
*** 72,81 ****
--- 74,90 ----
} else {
return NULL;
}
}
+ void Annotations::metaspace_pointers_do(MetaspaceClosure* it) {
+ log_trace(cds)("Iter(Annotations): %p", this);
+ it->push(&_class_annotations);
+ it->push(&_fields_annotations);
+ it->push(&_class_type_annotations);
+ it->push(&_fields_type_annotations); // FIXME: need a test case where _fields_type_annotations != NULL
+ }
void Annotations::print_value_on(outputStream* st) const {
st->print("Anotations(" INTPTR_FORMAT ")", p2i(this));
}
< prev index next >