comparison src/share/vm/ci/ciInstanceKlass.cpp @ 10278:6f3fd5150b67

6934604: enable parts of EliminateAutoBox by default Summary: Resurrected autobox elimination code and enabled part of it by default. Reviewed-by: roland, twisti
author kvn
date Wed, 08 May 2013 15:08:01 -0700
parents fcc9e7681d63
children 836a62f43af9 b2e698d2276c
comparison
equal deleted inserted replaced
10277:aabf54ccedb1 10278:6f3fd5150b67
209 return equals(CURRENT_ENV->Object_klass()); 209 return equals(CURRENT_ENV->Object_klass());
210 } 210 }
211 211
212 // ------------------------------------------------------------------ 212 // ------------------------------------------------------------------
213 // ciInstanceKlass::uses_default_loader 213 // ciInstanceKlass::uses_default_loader
214 bool ciInstanceKlass::uses_default_loader() { 214 bool ciInstanceKlass::uses_default_loader() const {
215 // Note: We do not need to resolve the handle or enter the VM 215 // Note: We do not need to resolve the handle or enter the VM
216 // in order to test null-ness. 216 // in order to test null-ness.
217 return _loader == NULL; 217 return _loader == NULL;
218 }
219
220 // ------------------------------------------------------------------
221
222 /**
223 * Return basic type of boxed value for box klass or T_OBJECT if not.
224 */
225 BasicType ciInstanceKlass::box_klass_type() const {
226 if (uses_default_loader() && is_loaded()) {
227 return SystemDictionary::box_klass_type(get_Klass());
228 } else {
229 return T_OBJECT;
230 }
231 }
232
233 /**
234 * Is this boxing klass?
235 */
236 bool ciInstanceKlass::is_box_klass() const {
237 return is_java_primitive(box_klass_type());
238 }
239
240 /**
241 * Is this boxed value offset?
242 */
243 bool ciInstanceKlass::is_boxed_value_offset(int offset) const {
244 BasicType bt = box_klass_type();
245 return is_java_primitive(bt) &&
246 (offset == java_lang_boxing_object::value_offset_in_bytes(bt));
218 } 247 }
219 248
220 // ------------------------------------------------------------------ 249 // ------------------------------------------------------------------
221 // ciInstanceKlass::is_in_package 250 // ciInstanceKlass::is_in_package
222 // 251 //