114 // Is this object guaranteed to be in the permanent part of the heap?
115 // If so, CollectedHeap::can_elide_permanent_oop_store_barriers is relevant.
116 // If the answer is false, no guarantees are made.
117 bool is_perm() { return (_ident & PERM_FLAG) != 0; }
118
119 // Might this object possibly move during a scavenge operation?
120 // If the answer is true and ScavengeRootsInCode==0, the oop cannot be embedded in code.
121 bool is_scavengable() { return (_ident & SCAVENGABLE_FLAG) != 0; }
122
123 // The address which the compiler should embed into the
124 // generated code to represent this oop. This address
125 // is not the true address of the oop -- it will get patched
126 // during nmethod creation.
127 //
128 // Usage note: no address arithmetic allowed. Oop must
129 // be registered with the oopRecorder.
130 jobject constant_encoding();
131
132 // What kind of ciObject is this?
133 virtual bool is_null_object() const { return false; }
134 virtual bool is_cpcache() const { return false; }
135 virtual bool is_instance() { return false; }
136 virtual bool is_method() { return false; }
137 virtual bool is_method_data() { return false; }
138 virtual bool is_array() { return false; }
139 virtual bool is_obj_array() { return false; }
140 virtual bool is_type_array() { return false; }
141 virtual bool is_symbol() { return false; }
142 virtual bool is_type() { return false; }
143 virtual bool is_return_address() { return false; }
144 virtual bool is_klass() { return false; }
145 virtual bool is_instance_klass() { return false; }
146 virtual bool is_method_klass() { return false; }
147 virtual bool is_array_klass() { return false; }
148 virtual bool is_obj_array_klass() { return false; }
149 virtual bool is_type_array_klass() { return false; }
150 virtual bool is_symbol_klass() { return false; }
151 virtual bool is_klass_klass() { return false; }
152 virtual bool is_instance_klass_klass() { return false; }
153 virtual bool is_array_klass_klass() { return false; }
154 virtual bool is_obj_array_klass_klass() { return false; }
155 virtual bool is_type_array_klass_klass() { return false; }
156
157 // Is this a type or value which has no associated class?
169 // Is this ciObject the ciInstanceKlass representing
170 // java.lang.Object()?
171 virtual bool is_java_lang_Object() { return false; }
172
173 // Does this ciObject refer to a real oop in the VM?
174 //
175 // Note: some ciObjects refer to oops which have yet to be
176 // created. We refer to these as "unloaded". Specifically,
177 // there are unloaded ciMethods, ciObjArrayKlasses, and
178 // ciInstanceKlasses. By convention the ciNullObject is
179 // considered loaded, and primitive types are considered loaded.
180 bool is_loaded() const {
181 return handle() != NULL || is_classless();
182 }
183
184 // Subclass casting with assertions.
185 ciNullObject* as_null_object() {
186 assert(is_null_object(), "bad cast");
187 return (ciNullObject*)this;
188 }
189 ciCPCache* as_cpcache() {
190 assert(is_cpcache(), "bad cast");
191 return (ciCPCache*) this;
192 }
193 ciInstance* as_instance() {
194 assert(is_instance(), "bad cast");
195 return (ciInstance*)this;
196 }
197 ciMethod* as_method() {
198 assert(is_method(), "bad cast");
199 return (ciMethod*)this;
200 }
201 ciMethodData* as_method_data() {
202 assert(is_method_data(), "bad cast");
203 return (ciMethodData*)this;
204 }
205 ciArray* as_array() {
206 assert(is_array(), "bad cast");
207 return (ciArray*)this;
208 }
209 ciObjArray* as_obj_array() {
210 assert(is_obj_array(), "bad cast");
211 return (ciObjArray*)this;
212 }
213 ciTypeArray* as_type_array() {
214 assert(is_type_array(), "bad cast");
215 return (ciTypeArray*)this;
216 }
217 ciSymbol* as_symbol() {
218 assert(is_symbol(), "bad cast");
219 return (ciSymbol*)this;
220 }
221 ciType* as_type() {
222 assert(is_type(), "bad cast");
223 return (ciType*)this;
224 }
|
114 // Is this object guaranteed to be in the permanent part of the heap?
115 // If so, CollectedHeap::can_elide_permanent_oop_store_barriers is relevant.
116 // If the answer is false, no guarantees are made.
117 bool is_perm() { return (_ident & PERM_FLAG) != 0; }
118
119 // Might this object possibly move during a scavenge operation?
120 // If the answer is true and ScavengeRootsInCode==0, the oop cannot be embedded in code.
121 bool is_scavengable() { return (_ident & SCAVENGABLE_FLAG) != 0; }
122
123 // The address which the compiler should embed into the
124 // generated code to represent this oop. This address
125 // is not the true address of the oop -- it will get patched
126 // during nmethod creation.
127 //
128 // Usage note: no address arithmetic allowed. Oop must
129 // be registered with the oopRecorder.
130 jobject constant_encoding();
131
132 // What kind of ciObject is this?
133 virtual bool is_null_object() const { return false; }
134 virtual bool is_call_site() const { return false; }
135 virtual bool is_cpcache() const { return false; }
136 virtual bool is_instance() { return false; }
137 virtual bool is_method() { return false; }
138 virtual bool is_method_data() { return false; }
139 virtual bool is_method_handle() const { return false; }
140 virtual bool is_array() { return false; }
141 virtual bool is_obj_array() { return false; }
142 virtual bool is_type_array() { return false; }
143 virtual bool is_symbol() { return false; }
144 virtual bool is_type() { return false; }
145 virtual bool is_return_address() { return false; }
146 virtual bool is_klass() { return false; }
147 virtual bool is_instance_klass() { return false; }
148 virtual bool is_method_klass() { return false; }
149 virtual bool is_array_klass() { return false; }
150 virtual bool is_obj_array_klass() { return false; }
151 virtual bool is_type_array_klass() { return false; }
152 virtual bool is_symbol_klass() { return false; }
153 virtual bool is_klass_klass() { return false; }
154 virtual bool is_instance_klass_klass() { return false; }
155 virtual bool is_array_klass_klass() { return false; }
156 virtual bool is_obj_array_klass_klass() { return false; }
157 virtual bool is_type_array_klass_klass() { return false; }
158
159 // Is this a type or value which has no associated class?
171 // Is this ciObject the ciInstanceKlass representing
172 // java.lang.Object()?
173 virtual bool is_java_lang_Object() { return false; }
174
175 // Does this ciObject refer to a real oop in the VM?
176 //
177 // Note: some ciObjects refer to oops which have yet to be
178 // created. We refer to these as "unloaded". Specifically,
179 // there are unloaded ciMethods, ciObjArrayKlasses, and
180 // ciInstanceKlasses. By convention the ciNullObject is
181 // considered loaded, and primitive types are considered loaded.
182 bool is_loaded() const {
183 return handle() != NULL || is_classless();
184 }
185
186 // Subclass casting with assertions.
187 ciNullObject* as_null_object() {
188 assert(is_null_object(), "bad cast");
189 return (ciNullObject*)this;
190 }
191 ciCallSite* as_call_site() {
192 assert(is_call_site(), "bad cast");
193 return (ciCallSite*) this;
194 }
195 ciCPCache* as_cpcache() {
196 assert(is_cpcache(), "bad cast");
197 return (ciCPCache*) this;
198 }
199 ciInstance* as_instance() {
200 assert(is_instance(), "bad cast");
201 return (ciInstance*)this;
202 }
203 ciMethod* as_method() {
204 assert(is_method(), "bad cast");
205 return (ciMethod*)this;
206 }
207 ciMethodData* as_method_data() {
208 assert(is_method_data(), "bad cast");
209 return (ciMethodData*)this;
210 }
211 ciMethodHandle* as_method_handle() {
212 assert(is_method_handle(), "bad cast");
213 return (ciMethodHandle*) this;
214 }
215 ciArray* as_array() {
216 assert(is_array(), "bad cast");
217 return (ciArray*)this;
218 }
219 ciObjArray* as_obj_array() {
220 assert(is_obj_array(), "bad cast");
221 return (ciObjArray*)this;
222 }
223 ciTypeArray* as_type_array() {
224 assert(is_type_array(), "bad cast");
225 return (ciTypeArray*)this;
226 }
227 ciSymbol* as_symbol() {
228 assert(is_symbol(), "bad cast");
229 return (ciSymbol*)this;
230 }
231 ciType* as_type() {
232 assert(is_type(), "bad cast");
233 return (ciType*)this;
234 }
|