comparison src/share/vm/oops/annotations.cpp @ 13584:2dfe246179c0

Merge
author dholmes
date Wed, 20 Sep 2017 23:55:35 -0400
parents 53a41e7cbe05
children
comparison
equal deleted inserted replaced
5:fbf72cf13fd1 6:92496fdd2ccd
1 /* 1 /*
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "classfile/classLoaderData.hpp" 26 #include "classfile/classLoaderData.hpp"
27 #include "logging/log.hpp"
27 #include "memory/heapInspection.hpp" 28 #include "memory/heapInspection.hpp"
28 #include "memory/metadataFactory.hpp" 29 #include "memory/metadataFactory.hpp"
30 #include "memory/metaspaceClosure.hpp"
29 #include "memory/oopFactory.hpp" 31 #include "memory/oopFactory.hpp"
30 #include "oops/annotations.hpp" 32 #include "oops/annotations.hpp"
31 #include "oops/instanceKlass.hpp" 33 #include "oops/instanceKlass.hpp"
32 #include "utilities/ostream.hpp" 34 #include "utilities/ostream.hpp"
33 35
34 // Allocate annotations in metadata area 36 // Allocate annotations in metadata area
35 Annotations* Annotations::allocate(ClassLoaderData* loader_data, TRAPS) { 37 Annotations* Annotations::allocate(ClassLoaderData* loader_data, TRAPS) {
36 return new (loader_data, size(), true, MetaspaceObj::AnnotationType, THREAD) Annotations(); 38 return new (loader_data, size(), MetaspaceObj::AnnotationsType, THREAD) Annotations();
37 } 39 }
38 40
39 // helper 41 // helper
40 void Annotations::free_contents(ClassLoaderData* loader_data, Array<AnnotationArray*>* p) { 42 void Annotations::free_contents(ClassLoaderData* loader_data, Array<AnnotationArray*>* p) {
41 if (p != NULL) { 43 if (p != NULL) {
72 } else { 74 } else {
73 return NULL; 75 return NULL;
74 } 76 }
75 } 77 }
76 78
79 void Annotations::metaspace_pointers_do(MetaspaceClosure* it) {
80 log_trace(cds)("Iter(Annotations): %p", this);
81 it->push(&_class_annotations);
82 it->push(&_fields_annotations);
83 it->push(&_class_type_annotations);
84 it->push(&_fields_type_annotations); // FIXME: need a test case where _fields_type_annotations != NULL
85 }
77 86
78 void Annotations::print_value_on(outputStream* st) const { 87 void Annotations::print_value_on(outputStream* st) const {
79 st->print("Anotations(" INTPTR_FORMAT ")", p2i(this)); 88 st->print("Anotations(" INTPTR_FORMAT ")", p2i(this));
80 } 89 }
81 90