annotate src/share/vm/ci/ciObject.cpp @ 8733:9def4075da6d

8008079: G1: Add nextObject routine to CMBitMapRO and replace nextWord Summary: Update the task local finger to the start of the next object when marking aborts, in order to avoid the redundant scanning of all 0's when the marking task restarts, if otherwise updating to the next word. In addition, reuse the routine nextObject() in routine iterate(). Reviewed-by: johnc, ysr Contributed-by: tamao <tao.mao@oracle.com>
author tamao
date Tue, 05 Mar 2013 15:36:56 -0800
parents da91efe96a93
children e522a00b91aa 78bbf4d43a14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "ci/ciObject.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "ci/ciUtilities.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "oops/oop.inline2.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
32 //
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // This class represents an oop in the HotSpot virtual machine.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 // Its subclasses are structured in a hierarchy which mirrors
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // an aggregate of the VM's oop and klass hierarchies (see
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // oopHierarchy.hpp). Each instance of ciObject holds a handle
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // to a corresponding oop on the VM side and provides routines
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // for accessing the information in its oop. By using the ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // hierarchy for accessing oops in the VM, the compiler ensures
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // that it is safe with respect to garbage collection; that is,
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // GC and compilation can proceed independently without
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // interference.
a61af66fc99e Initial load
duke
parents:
diff changeset
43 //
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // Within the VM, the oop and klass hierarchies are separate.
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // The compiler interface does not preserve this separation --
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
46 // the distinction between `Klass*' and `Klass' are not
0
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // reflected in the interface and instead the Klass hierarchy
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // is directly modeled as the subclasses of ciKlass.
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // ciObject::ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
52 ciObject::ciObject(oop o) {
a61af66fc99e Initial load
duke
parents:
diff changeset
53 ASSERT_IN_VM;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 if (ciObjectFactory::is_initialized()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
55 _handle = JNIHandles::make_local(o);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 _handle = JNIHandles::make_global(o);
a61af66fc99e Initial load
duke
parents:
diff changeset
58 }
a61af66fc99e Initial load
duke
parents:
diff changeset
59 _klass = NULL;
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
60 init_flags_from(o);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // ciObject::ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
65 //
a61af66fc99e Initial load
duke
parents:
diff changeset
66 ciObject::ciObject(Handle h) {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 ASSERT_IN_VM;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 if (ciObjectFactory::is_initialized()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 _handle = JNIHandles::make_local(h());
a61af66fc99e Initial load
duke
parents:
diff changeset
70 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 _handle = JNIHandles::make_global(h);
a61af66fc99e Initial load
duke
parents:
diff changeset
72 }
a61af66fc99e Initial load
duke
parents:
diff changeset
73 _klass = NULL;
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
74 init_flags_from(h());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // ciObject::ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
79 //
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // Unloaded klass/method variant. `klass' is the klass of the unloaded
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // klass/method, if that makes sense.
a61af66fc99e Initial load
duke
parents:
diff changeset
82 ciObject::ciObject(ciKlass* klass) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 ASSERT_IN_VM;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 assert(klass != NULL, "must supply klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
85 _handle = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 _klass = klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // ciObject::ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
91 //
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // NULL variant. Used only by ciNullObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
93 ciObject::ciObject() {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 ASSERT_IN_VM;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 _handle = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
96 _klass = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // ciObject::klass
a61af66fc99e Initial load
duke
parents:
diff changeset
101 //
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Get the ciKlass of this ciObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
103 ciKlass* ciObject::klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
104 if (_klass == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 if (_handle == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // When both _klass and _handle are NULL, we are dealing
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // with the distinguished instance of ciNullObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
108 // No one should ask it for its klass.
a61af66fc99e Initial load
duke
parents:
diff changeset
109 assert(is_null_object(), "must be null object");
a61af66fc99e Initial load
duke
parents:
diff changeset
110 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
111 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 GUARDED_VM_ENTRY(
a61af66fc99e Initial load
duke
parents:
diff changeset
115 oop o = get_oop();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
116 _klass = CURRENT_ENV->get_klass(o->klass());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
117 );
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return _klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // ciObject::equals
a61af66fc99e Initial load
duke
parents:
diff changeset
124 //
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // Are two ciObjects equal?
a61af66fc99e Initial load
duke
parents:
diff changeset
126 bool ciObject::equals(ciObject* obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
127 return (this == obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // ciObject::hash
a61af66fc99e Initial load
duke
parents:
diff changeset
132 //
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // A hash value for the convenience of compilers.
a61af66fc99e Initial load
duke
parents:
diff changeset
134 //
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // Implementation note: we use the address of the ciObject as the
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // basis for the hash. Use the _ident field, which is well-behaved.
a61af66fc99e Initial load
duke
parents:
diff changeset
137 int ciObject::hash() {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 return ident() * 31;
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // ------------------------------------------------------------------
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
142 // ciObject::constant_encoding
0
a61af66fc99e Initial load
duke
parents:
diff changeset
143 //
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // The address which the compiler should embed into the
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // generated code to represent this oop. This address
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // is not the true address of the oop -- it will get patched
a61af66fc99e Initial load
duke
parents:
diff changeset
147 // during nmethod creation.
a61af66fc99e Initial load
duke
parents:
diff changeset
148 //
a61af66fc99e Initial load
duke
parents:
diff changeset
149 //
a61af66fc99e Initial load
duke
parents:
diff changeset
150 //
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // Implementation note: we use the handle as the encoding. The
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // nmethod constructor resolves the handle and patches in the oop.
a61af66fc99e Initial load
duke
parents:
diff changeset
153 //
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // This method should be changed to return an generified address
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // to discourage use of the JNI handle.
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
156 jobject ciObject::constant_encoding() {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
157 assert(is_null_object() || handle() != NULL, "cannot embed null pointer");
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
158 assert(can_be_constant(), "oop must be NULL or perm");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
159 return handle();
a61af66fc99e Initial load
duke
parents:
diff changeset
160 }
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 // ------------------------------------------------------------------
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
163 // ciObject::can_be_constant
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
164 bool ciObject::can_be_constant() {
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
165 if (ScavengeRootsInCode >= 1) return true; // now everybody can encode as a constant
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
166 return handle() == NULL;
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
167 }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
168
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
169 // ------------------------------------------------------------------
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
170 // ciObject::should_be_constant()
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
171 bool ciObject::should_be_constant() {
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
172 if (ScavengeRootsInCode >= 2) return true; // force everybody to be a constant
3905
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
173 if (is_null_object()) return true;
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
174
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
175 ciEnv* env = CURRENT_ENV;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
176
3283
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
177 // We want Strings and Classes to be embeddable by default since
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
178 // they used to be in the perm world. Not all Strings used to be
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
179 // embeddable but there's no easy way to distinguish the interned
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
180 // from the regulars ones so just treat them all that way.
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
181 if (klass() == env->String_klass() || klass() == env->Class_klass()) {
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
182 return true;
01fd6090fdd8 7032162: assert(flat != TypePtr::BOTTOM) failed: cannot alias-analyze an untyped ptr
never
parents: 1972
diff changeset
183 }
3905
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
184 if (EnableInvokeDynamic &&
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
185 (klass()->is_subclass_of(env->MethodHandle_klass()) ||
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
186 klass()->is_subclass_of(env->CallSite_klass()))) {
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
187 assert(ScavengeRootsInCode >= 1, "must be");
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
188 // We want to treat these aggressively.
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
189 return true;
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
190 }
c26de9aef2ed 7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents: 3402
diff changeset
191
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
192 return handle() == NULL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
195 // ------------------------------------------------------------------
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
196 // ciObject::should_be_constant()
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
197 void ciObject::init_flags_from(oop x) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
198 int flags = 0;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
199 if (x != NULL) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
200 assert(Universe::heap()->is_in_reserved(x), "must be");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
201 if (x->is_scavengable())
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
202 flags |= SCAVENGABLE_FLAG;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
203 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
204 _ident |= flags;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
205 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
208 // ciObject::print
a61af66fc99e Initial load
duke
parents:
diff changeset
209 //
a61af66fc99e Initial load
duke
parents:
diff changeset
210 // Print debugging output about this ciObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
211 //
a61af66fc99e Initial load
duke
parents:
diff changeset
212 // Implementation note: dispatch to the virtual print_impl behavior
a61af66fc99e Initial load
duke
parents:
diff changeset
213 // for this ciObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
214 void ciObject::print(outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 st->print("<%s", type_string());
a61af66fc99e Initial load
duke
parents:
diff changeset
216 GUARDED_VM_ENTRY(print_impl(st);)
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 3905
diff changeset
217 st->print(" ident=%d %s address=0x%x>", ident(),
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
218 is_scavengable() ? "SCAVENGABLE" : "",
0
a61af66fc99e Initial load
duke
parents:
diff changeset
219 (address)this);
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 // ------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
223 // ciObject::print_oop
a61af66fc99e Initial load
duke
parents:
diff changeset
224 //
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // Print debugging output about the oop this ciObject represents.
a61af66fc99e Initial load
duke
parents:
diff changeset
226 void ciObject::print_oop(outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (is_null_object()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 st->print_cr("NULL");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 } else if (!is_loaded()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 st->print_cr("UNLOADED");
a61af66fc99e Initial load
duke
parents:
diff changeset
231 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 GUARDED_VM_ENTRY(get_oop()->print_on(st);)
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 }