annotate src/share/vm/ci/ciObject.hpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 46f211fe010c 1d7922586cf6
children e522a00b91aa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2426
1d1603768966 7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents: 2177
diff changeset
2 * Copyright (c) 1999, 2011, 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: 1138
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1138
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: 1138
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 #ifndef SHARE_VM_CI_CIOBJECT_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_CI_CIOBJECT_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "ci/ciClassList.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "runtime/handles.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "runtime/jniHandles.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // This class represents an oop in the HotSpot virtual machine.
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // Its subclasses are structured in a hierarchy which mirrors
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // an aggregate of the VM's oop and klass hierarchies (see
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // oopHierarchy.hpp). Each instance of ciObject holds a handle
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // to a corresponding oop on the VM side and provides routines
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // for accessing the information in its oop. By using the ciObject
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // hierarchy for accessing oops in the VM, the compiler ensures
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // that it is safe with respect to garbage collection; that is,
a61af66fc99e Initial load
duke
parents:
diff changeset
43 // GC and compilation can proceed independently without
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // interference.
a61af66fc99e Initial load
duke
parents:
diff changeset
45 //
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Within the VM, the oop and klass hierarchies are separate.
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // The compiler interface does not preserve this separation --
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // the distinction between `klassOop' and `Klass' are not
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // reflected in the interface and instead the Klass hierarchy
a61af66fc99e Initial load
duke
parents:
diff changeset
50 // is directly modeled as the subclasses of ciKlass.
a61af66fc99e Initial load
duke
parents:
diff changeset
51 class ciObject : public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 CI_PACKAGE_ACCESS
a61af66fc99e Initial load
duke
parents:
diff changeset
53 friend class ciEnv;
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // A JNI handle referring to an oop in the VM. This
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // handle may, in a small set of cases, correctly be NULL.
a61af66fc99e Initial load
duke
parents:
diff changeset
58 jobject _handle;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ciKlass* _klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 uint _ident;
a61af66fc99e Initial load
duke
parents:
diff changeset
61
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
62 enum { FLAG_BITS = 2 };
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 enum {
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
64 PERM_FLAG = 1,
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
65 SCAVENGABLE_FLAG = 2
0
a61af66fc99e Initial load
duke
parents:
diff changeset
66 };
a61af66fc99e Initial load
duke
parents:
diff changeset
67 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
68 ciObject();
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ciObject(oop o);
a61af66fc99e Initial load
duke
parents:
diff changeset
70 ciObject(Handle h);
a61af66fc99e Initial load
duke
parents:
diff changeset
71 ciObject(ciKlass* klass);
a61af66fc99e Initial load
duke
parents:
diff changeset
72
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1138
diff changeset
73 public:
0
a61af66fc99e Initial load
duke
parents:
diff changeset
74 jobject handle() const { return _handle; }
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // Get the VM oop that this object holds.
a61af66fc99e Initial load
duke
parents:
diff changeset
76 oop get_oop() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 assert(_handle != NULL, "null oop");
a61af66fc99e Initial load
duke
parents:
diff changeset
78 return JNIHandles::resolve_non_null(_handle);
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
1406
35069ca331f2 Hooked C1XCompiler class into the system.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1138
diff changeset
80 protected:
0
a61af66fc99e Initial load
duke
parents:
diff changeset
81
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
82 void init_flags_from(oop x) {
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
83 int flags = 0;
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
84 if (x != NULL) {
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
85 if (x->is_perm())
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
86 flags |= PERM_FLAG;
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
87 if (x->is_scavengable())
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
88 flags |= SCAVENGABLE_FLAG;
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
89 }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
90 _ident |= flags;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // Virtual behavior of the print() method.
a61af66fc99e Initial load
duke
parents:
diff changeset
94 virtual void print_impl(outputStream* st) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 virtual const char* type_string() { return "ciObject"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 void set_ident(uint id);
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // The klass of this ciObject.
a61af66fc99e Initial load
duke
parents:
diff changeset
101 ciKlass* klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // A number unique to this object.
a61af66fc99e Initial load
duke
parents:
diff changeset
104 uint ident();
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // Are two ciObjects equal?
a61af66fc99e Initial load
duke
parents:
diff changeset
107 bool equals(ciObject* obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // A hash value for the convenience of compilers.
a61af66fc99e Initial load
duke
parents:
diff changeset
110 int hash();
a61af66fc99e Initial load
duke
parents:
diff changeset
111
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
112 // Tells if this oop has an encoding as a constant.
3402
28a9fe9534ea 7048030: is_scavengable changes causing compiler to embed more constants
kvn
parents: 2426
diff changeset
113 // True if is_perm is true.
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
114 // Also true if ScavengeRootsInCode is non-zero.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // If it does not have an encoding, the compiler is responsible for
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // making other arrangements for dealing with the oop.
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
117 // See ciEnv::make_array
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
118 bool can_be_constant();
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
119
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
120 // Tells if this oop should be made a constant.
3402
28a9fe9534ea 7048030: is_scavengable changes causing compiler to embed more constants
kvn
parents: 2426
diff changeset
121 // True if is_perm is true or ScavengeRootsInCode > 1.
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
122 bool should_be_constant();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // Is this object guaranteed to be in the permanent part of the heap?
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // If so, CollectedHeap::can_elide_permanent_oop_store_barriers is relevant.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // If the answer is false, no guarantees are made.
a61af66fc99e Initial load
duke
parents:
diff changeset
127 bool is_perm() { return (_ident & PERM_FLAG) != 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
129 // Might this object possibly move during a scavenge operation?
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
130 // If the answer is true and ScavengeRootsInCode==0, the oop cannot be embedded in code.
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
131 bool is_scavengable() { return (_ident & SCAVENGABLE_FLAG) != 0; }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
132
0
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // The address which the compiler should embed into the
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // generated code to represent this oop. This address
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // is not the true address of the oop -- it will get patched
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // during nmethod creation.
a61af66fc99e Initial load
duke
parents:
diff changeset
137 //
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // Usage note: no address arithmetic allowed. Oop must
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // be registered with the oopRecorder.
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
140 jobject constant_encoding();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // What kind of ciObject is this?
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
143 virtual bool is_null_object() const { return false; }
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
144 virtual bool is_call_site() const { return false; }
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
145 virtual bool is_cpcache() const { return false; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
146 virtual bool is_instance() { return false; }
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
147 virtual bool is_member_name() const { return false; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
148 virtual bool is_method() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 virtual bool is_method_data() { return false; }
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
150 virtual bool is_method_handle() const { return false; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
151 virtual bool is_array() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
152 virtual bool is_obj_array() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 virtual bool is_type_array() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 virtual bool is_symbol() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
155 virtual bool is_type() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
156 virtual bool is_return_address() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
157 virtual bool is_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
158 virtual bool is_instance_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
159 virtual bool is_method_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
160 virtual bool is_array_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
161 virtual bool is_obj_array_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 virtual bool is_type_array_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
163 virtual bool is_symbol_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
164 virtual bool is_klass_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
165 virtual bool is_instance_klass_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
166 virtual bool is_array_klass_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
167 virtual bool is_obj_array_klass_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
168 virtual bool is_type_array_klass_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 // Is this a type or value which has no associated class?
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // It is true of primitive types and null objects.
a61af66fc99e Initial load
duke
parents:
diff changeset
172 virtual bool is_classless() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 // Is this ciObject a Java Language Object? That is,
a61af66fc99e Initial load
duke
parents:
diff changeset
175 // is the ciObject an instance or an array
a61af66fc99e Initial load
duke
parents:
diff changeset
176 virtual bool is_java_object() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // Does this ciObject represent a Java Language class?
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // That is, is the ciObject an instanceKlass or arrayKlass?
a61af66fc99e Initial load
duke
parents:
diff changeset
180 virtual bool is_java_klass() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 // Is this ciObject the ciInstanceKlass representing
a61af66fc99e Initial load
duke
parents:
diff changeset
183 // java.lang.Object()?
a61af66fc99e Initial load
duke
parents:
diff changeset
184 virtual bool is_java_lang_Object() { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 // Does this ciObject refer to a real oop in the VM?
a61af66fc99e Initial load
duke
parents:
diff changeset
187 //
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // Note: some ciObjects refer to oops which have yet to be
a61af66fc99e Initial load
duke
parents:
diff changeset
189 // created. We refer to these as "unloaded". Specifically,
a61af66fc99e Initial load
duke
parents:
diff changeset
190 // there are unloaded ciMethods, ciObjArrayKlasses, and
a61af66fc99e Initial load
duke
parents:
diff changeset
191 // ciInstanceKlasses. By convention the ciNullObject is
a61af66fc99e Initial load
duke
parents:
diff changeset
192 // considered loaded, and primitive types are considered loaded.
a61af66fc99e Initial load
duke
parents:
diff changeset
193 bool is_loaded() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
194 return handle() != NULL || is_classless();
a61af66fc99e Initial load
duke
parents:
diff changeset
195 }
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // Subclass casting with assertions.
a61af66fc99e Initial load
duke
parents:
diff changeset
198 ciNullObject* as_null_object() {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 assert(is_null_object(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
200 return (ciNullObject*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
201 }
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
202 ciCallSite* as_call_site() {
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
203 assert(is_call_site(), "bad cast");
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
204 return (ciCallSite*) this;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
205 }
1137
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 989
diff changeset
206 ciCPCache* as_cpcache() {
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 989
diff changeset
207 assert(is_cpcache(), "bad cast");
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 989
diff changeset
208 return (ciCPCache*) this;
97125851f396 6829187: compiler optimizations required for JSR 292
twisti
parents: 989
diff changeset
209 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
210 ciInstance* as_instance() {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 assert(is_instance(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
212 return (ciInstance*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
213 }
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
214 ciMemberName* as_member_name() {
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
215 assert(is_member_name(), "bad cast");
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
216 return (ciMemberName*)this;
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
217 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
218 ciMethod* as_method() {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 assert(is_method(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
220 return (ciMethod*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
221 }
a61af66fc99e Initial load
duke
parents:
diff changeset
222 ciMethodData* as_method_data() {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 assert(is_method_data(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
224 return (ciMethodData*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
225 }
1138
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
226 ciMethodHandle* as_method_handle() {
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
227 assert(is_method_handle(), "bad cast");
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
228 return (ciMethodHandle*) this;
dd57230ba8fe 6893268: additional dynamic language related optimizations in C2
twisti
parents: 1137
diff changeset
229 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
230 ciArray* as_array() {
a61af66fc99e Initial load
duke
parents:
diff changeset
231 assert(is_array(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
232 return (ciArray*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
233 }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 ciObjArray* as_obj_array() {
a61af66fc99e Initial load
duke
parents:
diff changeset
235 assert(is_obj_array(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
236 return (ciObjArray*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 ciTypeArray* as_type_array() {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 assert(is_type_array(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
240 return (ciTypeArray*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 ciSymbol* as_symbol() {
a61af66fc99e Initial load
duke
parents:
diff changeset
243 assert(is_symbol(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
244 return (ciSymbol*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 ciType* as_type() {
a61af66fc99e Initial load
duke
parents:
diff changeset
247 assert(is_type(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
248 return (ciType*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
249 }
a61af66fc99e Initial load
duke
parents:
diff changeset
250 ciReturnAddress* as_return_address() {
a61af66fc99e Initial load
duke
parents:
diff changeset
251 assert(is_return_address(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
252 return (ciReturnAddress*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
253 }
a61af66fc99e Initial load
duke
parents:
diff changeset
254 ciKlass* as_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
255 assert(is_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
256 return (ciKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
257 }
a61af66fc99e Initial load
duke
parents:
diff changeset
258 ciInstanceKlass* as_instance_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
259 assert(is_instance_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
260 return (ciInstanceKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
261 }
a61af66fc99e Initial load
duke
parents:
diff changeset
262 ciMethodKlass* as_method_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 assert(is_method_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
264 return (ciMethodKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
265 }
a61af66fc99e Initial load
duke
parents:
diff changeset
266 ciArrayKlass* as_array_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
267 assert(is_array_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
268 return (ciArrayKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
269 }
a61af66fc99e Initial load
duke
parents:
diff changeset
270 ciObjArrayKlass* as_obj_array_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
271 assert(is_obj_array_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
272 return (ciObjArrayKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
273 }
a61af66fc99e Initial load
duke
parents:
diff changeset
274 ciTypeArrayKlass* as_type_array_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
275 assert(is_type_array_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
276 return (ciTypeArrayKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
277 }
a61af66fc99e Initial load
duke
parents:
diff changeset
278 ciKlassKlass* as_klass_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
279 assert(is_klass_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
280 return (ciKlassKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
281 }
a61af66fc99e Initial load
duke
parents:
diff changeset
282 ciInstanceKlassKlass* as_instance_klass_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
283 assert(is_instance_klass_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
284 return (ciInstanceKlassKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
285 }
a61af66fc99e Initial load
duke
parents:
diff changeset
286 ciArrayKlassKlass* as_array_klass_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
287 assert(is_array_klass_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
288 return (ciArrayKlassKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
289 }
a61af66fc99e Initial load
duke
parents:
diff changeset
290 ciObjArrayKlassKlass* as_obj_array_klass_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
291 assert(is_obj_array_klass_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
292 return (ciObjArrayKlassKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
293 }
a61af66fc99e Initial load
duke
parents:
diff changeset
294 ciTypeArrayKlassKlass* as_type_array_klass_klass() {
a61af66fc99e Initial load
duke
parents:
diff changeset
295 assert(is_type_array_klass_klass(), "bad cast");
a61af66fc99e Initial load
duke
parents:
diff changeset
296 return (ciTypeArrayKlassKlass*)this;
a61af66fc99e Initial load
duke
parents:
diff changeset
297 }
a61af66fc99e Initial load
duke
parents:
diff changeset
298
a61af66fc99e Initial load
duke
parents:
diff changeset
299 // Print debugging output about this ciObject.
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
300 void print(outputStream* st);
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 3402
diff changeset
301 void print() { print(tty); } // GDB cannot handle default arguments
0
a61af66fc99e Initial load
duke
parents:
diff changeset
302
a61af66fc99e Initial load
duke
parents:
diff changeset
303 // Print debugging output about the oop this ciObject represents.
a61af66fc99e Initial load
duke
parents:
diff changeset
304 void print_oop(outputStream* st = tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
305 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
306
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
307 #endif // SHARE_VM_CI_CIOBJECT_HPP