|
1 /* |
|
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
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 |
|
7 * published by the Free Software Foundation. |
|
8 * |
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
|
13 * accompanied this code). |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License version |
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 * |
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 * or visit www.oracle.com if you need additional information or have any |
|
21 * questions. |
|
22 * |
|
23 */ |
|
24 |
|
25 #include "precompiled.hpp" |
|
26 #include "oops/metadata.hpp" |
|
27 #include "memory/metaspace.hpp" |
|
28 #include "memory/resourceArea.hpp" |
|
29 #include "prims/jvmtiRedefineClasses.hpp" |
|
30 |
|
31 void Metadata::set_on_stack(const bool value) { |
|
32 // nothing to set for most metadata |
|
33 // Can't inline because this materializes the vtable on some C++ compilers. |
|
34 } |
|
35 |
|
36 void Metadata::print_on(outputStream* st) const { |
|
37 ResourceMark rm; |
|
38 // print title |
|
39 st->print("%s", internal_name()); |
|
40 print_address_on(st); |
|
41 st->cr(); |
|
42 } |
|
43 |
|
44 char* Metadata::print_value_string() const { |
|
45 char buf[256]; |
|
46 stringStream st(buf, sizeof(buf)); |
|
47 if (this == NULL) { |
|
48 st.print("NULL"); |
|
49 } else { |
|
50 print_value_on(&st); |
|
51 } |
|
52 return st.as_string(); |
|
53 } |