1.1 --- a/src/share/vm/ci/ciInstanceKlass.cpp Mon May 06 19:49:23 2013 -0700 1.2 +++ b/src/share/vm/ci/ciInstanceKlass.cpp Wed May 08 15:08:01 2013 -0700 1.3 @@ -211,13 +211,42 @@ 1.4 1.5 // ------------------------------------------------------------------ 1.6 // ciInstanceKlass::uses_default_loader 1.7 -bool ciInstanceKlass::uses_default_loader() { 1.8 +bool ciInstanceKlass::uses_default_loader() const { 1.9 // Note: We do not need to resolve the handle or enter the VM 1.10 // in order to test null-ness. 1.11 return _loader == NULL; 1.12 } 1.13 1.14 // ------------------------------------------------------------------ 1.15 + 1.16 +/** 1.17 + * Return basic type of boxed value for box klass or T_OBJECT if not. 1.18 + */ 1.19 +BasicType ciInstanceKlass::box_klass_type() const { 1.20 + if (uses_default_loader() && is_loaded()) { 1.21 + return SystemDictionary::box_klass_type(get_Klass()); 1.22 + } else { 1.23 + return T_OBJECT; 1.24 + } 1.25 +} 1.26 + 1.27 +/** 1.28 + * Is this boxing klass? 1.29 + */ 1.30 +bool ciInstanceKlass::is_box_klass() const { 1.31 + return is_java_primitive(box_klass_type()); 1.32 +} 1.33 + 1.34 +/** 1.35 + * Is this boxed value offset? 1.36 + */ 1.37 +bool ciInstanceKlass::is_boxed_value_offset(int offset) const { 1.38 + BasicType bt = box_klass_type(); 1.39 + return is_java_primitive(bt) && 1.40 + (offset == java_lang_boxing_object::value_offset_in_bytes(bt)); 1.41 +} 1.42 + 1.43 +// ------------------------------------------------------------------ 1.44 // ciInstanceKlass::is_in_package 1.45 // 1.46 // Is this klass in the given package?