annotate hotspot/src/share/vm/oops/metadata.cpp @ 13728:882756847a04

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents
children 1f304d0c888b
rev   line source
coleenp@13728 1 /*
coleenp@13728 2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
coleenp@13728 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@13728 4 *
coleenp@13728 5 * This code is free software; you can redistribute it and/or modify it
coleenp@13728 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@13728 7 * published by the Free Software Foundation.
coleenp@13728 8 *
coleenp@13728 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@13728 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@13728 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@13728 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@13728 13 * accompanied this code).
coleenp@13728 14 *
coleenp@13728 15 * You should have received a copy of the GNU General Public License version
coleenp@13728 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@13728 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@13728 18 *
coleenp@13728 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@13728 20 * or visit www.oracle.com if you need additional information or have any
coleenp@13728 21 * questions.
coleenp@13728 22 *
coleenp@13728 23 */
coleenp@13728 24
coleenp@13728 25 #include "precompiled.hpp"
coleenp@13728 26 #include "oops/metadata.hpp"
coleenp@13728 27 #include "memory/metaspace.hpp"
coleenp@13728 28 #include "memory/resourceArea.hpp"
coleenp@13728 29 #include "prims/jvmtiRedefineClasses.hpp"
coleenp@13728 30
coleenp@13728 31 void Metadata::set_on_stack(const bool value) {
coleenp@13728 32 // nothing to set for most metadata
coleenp@13728 33 // Can't inline because this materializes the vtable on some C++ compilers.
coleenp@13728 34 }
coleenp@13728 35
coleenp@13728 36 void Metadata::print_on(outputStream* st) const {
coleenp@13728 37 ResourceMark rm;
coleenp@13728 38 // print title
coleenp@13728 39 st->print("%s", internal_name());
coleenp@13728 40 print_address_on(st);
coleenp@13728 41 st->cr();
coleenp@13728 42 }
coleenp@13728 43
coleenp@13728 44 char* Metadata::print_value_string() const {
coleenp@13728 45 char buf[100];
coleenp@13728 46 stringStream st(buf, sizeof(buf));
coleenp@13728 47 if (this == NULL) {
coleenp@13728 48 st.print("NULL");
coleenp@13728 49 } else {
coleenp@13728 50 print_value_on(&st);
coleenp@13728 51 }
coleenp@13728 52 return st.as_string();
coleenp@13728 53 }